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
• 2,920 points
174 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

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

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

answered Jun 1, 2018 in AWS by Cloud gunner
• 4,260 points
55 views
0 votes
1 answer

Invalid Bucket name when creating s3 bucket with AWS SDK

AWS provides naming standards when naming an ...READ MORE

answered Aug 30, 2018 in AWS by Priyaj
• 56,540 points
336 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
• 56,540 points
1,696 views
0 votes
1 answer