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 in AWS by akhtar
• 33,410 points
30 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 by MD
• 79,270 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
938 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 4, 2018 in AWS by Shuvodip Ghosh
1,693 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
• 57,700 points
545 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 in AWS by MD
• 79,270 points
55 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 in AWS by MD
• 79,270 points
256 views