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,870 points
67 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,240 points
22 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,140 points
159 views
0 votes
1 answer
+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,140 points
1,017 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.