NameError name nitesh1995 is not defined Error while creating a bucket

0 votes

I am getting this error

NameError: name 'nitesh1995' is not defined

I am using BOTO3 with python for creating a S3 bucket.

import boto3
s3_resource = boto3.resource('s3')
s3_resource.create_bucket(Bucket= nitesh1995)

This is code I am using. Can someone help please?

Nov 30, 2018 in AWS by Nitesh
• 3,080 points
3,136 views

1 answer to this question.

0 votes

Hello @nitesh,

You are getting the error because when you pass the name of the bucket it is string. Here in your program it is not treated as string. 

import boto3
s3_resource = boto3.resource('s3')
s3_resource.create_bucket(Bucket= 'anikets3bucket')

Use the name within the quotes to mark it as string.

Hope this helps!

answered Nov 30, 2018 by Aniket

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

if instance is a part of some AutoScaling Group in AWS or not ?

You can run this command below on ...READ MORE

answered Jun 2, 2018 in AWS by Cloud gunner
• 4,670 points
1,774 views
+1 vote
2 answers
0 votes
1 answer

how to access AWS S3 from Lambda in VPC

With boto3, the S3 urls are virtual by default, ...READ MORE

answered Sep 28, 2018 in AWS by Priyaj
• 58,060 points
10,098 views
+1 vote
3 answers

Which is better ? AWS S3 bucket logs vs AWS cloudtrail

CloudTrail logs API calls accessed to your ...READ MORE

answered Aug 16, 2018 in AWS by Priyaj
• 58,060 points
7,341 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP