Assign a name to AWS VPC using Boto3

0 votes

Hi Guys,

I am new to the boto3 module. I have created one VPC in AWS with the help of the boto3 module. But I forget to assign a name to the VPC. How can I assign a name to the VPC?

Oct 9, 2020 in AWS by akhtar
• 38,230 points
776 views

1 answer to this question.

0 votes

Hi@akhtar,

You can create a VPC in AWS with the help of the create_vpc method. But to assign a name to the VPC, you need to use the create_tag method as shown below.

import boto3
ec2 = boto3.resource('ec2')
vpc = ec2.create_vpc(CidrBlock='172.16.0.0/16')
vpc.create_tags(Tags=[{"Key": "Name", "Value": "my_vpc"}])
vpc.wait_until_available()
answered Oct 9, 2020 by MD
• 95,440 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

How to delete a VPC using boto3?

You can view this answer here : https://www.edureka.co/community/32160/getting-error-while-deleting-my-vpc Before ...READ MORE

answered Dec 4, 2018 in AWS by Shuvodip Ghosh
2,438 views
0 votes
1 answer

How to create subnets in a vpc using boto3?

Here is the simple way of implementing ...READ MORE

answered Dec 5, 2018 in AWS by Shuvodip Ghosh
4,057 views
+3 votes
2 answers

AWS VPN architecture diagram creation.

Yes you can go ahead and use ...READ MORE

answered Jul 13, 2018 in AWS by Priyaj
• 58,090 points
1,738 views
0 votes
1 answer
0 votes
1 answer

How to create a VPC in AWS using Boto3?

Hi@akhtar, Amazon Web Services enables you to create ...READ MORE

answered Oct 9, 2020 in AWS by MD
• 95,440 points
1,403 views
0 votes
1 answer

not able to delete a security group for my Amazon VPC in AWS?

Hi@akhtar, When you try to delete that security ...READ MORE

answered Mar 18, 2020 in AWS by MD
• 95,440 points
2,354 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