EC2 CLI. Help creating VPCs with name

Question:

I am trying to streamline the process for creating VPC/EC2 environments without using the gui. I also want to automate it by telling a script what I want created with what properties.

I decided that the best place to start is to create a VPC and create an EC2 instance with in it.

I am using

But I wanted to name it something like myVPC. Is there a way to do things like this? I am very new to this so if you have any documentation regarding this please send it my way.

Thank you!

Answer:

If you really want a one liner:

It is a concatenation of two commands explained below.


Adding a tag while creating a VPC is not supported yet. Create a VPC like the following. The last value is VPC ID.


Use create-tags to add a tag to the created VPC

Leave a Reply