-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8eddfce
commit bd42a5e
Showing
75 changed files
with
1,854 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
**To assign a specific secondary private IP address a network interface** | ||
|
||
This example assigns the specified secondary private IP address to the specified network interface. | ||
|
||
Command:: | ||
|
||
aws ec2 assign-private-ip-addresses --network-interface-id eni-e5aa89a3 --private-ip-addresses 10.0.0.82 | ||
|
||
Output:: | ||
|
||
{ | ||
"return": "true" | ||
} | ||
|
||
**To assign secondary private IP addresses that Amazon EC2 selects to a network interface** | ||
|
||
This example assigns two secondary private IP addresses to the specified network interface. Amazon EC2 automatically assigns these IP addresses from the available IP addresses in the CIDR block range of the subnet the network interface is associated with. | ||
|
||
Command:: | ||
|
||
aws ec2 assign-private-ip-addresses --network-interface-id eni-e5aa89a3 --secondary-private-ip-address-count 2 | ||
|
||
Output:: | ||
|
||
{ | ||
"return": "true" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
**To associate a DHCP options set with your VPC** | ||
|
||
This example associates the specified DHCP options set with the specified VPC. | ||
|
||
Command:: | ||
|
||
aws ec2 associate-dhcp-options --dhcp-options-id dopt-d9070ebb --vpc-id vpc-a01106c2 | ||
|
||
Output:: | ||
|
||
{ | ||
"return": "true" | ||
} | ||
|
||
**To associate the default DHCP options set with your VPC** | ||
|
||
This example associates the default DHCP options set with the specified VPC. | ||
|
||
Command:: | ||
|
||
aws ec2 associate-dhcp-options --dhcp-options-id default --vpc-id vpc-a01106c2 | ||
|
||
Output:: | ||
|
||
{ | ||
"return": "true" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
**To associate a route table with a subnet** | ||
|
||
This example associates the specified route table with the specified subnet. | ||
|
||
Command:: | ||
|
||
aws ec2 associate-route-table --route-table-id rtb-22574640 --subnet-id subnet-9d4a7b6c | ||
|
||
Output:: | ||
|
||
{ | ||
"AssociationId": "rtbassoc-781d0d1a" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
**To attach an Internet gateway to your VPC** | ||
|
||
This example attaches the specified Internet gateway to the specified VPC. | ||
|
||
Command:: | ||
|
||
aws ec2 attach-internet-gateway --internet-gateway-id igw-c0a643a9 --vpc-id vpc-a01106c2 | ||
|
||
Output:: | ||
|
||
{ | ||
"return": "true" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
**To attach a network interface to an instance** | ||
|
||
This example attaches the specified network interface to the specified instance. | ||
|
||
Command:: | ||
|
||
aws ec2 attach-network-interface --network-interface-id eni-e5aa89a3 --instance-id i-640a3c17 --device-index 1 | ||
|
||
Output:: | ||
|
||
{ | ||
"AttachmentId": "eni-attach-66c4350a" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
**To attach a virtual private gateway to your VPC** | ||
|
||
This example attaches the specified virtual private gateway to the specified VPC. | ||
|
||
Command:: | ||
|
||
aws ec2 attach-vpn-gateway --vpn-gateway-id vgw-9a4cacf3 --vpc-id vpc-a01106c2 | ||
|
||
Output:: | ||
|
||
{ | ||
"VpcAttachement": { | ||
"State": "attaching", | ||
"VpcId": "vpc-a01106c2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
**To copy an AMI to another region** | ||
|
||
This example copies the specified AMI from the ``us-east-1`` region to the ``ap-northeast-1`` region. | ||
|
||
Command:: | ||
|
||
aws ec2 copy-image --source-image-id ami-5731123e --source-region us-east-1 --region ap-northeast-1 --name "My server" | ||
|
||
Output:: | ||
|
||
{ | ||
"ImageId": "ami-438bea42" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
**To create a customer gateway** | ||
|
||
This example creates a customer gateway with the specified IP address for its outside interface. | ||
|
||
Command:: | ||
|
||
aws ec2 create-customer-gateway --type ipsec.1 --public-ip 12.1.2.3 --bgp-asn 65534 | ||
|
||
Output:: | ||
|
||
{ | ||
"CustomerGateway": { | ||
"CustomerGatewayId": "cgw-0e11f167", | ||
"IpAddress": "12.1.2.3", | ||
"State": "available", | ||
"Type": "ipsec.1", | ||
"BgpAsn": "65534" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
**To create a DHCP options set** | ||
|
||
This example creates a DHCP options set. | ||
|
||
Command:: | ||
|
||
aws ec2 create-dhcp-options --dhcp-configuration "Key=domain-name-servers,Values=10.2.5.1,10.2.5.2" | ||
|
||
Output:: | ||
|
||
{ | ||
"DhcpOptions": { | ||
"DhcpConfigurations": [ | ||
{ | ||
"Values": [ | ||
"10.2.5.2", | ||
"10.2.5.1" | ||
], | ||
"Key": "domain-name-servers" | ||
} | ||
], | ||
"DhcpOptionsId": "dopt-d9070ebb" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
**To create an AMI from an Amazon EBS-backed instance** | ||
|
||
This example creates an AMI from the specified instance. | ||
|
||
Command:: | ||
|
||
aws ec2 create-image --instance-id i-10a64379 --name "My server" --description "An AMI for my server" | ||
|
||
Output:: | ||
|
||
{ | ||
"ImageId": "ami-5731123e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
**To create an Internet gateway** | ||
|
||
This example creates an Internet gateway. | ||
|
||
Command:: | ||
|
||
aws ec2 create-internet-gateway | ||
|
||
Output:: | ||
|
||
{ | ||
"InternetGateway": { | ||
"Tags": [], | ||
"InternetGatewayId": "igw-c0a643a9", | ||
"Attachments": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
**To create a network ACL** | ||
|
||
This example creates a network ACL for the specified VPC. | ||
|
||
Command:: | ||
|
||
aws ec2 create-network-acl --vpc-id vpc-a01106c2 | ||
|
||
Output:: | ||
|
||
{ | ||
"NetworkAcl": { | ||
"Associations": [], | ||
"NetworkAclId": "acl-5fb85d36", | ||
"VpcId": "vpc-a01106c2", | ||
"Tags": [], | ||
"Entries": [ | ||
{ | ||
"CidrBlock": "0.0.0.0/0", | ||
"RuleNumber": 32767, | ||
"Protocol": "-1", | ||
"Egress": true, | ||
"RuleAction": "deny" | ||
}, | ||
{ | ||
"CidrBlock": "0.0.0.0/0", | ||
"RuleNumber": 32767, | ||
"Protocol": "-1", | ||
"Egress": false, | ||
"RuleAction": "deny" | ||
} | ||
], | ||
"IsDefault": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
**To create a network interface** | ||
|
||
This example creates a network interface for the specified subnet. | ||
|
||
Command:: | ||
|
||
aws ec2 create-network-interface --subnet-id subnet-9d4a7b6c --description "my network interface" --groups sg-903004f8 --private-ip-address 10.0.2.17 | ||
|
||
Output:: | ||
|
||
{ | ||
"NetworkInterface": { | ||
"Status": "pending", | ||
"MacAddress": "02:1a:80:41:52:9c", | ||
"SourceDestCheck": true, | ||
"VpcId": "vpc-a01106c2", | ||
"Description": "my network interface", | ||
"NetworkInterfaceId": "eni-e5aa89a3", | ||
"PrivateIpAddresses": [ | ||
{ | ||
"Primary": true, | ||
"PrivateIpAddress": "10.0.2.17" | ||
} | ||
], | ||
"RequesterManaged": false, | ||
"AvailabilityZone": "us-east-1d", | ||
"Groups": [ | ||
{ | ||
"GroupName": "default", | ||
"GroupId": "sg-903004f8" | ||
} | ||
], | ||
"SubnetId": "subnet-9d4a7b6c", | ||
"OwnerId": "123456789012", | ||
"TagSet": [], | ||
"PrivateIpAddress": "10.0.2.17" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
**To create a route table** | ||
|
||
This example creates a route table for the specified VPC. | ||
|
||
Command:: | ||
|
||
aws ec2 create-route-table --vpc-id vpc-a01106c2 | ||
|
||
Output:: | ||
|
||
{ | ||
"RouteTable": { | ||
"Associations": [], | ||
"RouteTableId": "rtb-22574640", | ||
"VpcId": "vpc-a01106c2", | ||
"PropagatingVgws": [], | ||
"Tags": [], | ||
"Routes": [ | ||
{ | ||
"GatewayId": "local", | ||
"DestinationCidrBlock": "10.0.0.0/16", | ||
"State": "active" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
**To create a route** | ||
|
||
This example creates a route for the specified route table. The route matches all traffic (``0.0.0.0/0``) and routes it to the specified Internet gateway. | ||
|
||
Command:: | ||
|
||
aws ec2 create-route --route-table-id rtb-22574640 --destination-cidr-block 0.0.0.0/0 --gateway-id igw-c0a643a9 | ||
|
||
Output:: | ||
|
||
{ | ||
"return": "true" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.