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 a Windows command line interface?
- How can I fix the "cli sed not found" error?
- How do I use the commandline sed tool to edit a file?
- How can I use sed in a command line interface?
- How can I use the 'sed' command line utility to add quotes around a string?
- How can I use the sed command in the Ubuntu command line interface?
- How do I use the command line to edit text using sed?
- How can I use cli sed to deploy an ARM template?
- How do I use sed to insert a new line in a command line interface?
- How can I use CLI sed to authenticate to AWS?
See more codes...