cli-sedHow can I use CLI sed to create a new VPC?
Using the sed command line interface (CLI) you can create a new Virtual Private Network (VPC). The following example will create a VPC with the name "myVPC" in the us-east-1 region:
aws ec2 create-vpc --cidr-block 10.0.0.0/16 --region us-east-1 --output text | sed -n -e 's/^VPCID\t//p'
The output of this command will be the VPC ID of the newly created VPC.
The code consists of 4 parts:
aws ec2 create-vpc
: This command creates a new VPC.--cidr-block 10.0.0.0/16
: This specifies the IP range for the VPC.--region us-east-1
: This specifies the region in which to create the VPC.--output text
: This specifies the output format.sed -n -e 's/^VPCID\t//p'
: This command parses the output of the create-vpc command to get the VPC ID.
Helpful links
More of Cli Sed
- How can I use sed in the command line on macOS?
- How do I use the CLI to configure Zabbix?
- How can I use SED in a Windows command line interface?
- How can I use the command line to compress and edit files with sed and zip?
- How do I use sed to insert a new line in a command line interface?
- How do I use the command line to compress a file using SED and ZIP?
- How can I use sed in a command line interface?
- How can I use the sed command in the Ubuntu command line interface?
- How can I use cli sed to select an Azure subscription?
- How can I use CLI sed to authenticate to AWS?
See more codes...