From bd42a5e11feb635d34a7e59c8e45cc8910f8a772 Mon Sep 17 00:00:00 2001 From: Eron Hennessey Date: Tue, 17 Dec 2013 15:56:57 -0800 Subject: [PATCH] Updates from AWS Doc team --- .../ec2/assign-private-ip-addresses.rst | 27 ++++ awscli/examples/ec2/associate-address.rst | 2 + .../examples/ec2/associate-dhcp-options.rst | 27 ++++ awscli/examples/ec2/associate-route-table.rst | 13 ++ .../examples/ec2/attach-internet-gateway.rst | 13 ++ .../examples/ec2/attach-network-interface.rst | 13 ++ awscli/examples/ec2/attach-vpn-gateway.rst | 16 ++ .../ec2/authorize-security-group-ingress.rst | 15 +- awscli/examples/ec2/copy-image.rst | 13 ++ .../examples/ec2/create-customer-gateway.rst | 19 +++ awscli/examples/ec2/create-dhcp-options.rst | 24 +++ awscli/examples/ec2/create-image.rst | 13 ++ .../examples/ec2/create-internet-gateway.rst | 17 +++ awscli/examples/ec2/create-network-acl.rst | 35 +++++ .../examples/ec2/create-network-interface.rst | 38 +++++ awscli/examples/ec2/create-route-table.rst | 26 ++++ awscli/examples/ec2/create-route.rst | 13 ++ awscli/examples/ec2/create-security-group.rst | 17 ++- awscli/examples/ec2/create-subnet.rst | 20 +++ awscli/examples/ec2/create-tags.rst | 4 +- awscli/examples/ec2/create-vpc.rst | 39 +++++ .../ec2/create-vpn-connection-route.rst | 13 ++ awscli/examples/ec2/create-vpn-connection.rst | 42 ++++++ awscli/examples/ec2/create-vpn-gateway.rst | 18 +++ .../examples/ec2/delete-customer-gateway.rst | 13 ++ awscli/examples/ec2/delete-dhcp-options.rst | 13 ++ .../examples/ec2/delete-internet-gateway.rst | 13 ++ awscli/examples/ec2/delete-network-acl.rst | 13 ++ .../examples/ec2/delete-network-interface.rst | 13 ++ awscli/examples/ec2/delete-route-table.rst | 13 ++ awscli/examples/ec2/delete-route.rst | 13 ++ awscli/examples/ec2/delete-security-group.rst | 16 +- awscli/examples/ec2/delete-subnet.rst | 13 ++ awscli/examples/ec2/delete-tags.rst | 2 +- awscli/examples/ec2/delete-vpc.rst | 13 ++ .../ec2/delete-vpn-connection-route.rst | 13 ++ awscli/examples/ec2/delete-vpn-connection.rst | 13 ++ awscli/examples/ec2/delete-vpn-gateway.rst | 13 ++ awscli/examples/ec2/deregister-image.rst | 13 ++ awscli/examples/ec2/describe-addresses.rst | 4 +- .../ec2/describe-customer-gateways.rst | 50 ++++++ awscli/examples/ec2/describe-dhcp-options.rst | 37 +++++ .../examples/ec2/describe-image-attribute.rst | 33 ++++ awscli/examples/ec2/describe-images.rst | 49 ++++++ .../ec2/describe-instance-attribute.rst | 4 +- .../ec2/describe-internet-gateways.rst | 54 +++++++ awscli/examples/ec2/describe-network-acls.rst | 122 +++++++++++++++ .../ec2/describe-network-interfaces.rst | 92 ++++++++++++ awscli/examples/ec2/describe-route-tables.rst | 63 ++++++++ .../examples/ec2/describe-security-groups.rst | 48 +++++- awscli/examples/ec2/describe-subnets.rst | 59 ++++++++ awscli/examples/ec2/describe-tags.rst | 4 +- .../examples/ec2/describe-vpc-attribute.rst | 33 ++++ awscli/examples/ec2/describe-vpcs.rst | 65 ++++++++ .../examples/ec2/describe-vpn-connections.rst | 44 ++++++ awscli/examples/ec2/describe-vpn-gateways.rst | 36 +++++ .../examples/ec2/detach-internet-gateway.rst | 13 ++ .../examples/ec2/detach-network-interface.rst | 13 ++ awscli/examples/ec2/detach-vpn-gateway.rst | 13 ++ .../ec2/disable-vgw-route-propagation.rst | 13 ++ .../examples/ec2/disassociate-route-table.rst | 13 ++ .../ec2/enable-vgw-route-propagation.rst | 13 ++ .../examples/ec2/modify-image-attribute.rst | 55 +++++++ .../ec2/modify-instance-attribute.rst | 4 +- awscli/examples/ec2/modify-vpc-attribute.rst | 27 ++++ awscli/examples/ec2/register-image.rst | 13 ++ .../ec2/replace-network-acl-association.rst | 13 ++ .../ec2/replace-route-table-association.rst | 13 ++ awscli/examples/ec2/replace-route.rst | 13 ++ awscli/examples/ec2/reset-image-attribute.rst | 13 ++ .../examples/ec2/reset-instance-attribute.rst | 6 +- awscli/examples/ec2/run-instances.rst | 142 +++++++++++++++++- .../ec2/unassign-private-ip-addresses.rst | 13 ++ awscli/examples/rds/create-db-instance.rst | 24 +++ .../elasticbeanstalk/create-environment.rst | 9 -- 75 files changed, 1854 insertions(+), 30 deletions(-) create mode 100644 awscli/examples/ec2/assign-private-ip-addresses.rst create mode 100644 awscli/examples/ec2/associate-dhcp-options.rst create mode 100644 awscli/examples/ec2/associate-route-table.rst create mode 100644 awscli/examples/ec2/attach-internet-gateway.rst create mode 100644 awscli/examples/ec2/attach-network-interface.rst create mode 100644 awscli/examples/ec2/attach-vpn-gateway.rst create mode 100644 awscli/examples/ec2/copy-image.rst create mode 100644 awscli/examples/ec2/create-customer-gateway.rst create mode 100644 awscli/examples/ec2/create-dhcp-options.rst create mode 100644 awscli/examples/ec2/create-image.rst create mode 100644 awscli/examples/ec2/create-internet-gateway.rst create mode 100644 awscli/examples/ec2/create-network-acl.rst create mode 100644 awscli/examples/ec2/create-network-interface.rst create mode 100644 awscli/examples/ec2/create-route-table.rst create mode 100644 awscli/examples/ec2/create-route.rst create mode 100644 awscli/examples/ec2/create-subnet.rst create mode 100644 awscli/examples/ec2/create-vpc.rst create mode 100644 awscli/examples/ec2/create-vpn-connection-route.rst create mode 100644 awscli/examples/ec2/create-vpn-connection.rst create mode 100644 awscli/examples/ec2/create-vpn-gateway.rst create mode 100644 awscli/examples/ec2/delete-customer-gateway.rst create mode 100644 awscli/examples/ec2/delete-dhcp-options.rst create mode 100644 awscli/examples/ec2/delete-internet-gateway.rst create mode 100644 awscli/examples/ec2/delete-network-acl.rst create mode 100644 awscli/examples/ec2/delete-network-interface.rst create mode 100644 awscli/examples/ec2/delete-route-table.rst create mode 100644 awscli/examples/ec2/delete-route.rst create mode 100644 awscli/examples/ec2/delete-subnet.rst create mode 100644 awscli/examples/ec2/delete-vpc.rst create mode 100644 awscli/examples/ec2/delete-vpn-connection-route.rst create mode 100644 awscli/examples/ec2/delete-vpn-connection.rst create mode 100644 awscli/examples/ec2/delete-vpn-gateway.rst create mode 100644 awscli/examples/ec2/deregister-image.rst create mode 100644 awscli/examples/ec2/describe-customer-gateways.rst create mode 100644 awscli/examples/ec2/describe-dhcp-options.rst create mode 100644 awscli/examples/ec2/describe-image-attribute.rst create mode 100644 awscli/examples/ec2/describe-images.rst create mode 100644 awscli/examples/ec2/describe-internet-gateways.rst create mode 100644 awscli/examples/ec2/describe-network-acls.rst create mode 100644 awscli/examples/ec2/describe-network-interfaces.rst create mode 100644 awscli/examples/ec2/describe-route-tables.rst create mode 100644 awscli/examples/ec2/describe-subnets.rst create mode 100644 awscli/examples/ec2/describe-vpc-attribute.rst create mode 100644 awscli/examples/ec2/describe-vpcs.rst create mode 100644 awscli/examples/ec2/describe-vpn-connections.rst create mode 100644 awscli/examples/ec2/describe-vpn-gateways.rst create mode 100644 awscli/examples/ec2/detach-internet-gateway.rst create mode 100644 awscli/examples/ec2/detach-network-interface.rst create mode 100644 awscli/examples/ec2/detach-vpn-gateway.rst create mode 100644 awscli/examples/ec2/disable-vgw-route-propagation.rst create mode 100644 awscli/examples/ec2/disassociate-route-table.rst create mode 100644 awscli/examples/ec2/enable-vgw-route-propagation.rst create mode 100644 awscli/examples/ec2/modify-image-attribute.rst create mode 100644 awscli/examples/ec2/modify-vpc-attribute.rst create mode 100644 awscli/examples/ec2/register-image.rst create mode 100644 awscli/examples/ec2/replace-network-acl-association.rst create mode 100644 awscli/examples/ec2/replace-route-table-association.rst create mode 100644 awscli/examples/ec2/replace-route.rst create mode 100644 awscli/examples/ec2/reset-image-attribute.rst create mode 100644 awscli/examples/ec2/unassign-private-ip-addresses.rst create mode 100644 awscli/examples/rds/create-db-instance.rst delete mode 100644 examples/elasticbeanstalk/create-environment.rst diff --git a/awscli/examples/ec2/assign-private-ip-addresses.rst b/awscli/examples/ec2/assign-private-ip-addresses.rst new file mode 100644 index 000000000000..7b9dce1394bb --- /dev/null +++ b/awscli/examples/ec2/assign-private-ip-addresses.rst @@ -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" + } \ No newline at end of file diff --git a/awscli/examples/ec2/associate-address.rst b/awscli/examples/ec2/associate-address.rst index 759920bc24e2..7579cabe2bdf 100644 --- a/awscli/examples/ec2/associate-address.rst +++ b/awscli/examples/ec2/associate-address.rst @@ -38,3 +38,5 @@ This example associates an Elastic IP with a private IP address that's associate Command:: aws ec2 associate-address --allocation-id eipalloc-64d5890a --network-interface-id eni-1a2b3c4d --private-ip-address 10.0.0.85 + + diff --git a/awscli/examples/ec2/associate-dhcp-options.rst b/awscli/examples/ec2/associate-dhcp-options.rst new file mode 100644 index 000000000000..96700ab1f4a6 --- /dev/null +++ b/awscli/examples/ec2/associate-dhcp-options.rst @@ -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" + } \ No newline at end of file diff --git a/awscli/examples/ec2/associate-route-table.rst b/awscli/examples/ec2/associate-route-table.rst new file mode 100644 index 000000000000..8ad2afcbe322 --- /dev/null +++ b/awscli/examples/ec2/associate-route-table.rst @@ -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" + } \ No newline at end of file diff --git a/awscli/examples/ec2/attach-internet-gateway.rst b/awscli/examples/ec2/attach-internet-gateway.rst new file mode 100644 index 000000000000..d9427d371be9 --- /dev/null +++ b/awscli/examples/ec2/attach-internet-gateway.rst @@ -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" + } \ No newline at end of file diff --git a/awscli/examples/ec2/attach-network-interface.rst b/awscli/examples/ec2/attach-network-interface.rst new file mode 100644 index 000000000000..6a17521d6c38 --- /dev/null +++ b/awscli/examples/ec2/attach-network-interface.rst @@ -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" + } \ No newline at end of file diff --git a/awscli/examples/ec2/attach-vpn-gateway.rst b/awscli/examples/ec2/attach-vpn-gateway.rst new file mode 100644 index 000000000000..382b6b3dea27 --- /dev/null +++ b/awscli/examples/ec2/attach-vpn-gateway.rst @@ -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" + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/authorize-security-group-ingress.rst b/awscli/examples/ec2/authorize-security-group-ingress.rst index ec26aa2831de..d5f98c3cdad6 100644 --- a/awscli/examples/ec2/authorize-security-group-ingress.rst +++ b/awscli/examples/ec2/authorize-security-group-ingress.rst @@ -1,4 +1,4 @@ -**To add a rule to a security group that allow inbound SSH traffic** +**[EC2-Classic] To add a rule to a security group that allows inbound SSH traffic** This example enables inbound traffic on TCP port 22 (SSH). @@ -12,6 +12,19 @@ Output:: "return": "true" } +**[EC2-VPC] To add a rule to a security group that allows inbound SSH traffic** + +This example enables inbound traffic on TCP port 22 (SSH). Note that you can't reference a security group for EC2-VPC by name. + +Command:: + + aws ec2 authorize-security-group-ingress --group-id sg-903004f8 --protocol tcp --port 22 --cidr 203.0.113.0/24 + +Output:: + + { + "return": "true" + } For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*. diff --git a/awscli/examples/ec2/copy-image.rst b/awscli/examples/ec2/copy-image.rst new file mode 100644 index 000000000000..37efb7a89979 --- /dev/null +++ b/awscli/examples/ec2/copy-image.rst @@ -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" + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-customer-gateway.rst b/awscli/examples/ec2/create-customer-gateway.rst new file mode 100644 index 000000000000..07f68c9b2236 --- /dev/null +++ b/awscli/examples/ec2/create-customer-gateway.rst @@ -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" + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-dhcp-options.rst b/awscli/examples/ec2/create-dhcp-options.rst new file mode 100644 index 000000000000..c8a09dd9eb14 --- /dev/null +++ b/awscli/examples/ec2/create-dhcp-options.rst @@ -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" + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-image.rst b/awscli/examples/ec2/create-image.rst new file mode 100644 index 000000000000..c5d97a852702 --- /dev/null +++ b/awscli/examples/ec2/create-image.rst @@ -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" + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-internet-gateway.rst b/awscli/examples/ec2/create-internet-gateway.rst new file mode 100644 index 000000000000..9855aad7e701 --- /dev/null +++ b/awscli/examples/ec2/create-internet-gateway.rst @@ -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": [] + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-network-acl.rst b/awscli/examples/ec2/create-network-acl.rst new file mode 100644 index 000000000000..a95e16987f55 --- /dev/null +++ b/awscli/examples/ec2/create-network-acl.rst @@ -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 + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-network-interface.rst b/awscli/examples/ec2/create-network-interface.rst new file mode 100644 index 000000000000..8f4d8a0ad19c --- /dev/null +++ b/awscli/examples/ec2/create-network-interface.rst @@ -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" + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-route-table.rst b/awscli/examples/ec2/create-route-table.rst new file mode 100644 index 000000000000..c4ff5bbd160f --- /dev/null +++ b/awscli/examples/ec2/create-route-table.rst @@ -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" + } + ] + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-route.rst b/awscli/examples/ec2/create-route.rst new file mode 100644 index 000000000000..6385eae48f52 --- /dev/null +++ b/awscli/examples/ec2/create-route.rst @@ -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" + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-security-group.rst b/awscli/examples/ec2/create-security-group.rst index a24c311bbbb2..36ac2975960f 100644 --- a/awscli/examples/ec2/create-security-group.rst +++ b/awscli/examples/ec2/create-security-group.rst @@ -1,4 +1,4 @@ -**To create a security group** +**To create a security group for EC2-Classic** This example creates a security group named ``MySecurityGroup``. @@ -13,6 +13,21 @@ Output:: "GroupId": "sg-903004f8" } +**To create a security group for EC2-VPC** + +This example creates a security group named ``MySecurityGroup`` for the specified VPC. + +Command:: + + aws ec2 create-security-group --group-name MySecurityGroup --description "My security group" --vpc-id vpc-1a2b3c4d + +Output:: + + { + "return": "true" + "GroupId": "sg-903004f8" + } + For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*. .. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html diff --git a/awscli/examples/ec2/create-subnet.rst b/awscli/examples/ec2/create-subnet.rst new file mode 100644 index 000000000000..db31e57c3393 --- /dev/null +++ b/awscli/examples/ec2/create-subnet.rst @@ -0,0 +1,20 @@ +**To create a subnet** + +This example creates a subnet in the specified VPC with the specified CIDR block. We recommend that you let us select an Availability Zone for you. Alternatively, you can use the ``--availability-zone`` option to specify the Availability Zone. + +Command:: + + aws ec2 create-subnet --vpc-id vpc-a01106c2 --cidr-block 10.0.1.0/24 + +Output:: + + { + "Subnet": { + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.1.0/24", + "State": "pending", + "AvailabilityZone": "us-east-1c", + "SubnetId": "subnet-9d4a7b6c", + "AvailableIpAddressCount": 251 + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-tags.rst b/awscli/examples/ec2/create-tags.rst index caae2d804d38..46ace636dcc6 100644 --- a/awscli/examples/ec2/create-tags.rst +++ b/awscli/examples/ec2/create-tags.rst @@ -1,6 +1,6 @@ **To add a tag to a resource** -This example adds the tag ``Stack=production`` to the specified image, or overwrites an existing tag for the AMI where the tag key is 'Stack'. +This example adds the tag ``Stack=production`` to the specified image, or overwrites an existing tag for the AMI where the tag key is ``Stack``. Command:: @@ -14,7 +14,7 @@ Output:: **To add tags to multiple resources** -This example adds (or overwrites) two tags for an AMI and an instance. One of the tags contains just a key (webserver), with no value (we set the value to an empty string). The other tag consists of a key (stack) and value (Production). +This example adds (or overwrites) two tags for an AMI and an instance. One of the tags contains just a key (``webserver``), with no value (we set the value to an empty string). The other tag consists of a key (``stack``) and value (``Production``). Command:: diff --git a/awscli/examples/ec2/create-vpc.rst b/awscli/examples/ec2/create-vpc.rst new file mode 100644 index 000000000000..408083dca58a --- /dev/null +++ b/awscli/examples/ec2/create-vpc.rst @@ -0,0 +1,39 @@ +**To create a VPC** + +This example creates a VPC with the specified CIDR block. + +Command:: + + aws ec2 create-vpc --cidr-block 10.0.0.0/16 + +Output:: + + { + "Vpc": { + "InstanceTenancy": "default", + "State": "pending", + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.0.0/16", + "DhcpOptionsId": "dopt-7a8b9c2d" + } + } + +**To create a VPC with dedicated tenancy** + +This example creates a VPC with the specified CIDR block and ``dedicated`` tenancy. + +Command:: + + aws ec2 create-vpc --cidr-block 10.0.0.0/16 --instance-tenancy dedicated + +Output:: + + { + "Vpc": { + "InstanceTenancy": "dedicated", + "State": "pending", + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.0.0/16", + "DhcpOptionsId": "dopt-7a8b9c2d" + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-vpn-connection-route.rst b/awscli/examples/ec2/create-vpn-connection-route.rst new file mode 100644 index 000000000000..293d611f863a --- /dev/null +++ b/awscli/examples/ec2/create-vpn-connection-route.rst @@ -0,0 +1,13 @@ +**To create a static route for a VPN connection** + +This example creates a static route for the specified VPN connection. + +Command:: + + aws ec2 create-vpn-connection-route --vpn-connection-id vpn-40f41529 --destination-cidr-block 11.12.0.0/16 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-vpn-connection.rst b/awscli/examples/ec2/create-vpn-connection.rst new file mode 100644 index 000000000000..a491ffb53b11 --- /dev/null +++ b/awscli/examples/ec2/create-vpn-connection.rst @@ -0,0 +1,42 @@ +**To create a VPN connection with dynamic routing** + +This example creates a VPN connection between the specified virtual private gateway and the specified customer gateway. The output includes the configuration information that your network administrator needs, in XML format. + +Command:: + + aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id cgw-0e11f167 --vpn-gateway-id vgw-9a4cacf3 + +Output:: + + { + "VpnConnection": { + "VpnConnectionId": "vpn-40f41529" + "CustomerGatewayConfiguration": "...configuration information...", + "State": "available", + "VpnGatewayId": "vgw-f211f09b", + "CustomerGatewayId": "cgw-b4de3fdd" + } + } + +**To create a VPN connection with static routing** + +This example creates a VPN connection between the specified virtual private gateway and the specified customer gateway. The options specify static routing. The output includes the configuration information that your network administrator needs, in XML format. + +Command:: + + aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id cgw-0e11f167 --vpn-gateway-id vgw-9a4cacf3 --options "{\"StaticRoutesOnly\":true}" + +Output:: + + { + "VpnConnection": { + "VpnConnectionId": "vpn-40f41529" + "CustomerGatewayConfiguration": "...configuration information...", + "State": "pending", + "VpnGatewayId": "vgw-f211f09b", + "CustomerGatewayId": "cgw-b4de3fdd", + "Options": { + "StaticRoutesOnly": true + } + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/create-vpn-gateway.rst b/awscli/examples/ec2/create-vpn-gateway.rst new file mode 100644 index 000000000000..116df23c4ceb --- /dev/null +++ b/awscli/examples/ec2/create-vpn-gateway.rst @@ -0,0 +1,18 @@ +**To create a virtual private gateway** + +This example creates a virtual private gateway. + +Command:: + + aws ec2 create-vpn-gateway --type ipsec.1 + +Output:: + + { + "VpnGateway": { + "State": "available", + "Type": "ipsec.1", + "VpnGatewayId": "vgw-9a4cacf3", + "VpcAttachments": [] + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-customer-gateway.rst b/awscli/examples/ec2/delete-customer-gateway.rst new file mode 100644 index 000000000000..336844d27b78 --- /dev/null +++ b/awscli/examples/ec2/delete-customer-gateway.rst @@ -0,0 +1,13 @@ +**To delete a customer gateway** + +This example deletes the specified customer gateway. + +Command:: + + aws ec2 delete-customer-gateway --customer-gateway-id cgw-0e11f167 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-dhcp-options.rst b/awscli/examples/ec2/delete-dhcp-options.rst new file mode 100644 index 000000000000..30aaf8815566 --- /dev/null +++ b/awscli/examples/ec2/delete-dhcp-options.rst @@ -0,0 +1,13 @@ +**To delete a DHCP options set** + +This example deletes the specified DHCP options set. + +Command:: + + aws ec2 delete-dhcp-options --dhcp-options-id dopt-d9070ebb + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-internet-gateway.rst b/awscli/examples/ec2/delete-internet-gateway.rst new file mode 100644 index 000000000000..6881c5c33210 --- /dev/null +++ b/awscli/examples/ec2/delete-internet-gateway.rst @@ -0,0 +1,13 @@ +**To delete an Internet gateway** + +This example deletes the specified Internet gateway. + +Command:: + + aws ec2 delete-internet-gateway --internet-gateway-id igw-c0a643a9 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-network-acl.rst b/awscli/examples/ec2/delete-network-acl.rst new file mode 100644 index 000000000000..6c6e4a5f6f55 --- /dev/null +++ b/awscli/examples/ec2/delete-network-acl.rst @@ -0,0 +1,13 @@ +**To delete a network ACL** + +This example deletes the specified network ACL. + +Command:: + + aws ec2 delete-network-acl --network-acl-id acl-5fb85d36 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-network-interface.rst b/awscli/examples/ec2/delete-network-interface.rst new file mode 100644 index 000000000000..04d3d1bbc043 --- /dev/null +++ b/awscli/examples/ec2/delete-network-interface.rst @@ -0,0 +1,13 @@ +**To delete a network interface** + +This example deletes the specified network interface. + +Command:: + + aws ec2 delete-network-interface --network-interface-id eni-e5aa89a3 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-route-table.rst b/awscli/examples/ec2/delete-route-table.rst new file mode 100644 index 000000000000..8b798734cc08 --- /dev/null +++ b/awscli/examples/ec2/delete-route-table.rst @@ -0,0 +1,13 @@ +**To delete a route table** + +This example deletes the specified route table. + +Command:: + + aws ec2 delete-route-table --route-table-id rtb-22574640 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-route.rst b/awscli/examples/ec2/delete-route.rst new file mode 100644 index 000000000000..c670ccbd4246 --- /dev/null +++ b/awscli/examples/ec2/delete-route.rst @@ -0,0 +1,13 @@ +**To delete a route** + +This example deletes the specified route from the specified route table. + +Command:: + + aws ec2 delete-route --route-table-id rtb-22574640 --destination-cidr-block 0.0.0.0/0 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-security-group.rst b/awscli/examples/ec2/delete-security-group.rst index fa6c863848b0..e4777a037c82 100644 --- a/awscli/examples/ec2/delete-security-group.rst +++ b/awscli/examples/ec2/delete-security-group.rst @@ -1,4 +1,4 @@ -**To delete a security group** +**[EC2-Classic] To delete a security group** This example deletes the security group named ``MySecurityGroup``. @@ -12,6 +12,20 @@ Output:: "return": "true" } +**[EC2-VPC] To delete a security group** + +This example deletes the security group with the ID ``sg-903004f8``. Note that you can't reference a security group for EC2-VPC by name. + +Command:: + + aws ec2 delete-security-group --group-id sg-903004f8 + +Output:: + + { + "return": "true" + } + For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*. .. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html diff --git a/awscli/examples/ec2/delete-subnet.rst b/awscli/examples/ec2/delete-subnet.rst new file mode 100644 index 000000000000..caba04de4c92 --- /dev/null +++ b/awscli/examples/ec2/delete-subnet.rst @@ -0,0 +1,13 @@ +**To delete a subnet** + +This example deletes the specified subnet. + +Command:: + + aws ec2 delete-subnet --subnet-id subnet-9d4a7b6c + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-tags.rst b/awscli/examples/ec2/delete-tags.rst index 9c6a1d4d7181..78a64896d246 100644 --- a/awscli/examples/ec2/delete-tags.rst +++ b/awscli/examples/ec2/delete-tags.rst @@ -18,7 +18,7 @@ Command:: aws ec2 delete-tags --resources i-12345678 --tags Key=Name,Value= -This example deletes the tag with the 'purpose' key from the specified instance, regardless of the tag's value. +This example deletes the tag with the ``purpose`` key from the specified instance, regardless of the tag's value. Command:: diff --git a/awscli/examples/ec2/delete-vpc.rst b/awscli/examples/ec2/delete-vpc.rst new file mode 100644 index 000000000000..6e633418d3b9 --- /dev/null +++ b/awscli/examples/ec2/delete-vpc.rst @@ -0,0 +1,13 @@ +**To delete a VPC** + +This example deletes the specified VPC. + +Command:: + + aws ec2 delete-vpc --vpc-id vpc-a01106c2 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-vpn-connection-route.rst b/awscli/examples/ec2/delete-vpn-connection-route.rst new file mode 100644 index 000000000000..8b88673194ce --- /dev/null +++ b/awscli/examples/ec2/delete-vpn-connection-route.rst @@ -0,0 +1,13 @@ +**To delete a static route from a VPN connection** + +This example deletes the specified static route from the specified VPN connection. + +Command:: + + aws ec2 delete-vpn-connection-route --vpn-connection-id vpn-40f41529 --destination-cidr-block 11.12.0.0/16 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-vpn-connection.rst b/awscli/examples/ec2/delete-vpn-connection.rst new file mode 100644 index 000000000000..1ce9c7d5b5f6 --- /dev/null +++ b/awscli/examples/ec2/delete-vpn-connection.rst @@ -0,0 +1,13 @@ +**To delete a VPN connection** + +This example deletes the specified VPN connection. + +Command:: + + aws ec2 delete-vpn-connection --vpn-connection-id vpn-40f41529 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/delete-vpn-gateway.rst b/awscli/examples/ec2/delete-vpn-gateway.rst new file mode 100644 index 000000000000..7587259403bf --- /dev/null +++ b/awscli/examples/ec2/delete-vpn-gateway.rst @@ -0,0 +1,13 @@ +**To delete a virtual private gateway** + +This example deletes the specified virtual private gateway. + +Command:: + + aws ec2 delete-vpn-gateway --vpn-gateway-id vgw-9a4cacf3 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/deregister-image.rst b/awscli/examples/ec2/deregister-image.rst new file mode 100644 index 000000000000..8c8cfd356e70 --- /dev/null +++ b/awscli/examples/ec2/deregister-image.rst @@ -0,0 +1,13 @@ +**To deregister an AMI** + +This example deregisters the specified AMI. + +Command:: + + aws ec2 deregister-image --image-id ami-4fa54026 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-addresses.rst b/awscli/examples/ec2/describe-addresses.rst index fc82d147fd1e..c7989b2f43b1 100644 --- a/awscli/examples/ec2/describe-addresses.rst +++ b/awscli/examples/ec2/describe-addresses.rst @@ -43,7 +43,7 @@ Output:: ] } -This example describes describes the Elastic IP address with the allocation ID eipalloc-282d9641, which is associated with an instance in EC2-VPC. +This example describes the Elastic IP address with the allocation ID ``eipalloc-282d9641``, which is associated with an instance in EC2-VPC. Command:: @@ -66,7 +66,7 @@ Output:: ] } -This example command describes the Elastic IP address associated with a particular private IP address in EC2-VPC. +This example describes the Elastic IP address associated with a particular private IP address in EC2-VPC. Command:: diff --git a/awscli/examples/ec2/describe-customer-gateways.rst b/awscli/examples/ec2/describe-customer-gateways.rst new file mode 100644 index 000000000000..fa2b221bdc67 --- /dev/null +++ b/awscli/examples/ec2/describe-customer-gateways.rst @@ -0,0 +1,50 @@ +**To describe your customer gateways** + +This example describes your customer gateways. + +Command:: + + aws ec2 describe-customer-gateways + +Output:: + + { + "CustomerGateways": [ + { + "CustomerGatewayId": "cgw-b4dc3961", + "IpAddress": "203.0.113.12", + "State": "available", + "Type": "ipsec.1", + "BgpAsn": "65000" + }, + { + "CustomerGatewayId": "cgw-0e11f167", + "IpAddress": "12.1.2.3", + "State": "available", + "Type": "ipsec.1", + "BgpAsn": "65534" + } + ] + } + +**To describe a specific customer gateway** + +This example describes the specified customer gateway. + +Command:: + + aws ec2 describe-customer-gateways --customer-gateway-ids cgw-0e11f167 + +Output:: + + { + "CustomerGateways": [ + { + "CustomerGatewayId": "cgw-0e11f167", + "IpAddress": "12.1.2.3", + "State": "available", + "Type": "ipsec.1", + "BgpAsn": "65534" + } + ] + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-dhcp-options.rst b/awscli/examples/ec2/describe-dhcp-options.rst new file mode 100644 index 000000000000..623cdcc627f5 --- /dev/null +++ b/awscli/examples/ec2/describe-dhcp-options.rst @@ -0,0 +1,37 @@ +**To describe your DHCP options sets** + +This example describes your DHCP options sets. + +Command:: + + aws ec2 describe-dhcp-options + +Output:: + + { + "DhcpOptions": [ + { + "DhcpConfigurations": [ + { + "Values": [ + "10.2.5.2", + "10.2.5.1" + ], + "Key": "domain-name-servers" + } + ], + "DhcpOptionsId": "dopt-d9070ebb" + }, + { + "DhcpConfigurations": [ + { + "Values": [ + "AmazonProvidedDNS" + ], + "Key": "domain-name-servers" + } + ], + "DhcpOptionsId": "dopt-7a8b9c2d" + } + ] + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-image-attribute.rst b/awscli/examples/ec2/describe-image-attribute.rst new file mode 100644 index 000000000000..15db24934769 --- /dev/null +++ b/awscli/examples/ec2/describe-image-attribute.rst @@ -0,0 +1,33 @@ +**To describe the launch permissions for an AMI** + +This example describes the launch permissions for the specified AMI. + +Command:: + + aws ec2 describe-image-attribute --image-id ami-5731123e --attribute launchPermission + +Output:: + + { + "LaunchPermissions": [ + { + "UserId": "123456789012" + } + ], + "ImageId": "ami-5731123e", + } + +**To describe the product codes for an AMI** + +This example describes the product codes for the specified AMI. Note that this AMI has no product codes. + +Command:: + + aws ec2 describe-image-attribute --image-id ami-5731123e --attribute productCodes + +Output:: + + { + "ProductCodes": [], + "ImageId": "ami-5731123e", + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-images.rst b/awscli/examples/ec2/describe-images.rst new file mode 100644 index 000000000000..55162b4b1515 --- /dev/null +++ b/awscli/examples/ec2/describe-images.rst @@ -0,0 +1,49 @@ +**To describe a specific AMI** + +This example describes the specified AMI. + +Command:: + + aws ec2 describe-images --image-ids ami-5731123e + +Output:: + + { + "Images": [ + { + "VirtualizationType": "paravirtual", + "Name": "My server", + "Hypervisor": "xen", + "ImageId": "ami-5731123e", + "RootDeviceType": "ebs", + "State": "available", + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/sda1", + "Ebs": { + "DeleteOnTermination": true, + "SnapshotId": "snap-ca7b3bd1", + "VolumeSize": 8, + "VolumeType": "standard" + } + } + ], + "Architecture": "x86_64", + "ImageLocation": "123456789012/My server", + "KernelId": "aki-88aa75e1", + "OwnerId": "123456789012", + "RootDeviceName": "/dev/sda1", + "Public": false, + "ImageType": "machine", + "Description": "An AMI for my server" + } + ] + } + +**To describe Windows AMIs from Amazon that are backed by Amazon EBS** + +This example describes Windows AMIs provided by Amazon that are backed by Amazon EBS. + +Command:: + + aws ec2 describe-images --filters "Name=is-public,Values=true,Name=owner-alias,Values=amazon,Name=platform,Values=Windows,Name=root-device-type,Values=ebs" diff --git a/awscli/examples/ec2/describe-instance-attribute.rst b/awscli/examples/ec2/describe-instance-attribute.rst index dcf2c578e71a..e057ceaaff71 100644 --- a/awscli/examples/ec2/describe-instance-attribute.rst +++ b/awscli/examples/ec2/describe-instance-attribute.rst @@ -4,7 +4,7 @@ This example describes the instance type of the specified instance. Command:: - aws ec2 describe-instance-attribute --instance-id i-5203422c --atribute instanceType + aws ec2 describe-instance-attribute --instance-id i-5203422c --attribute instanceType Output:: @@ -21,7 +21,7 @@ This example describes the ``disableApiTermination`` attribute of the specified Command:: - aws ec2 describe-instance-attribute --instance-id i-5203422c --atribute disableApiTermination + aws ec2 describe-instance-attribute --instance-id i-5203422c --attribute disableApiTermination Output:: diff --git a/awscli/examples/ec2/describe-internet-gateways.rst b/awscli/examples/ec2/describe-internet-gateways.rst new file mode 100644 index 000000000000..4f8977b75be0 --- /dev/null +++ b/awscli/examples/ec2/describe-internet-gateways.rst @@ -0,0 +1,54 @@ +**To describe your Internet gateways** + +This example describes your Internet gateways. + +Command:: + + aws ec2 describe-internet-gateways + +Output:: + + { + "InternetGateways": [ + { + "Tags": [], + "InternetGatewayId": "igw-c0a643a9", + "Attachments": [ + { + "State": "available", + "VpcId": "vpc-a01106c2" + } + ] + }, + { + "Tags": [], + "InternetGatewayId": "igw-046d7966", + "Attachments": [] + } + ] + } + +**To describe the Internet gateway for a specific VPC** + +This example describes the Internet gateway for the specified VPC. + +Command:: + + aws ec2 describe-subnets --filter "Name=attachment.vpc-id,Values=vpc-a01106c2" + +Output:: + + { + "InternetGateways": [ + { + "Tags": [], + "InternetGatewayId": "igw-c0a643a9", + "Attachments": [ + { + "State": "available", + "VpcId": "vpc-a01106c2" + } + ] + } + ] + } diff --git a/awscli/examples/ec2/describe-network-acls.rst b/awscli/examples/ec2/describe-network-acls.rst new file mode 100644 index 000000000000..7e73744afc77 --- /dev/null +++ b/awscli/examples/ec2/describe-network-acls.rst @@ -0,0 +1,122 @@ +**To describe your network ACLs** + +This example describes your network ACLs. + +Command:: + + aws ec2 describe-network-acls + +Output:: + + { + "NetworkAcls": [ + { + "Associations": [], + "NetworkAclId": "acl-7aaabd18", + "VpcId": "vpc-a01106c2", + "Tags": [], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": true + }, + { + "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 + }, + { + "Associations": [ + { + "SubnetId": "subnet-6bea5f06", + "NetworkAclId": "acl-9aeb5ef7", + "NetworkAclAssociationId": "aclassoc-67ea5f0a" + }, + { + "SubnetId": "subnet-65ea5f08", + "NetworkAclId": "acl-9aeb5ef7", + "NetworkAclAssociationId": "aclassoc-66ea5f0b" + } + ], + "NetworkAclId": "acl-9aeb5ef7", + "VpcId": "vpc-98eb5ef5", + "Tags": [], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": true + } + ] + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-network-interfaces.rst b/awscli/examples/ec2/describe-network-interfaces.rst new file mode 100644 index 000000000000..4ea4c9ed9e2d --- /dev/null +++ b/awscli/examples/ec2/describe-network-interfaces.rst @@ -0,0 +1,92 @@ +**To describe your network interfaces** + +This example describes all your network interfaces. + +Command:: + + aws ec2 describe-network-interfaces + +Output:: + + { + "NetworkInterfaces": [ + { + "Status": "in-use", + "MacAddress": "02:2f:8f:b0:cf:75", + "SourceDestCheck": true, + "VpcId": "vpc-a01106c2", + "Description": "my network interface", + "NetworkInterfaceId": "eni-e5aa89a3", + "PrivateIpAddresses": [ + { + "Primary": true, + "PrivateIpAddress": "10.0.1.17" + } + ], + "RequesterManaged": false, + "AvailabilityZone": "us-east-1d", + "Attachment": { + "Status": "attached", + "DeviceIndex": 1, + "AttachTime": "2013-11-30T23:36:42.000Z", + "InstanceId": "i-640a3c17", + "DeleteOnTermination": false, + "AttachmentId": "eni-attach-66c4350a", + "InstanceOwnerId": "123456789012" + }, + "Groups": [ + { + "GroupName": "default", + "GroupId": "sg-8637d3e3" + } + ], + "SubnetId": "subnet-b61f49f0", + "OwnerId": "123456789012", + "TagSet": [], + "PrivateIpAddress": "10.0.1.17" + }, + { + "Status": "in-use", + "MacAddress": "02:58:f5:ef:4b:06", + "SourceDestCheck": true, + "VpcId": "vpc-a01106c2", + "Description": "Primary network interface", + "Association": { + "PublicIp": "198.51.100.0", + "IpOwnerId": "amazon" + }, + "NetworkInterfaceId": "eni-f9ba99bf", + "PrivateIpAddresses": [ + { + "Association": { + "PublicIp": "198.51.100.0", + "IpOwnerId": "amazon" + }, + "Primary": true, + "PrivateIpAddress": "10.0.1.149" + } + ], + "RequesterManaged": false, + "AvailabilityZone": "us-east-1d", + "Attachment": { + "Status": "attached", + "DeviceIndex": 0, + "AttachTime": "2013-11-30T23:35:33.000Z", + "InstanceId": "i-640a3c17", + "DeleteOnTermination": true, + "AttachmentId": "eni-attach-1b9db777", + "InstanceOwnerId": "123456789012" + }, + "Groups": [ + { + "GroupName": "default", + "GroupId": "sg-8637d3e3" + } + ], + "SubnetId": "subnet-b61f49f0", + "OwnerId": "123456789012", + "TagSet": [], + "PrivateIpAddress": "10.0.1.149" + } + ] + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-route-tables.rst b/awscli/examples/ec2/describe-route-tables.rst new file mode 100644 index 000000000000..315590f15c06 --- /dev/null +++ b/awscli/examples/ec2/describe-route-tables.rst @@ -0,0 +1,63 @@ +**To describe your route tables** + +This example describes your route tables. + +Command:: + + aws ec2 describe-route-tables + +Output:: + + { + "RouteTables": [ + { + "Associations": [ + { + "RouteTableAssociationId": "rtbassoc-d8ccddba", + "Main": true, + "RouteTableId": "rtb-1f382e7d" + } + ], + "RouteTableId": "rtb-1f382e7d", + "VpcId": "vpc-a01106c2", + "PropagatingVgws": [], + "Tags": [], + "Routes": [ + { + "GatewayId": "local", + "DestinationCidrBlock": "10.0.0.0/16", + "State": "active" + } + ] + }, + { + "Associations": [ + { + "SubnetId": "subnet-b61f49f0", + "RouteTableAssociationId": "rtbassoc-781d0d1a", + "RouteTableId": "rtb-22574640" + } + ], + "RouteTableId": "rtb-22574640", + "VpcId": "vpc-a01106c2", + "PropagatingVgws": [ + { + "GatewayId": "vgw-f211f09b" + } + ], + "Tags": [], + "Routes": [ + { + "GatewayId": "local", + "DestinationCidrBlock": "10.0.0.0/16", + "State": "active" + }, + { + "GatewayId": "igw-046d7966", + "DestinationCidrBlock": "0.0.0.0/0", + "State": "active" + } + ] + } + ] + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-security-groups.rst b/awscli/examples/ec2/describe-security-groups.rst index 8147149dbde5..3a4b5572cf2a 100644 --- a/awscli/examples/ec2/describe-security-groups.rst +++ b/awscli/examples/ec2/describe-security-groups.rst @@ -1,4 +1,4 @@ -**To display information about a security group** +**To display information about a security group for EC2-Classic** This example displays information about the security group named ``MySecurityGroup``. @@ -33,6 +33,52 @@ Output:: ] } +**To display information about a security group for EC2-VPC** + +This example displays information about the security group with the ID sg-903004f8. Note that you can't reference a security group for EC2-VPC by name. + +Command:: + + aws ec2 describe-security-groups --group-ids sg-903004f8 + +Output:: + + { + "SecurityGroups": [ + { + "IpPermissionsEgress": [ + { + "IpProtocol": "-1", + "IpRanges": [ + { + "CidrIp": "0.0.0.0/0" + } + ], + "UserIdGroupPairs": [] + } + ], + "Description": "My security group", + "IpPermissions": [ + { + "ToPort": 22, + "IpProtocol": "tcp", + "IpRanges": [ + { + "CidrIp": "203.0.113.0/24" + } + ], + "UserIdGroupPairs": [], + "FromPort": 22 + } + ], + "GroupName": "MySecurityGroup", + "VpcId": "vpc-1a2b3c4d", + "OwnerId": "123456789012", + "GroupId": "sg-903004f8", + } + ] + } + For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*. .. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html diff --git a/awscli/examples/ec2/describe-subnets.rst b/awscli/examples/ec2/describe-subnets.rst new file mode 100644 index 000000000000..0ce53d4eb6d8 --- /dev/null +++ b/awscli/examples/ec2/describe-subnets.rst @@ -0,0 +1,59 @@ +**To describe your subnets** + +This example describes your subnets. + +Command:: + + aws ec2 describe-subnets + +Output:: + + { + "Subnets": [ + { + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.1.0/24", + "MapPublicIpOnLaunch": false, + "DefaultForAz": false, + "State": "available", + "AvailabilityZone": "us-east-1c", + "SubnetId": "subnet-9d4a7b6c", + "AvailableIpAddressCount": 251 + }, + { + "VpcId": "vpc-b61106d4", + "CidrBlock": "10.0.0.0/24", + "MapPublicIpOnLaunch": false, + "DefaultForAz": false, + "State": "available", + "AvailabilityZone": "us-east-1d", + "SubnetId": "subnet-65ea5f08", + "AvailableIpAddressCount": 251 + } + ] + } + +**To describe the subnets for a specific VPC** + +This example describes the subnets for the specified VPC. + +Command:: + + aws ec2 describe-subnets --filter "Name=vpc-id,Values=vpc-a01106c2" + +Output:: + + { + "Subnets": [ + { + "VpcId": "vpc-a01106c2", + "CidrBlock": "10.0.1.0/24", + "MapPublicIpOnLaunch": false, + "DefaultForAz": false, + "State": "available", + "AvailabilityZone": "us-east-1c", + "SubnetId": "subnet-9d4a7b6c", + "AvailableIpAddressCount": 251 + } + ] + } diff --git a/awscli/examples/ec2/describe-tags.rst b/awscli/examples/ec2/describe-tags.rst index 4129fff1d7db..c0c886ef9b48 100644 --- a/awscli/examples/ec2/describe-tags.rst +++ b/awscli/examples/ec2/describe-tags.rst @@ -111,7 +111,7 @@ Output:: **To describe the tags for your resources based on a key and a value** -This example describes the tags for your resources that have the key Stack and a value Test. +This example describes the tags for your resources that have the key ``Stack`` and a value ``Test``. Command:: @@ -136,7 +136,7 @@ Output:: ] } -This example describes the tags for all your instances that have a tag with the key Purpose and no value. +This example describes the tags for all your instances that have a tag with the key ``Purpose`` and no value. Command:: diff --git a/awscli/examples/ec2/describe-vpc-attribute.rst b/awscli/examples/ec2/describe-vpc-attribute.rst new file mode 100644 index 000000000000..df35831887b0 --- /dev/null +++ b/awscli/examples/ec2/describe-vpc-attribute.rst @@ -0,0 +1,33 @@ +**To describe the enableDnsSupport attribute** + +This example describes the ``enableDnsSupport`` attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is ``true``, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not. + +Command:: + + aws ec2 describe-vpc-attribute --vpc-id vpc-a01106c2 --attribute enableDnsSupport + +Output:: + + { + "VpcId": "vpc-a01106c2", + "EnableDnsSupport": { + "Value": true + } + } + +**To describe the enableDnsHostnames attribute** + +This example describes the ``enableDnsHostnames`` attribute. This attribute indicates whether the instances launched in the VPC get DNS hostnames. If this attribute is ``true``, instances in the VPC get DNS hostnames; otherwise, they do not. + +Command:: + + aws ec2 describe-vpc-attribute --vpc-id vpc-a01106c2 --attribute enableDnsHostnames + +Output:: + + { + "VpcId": "vpc-a01106c2", + "EnableDnsHostnames": { + "Value": true + } + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-vpcs.rst b/awscli/examples/ec2/describe-vpcs.rst new file mode 100644 index 000000000000..49f5aa613d4a --- /dev/null +++ b/awscli/examples/ec2/describe-vpcs.rst @@ -0,0 +1,65 @@ +**To describe your VPCs** + +This example describes your VPCs. + +Command:: + + aws ec2 describe-vpcs + +Output:: + + { + "Vpcs": [ + { + "VpcId": "vpc-a01106c2", + "InstanceTenancy": "default", + "Tags": [ + { + "Value": "MyVPC", + "Key": "Name" + } + ], + "State": "available", + "DhcpOptionsId": "dopt-7a8b9c2d", + "CidrBlock": "10.0.0.0/16", + "IsDefault": false + }, + { + "VpcId": "vpc-b61106d4", + "InstanceTenancy": "dedicated", + "State": "available", + "DhcpOptionsId": "dopt-97eb5efa", + "CidrBlock": "10.50.0.0/16", + "IsDefault": false + } + ] + } + +**To describe a specific VPC** + +This example describes the specified VPC. + +Command:: + + aws ec2 describe-vpcs --vpc-ids vpc-a01106c2 + +Output:: + + { + "Vpcs": [ + { + "VpcId": "vpc-a01106c2", + "InstanceTenancy": "default", + "Tags": [ + { + "Value": "MyVPC", + "Key": "Name" + } + ], + "State": "available", + "DhcpOptionsId": "dopt-7a8b9c2d", + "CidrBlock": "10.0.0.0/16", + "IsDefault": false + } + ] + } \ No newline at end of file diff --git a/awscli/examples/ec2/describe-vpn-connections.rst b/awscli/examples/ec2/describe-vpn-connections.rst new file mode 100644 index 000000000000..374cbdec88b2 --- /dev/null +++ b/awscli/examples/ec2/describe-vpn-connections.rst @@ -0,0 +1,44 @@ +**To describe your VPN connections** + +This example describes your VPN connections. + +Command:: + + aws ec2 describe-vpn-connections + +Output:: + + { + "VpnConnections": { + "VpnConnectionId": "vpn-40f41529" + "CustomerGatewayConfiguration": "...configuration information...", + "VgwTelemetry": [ + { + "Status": "DOWN", + "AcceptedRouteCount": 0, + "OutsideIpAddress": "72.21.209.192", + "LastStatusChange": "2013-02-04T20:19:34.000Z", + "StatusMessage": "IPSEC IS DOWN" + }, + { + "Status": "DOWN", + "AcceptedRouteCount": 0, + "OutsideIpAddress": "72.21.209.224", + "LastStatusChange": "2013-02-04T20:19:34.000Z", + "StatusMessage": "IPSEC IS DOWN" + } + ], + "State": "available", + "VpnGatewayId": "vgw-9a4cacf3", + "CustomerGatewayId": "cgw-0e11f167" + "Type": "ipsec.1" + } + } + +**To describe your available VPN connections** + +This example describes your VPN connections with a state of ``available``. + +Command:: + + aws ec2 describe-vpn-connections --filters "Name=state,Values=available" diff --git a/awscli/examples/ec2/describe-vpn-gateways.rst b/awscli/examples/ec2/describe-vpn-gateways.rst new file mode 100644 index 000000000000..7ea1162b34c6 --- /dev/null +++ b/awscli/examples/ec2/describe-vpn-gateways.rst @@ -0,0 +1,36 @@ +**To describe your virtual private gateways** + +This example describes your virtual private gateways. + +Command:: + + aws ec2 describe-virtual-private-gateways + +Output:: + + { + "VpnGateways": [ + { + "State": "available", + "Type": "ipsec.1", + "VpnGatewayId": "vgw-f211f09b", + "VpcAttachments": [ + { + "State": "attached", + "VpcId": "vpc-98eb5ef5" + } + ] + }, + { + "State": "available", + "Type": "ipsec.1", + "VpnGatewayId": "vgw-9a4cacf3", + "VpcAttachments": [ + { + "State": "attaching", + "VpcId": "vpc-a01106c2" + } + ] + } + ] + } \ No newline at end of file diff --git a/awscli/examples/ec2/detach-internet-gateway.rst b/awscli/examples/ec2/detach-internet-gateway.rst new file mode 100644 index 000000000000..08c654442de5 --- /dev/null +++ b/awscli/examples/ec2/detach-internet-gateway.rst @@ -0,0 +1,13 @@ +**To detach an Internet gateway from your VPC** + +This example detaches the specified Internet gateway from the specified VPC. + +Command:: + + aws ec2 detach-internet-gateway --internet-gateway-id igw-c0a643a9 --vpc-id vpc-a01106c2 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/detach-network-interface.rst b/awscli/examples/ec2/detach-network-interface.rst new file mode 100644 index 000000000000..85af6f56c05e --- /dev/null +++ b/awscli/examples/ec2/detach-network-interface.rst @@ -0,0 +1,13 @@ +**To detach a network interface from your instance** + +This example detaches the specified network interface from the specified instance. + +Command:: + + aws ec2 detach-network-interface --attachment-id eni-attach-66c4350a + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/detach-vpn-gateway.rst b/awscli/examples/ec2/detach-vpn-gateway.rst new file mode 100644 index 000000000000..9667a61cbb98 --- /dev/null +++ b/awscli/examples/ec2/detach-vpn-gateway.rst @@ -0,0 +1,13 @@ +**To detach a virtual private gateway from your VPC** + +This example detaches the specified virtual private gateway from the specified VPC. + +Command:: + + aws ec2 detach-internet-gateway --vpn-gateway-id vgw-9a4cacf3 --vpc-id vpc-a01106c2 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/disable-vgw-route-propagation.rst b/awscli/examples/ec2/disable-vgw-route-propagation.rst new file mode 100644 index 000000000000..46373493a5df --- /dev/null +++ b/awscli/examples/ec2/disable-vgw-route-propagation.rst @@ -0,0 +1,13 @@ +**To disable route propagation** + +This example disables the specified virtual private gateway from propagating static routes to the specified route table. + +Command:: + + aws ec2 disable-vgw-route-propagation --route-table-id rtb-22574640 --gateway-id vgw-9a4cacf3 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/disassociate-route-table.rst b/awscli/examples/ec2/disassociate-route-table.rst new file mode 100644 index 000000000000..8d5b32cb128a --- /dev/null +++ b/awscli/examples/ec2/disassociate-route-table.rst @@ -0,0 +1,13 @@ +**To disassociate a route table** + +This example disassociates the specified route table from the specified subnet. + +Command:: + + aws ec2 disassociate-route-table --association-id rtbassoc-781d0d1a + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/enable-vgw-route-propagation.rst b/awscli/examples/ec2/enable-vgw-route-propagation.rst new file mode 100644 index 000000000000..b59438f4586c --- /dev/null +++ b/awscli/examples/ec2/enable-vgw-route-propagation.rst @@ -0,0 +1,13 @@ +**To enable route propagation** + +This example enables the specified virtual private gateway to propagate static routes to the specified route table. + +Command:: + + aws ec2 enable-vgw-route-propagation --route-table-id rtb-22574640 --gateway-id vgw-9a4cacf3 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/modify-image-attribute.rst b/awscli/examples/ec2/modify-image-attribute.rst new file mode 100644 index 000000000000..84aeb69ad0c6 --- /dev/null +++ b/awscli/examples/ec2/modify-image-attribute.rst @@ -0,0 +1,55 @@ +**To make an AMI public** + +This example makes the specified AMI public. + +Command:: + + aws ec2 modify-image-attribute --image-id ami-5731123e --launch-permission "{\"Add\": [{\"Group\":\"all\"}]}" + +Output:: + + { + "return": "true" + } + +**To make an AMI private** + +This example makes the specified AMI private. + +Command:: + + aws ec2 modify-image-attribute --image-id ami-5731123e --launch-permission "{\"Remove\": [{\"Group\":\"all\"}]}" + +Output:: + + { + "return": "true" + } + +**To grant launch permission to an AWS account** + +This example grants launch permissions to the specified AWS account. + +Command:: + + aws ec2 modify-image-attribute --image-id ami-5731123e --launch-permission "{\"Add\": [{\"UserId\":\"123456789012\"}]}" + +Output:: + + { + "return": "true" + } + +**To removes launch permission from an AWS account** + +This example removes launch permissions from the specified AWS account. + +Command:: + + aws ec2 modify-image-attribute --image-id ami-5731123e --launch-permission "{\"Remove\": [{\"UserId\":\"123456789012\"}]}" + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/modify-instance-attribute.rst b/awscli/examples/ec2/modify-instance-attribute.rst index 5c9a9a7a34a4..811c2ce1a796 100644 --- a/awscli/examples/ec2/modify-instance-attribute.rst +++ b/awscli/examples/ec2/modify-instance-attribute.rst @@ -4,7 +4,7 @@ This example modifies the instance type of the specified instance. The instance Command:: - aws ec2 modify-instance-attribute --instance-id i-5203422c --instance-type m1.small + aws ec2 modify-instance-attribute --instance-id i-5203422c --instance-type "{\"Value\": \"m1.small\"}" Output:: @@ -18,7 +18,7 @@ This example sets the ``sourceDestCheck`` attribute of the specified instance to Command:: - aws ec2 modify-instance-attribute --instance-id i-5203422c --source-dest-check + aws ec2 modify-instance-attribute --instance-id i-5203422c --source-dest-check "{\"Value\": true}" Output:: diff --git a/awscli/examples/ec2/modify-vpc-attribute.rst b/awscli/examples/ec2/modify-vpc-attribute.rst new file mode 100644 index 000000000000..bc5a234fa318 --- /dev/null +++ b/awscli/examples/ec2/modify-vpc-attribute.rst @@ -0,0 +1,27 @@ +**To modify the enableDnsSupport attribute** + +This example modifies the ``enableDnsSupport`` attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is ``true``, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not. + +Command:: + + aws ec2 modify-vpc-attribute --vpc-id vpc-a01106c2 --enable-dns-support "{\"Value\":false}" + +Output:: + + { + "return": "true" + } + +**To modify the enableDnsHostnames attribute** + +This example modifies the ``enableDnsHostnames`` attribute. This attribute indicates whether instances launched in the VPC get DNS hostnames. If this attribute is ``true``, instances in the VPC get DNS hostnames; otherwise, they do not. + +Command:: + + aws ec2 modify-vpc-attribute --vpc-id vpc-a01106c2 --enable-dns-hostnames "{\"Value\":false}" + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/register-image.rst b/awscli/examples/ec2/register-image.rst new file mode 100644 index 000000000000..189c0a1f4eb2 --- /dev/null +++ b/awscli/examples/ec2/register-image.rst @@ -0,0 +1,13 @@ +**To register an AMI using a manifest file** + +This example registers an AMI using the specified manifest file in Amazon S3. + +Command:: + + aws ec2 register-image --image-location my-s3-bucket/myimage/image.manifest.xml --name "MyImage" + +Output:: + + { + "ImageId": "ami-61341708" + } \ No newline at end of file diff --git a/awscli/examples/ec2/replace-network-acl-association.rst b/awscli/examples/ec2/replace-network-acl-association.rst new file mode 100644 index 000000000000..acbf722b0091 --- /dev/null +++ b/awscli/examples/ec2/replace-network-acl-association.rst @@ -0,0 +1,13 @@ +**To replace the network ACL associated with a subnet** + +This example associates the specified network ACL with the subnet for the specified network ACL association. + +Command:: + + aws ec2 replace-network-acl-association --association-id aclassoc-e5b95c8c --network-acl-id acl-5fb85d36 + +Output:: + + { + "NewAssociationId": "aclassoc-3999875b" + } \ No newline at end of file diff --git a/awscli/examples/ec2/replace-route-table-association.rst b/awscli/examples/ec2/replace-route-table-association.rst new file mode 100644 index 000000000000..1b2623f7c192 --- /dev/null +++ b/awscli/examples/ec2/replace-route-table-association.rst @@ -0,0 +1,13 @@ +**To replace the route table associated with a subnet** + +This example associates the specified route table with the subnet for the specified route table association. + +Command:: + + aws ec2 replace-route-table-association --association-id rtbassoc-781d0d1a --route-table-id rtb-22574640 + +Output:: + + { + "NewAssociationId": "rtbassoc-3a1f0f58" + } \ No newline at end of file diff --git a/awscli/examples/ec2/replace-route.rst b/awscli/examples/ec2/replace-route.rst new file mode 100644 index 000000000000..d23ba03b53a4 --- /dev/null +++ b/awscli/examples/ec2/replace-route.rst @@ -0,0 +1,13 @@ +**To replace a route** + +This example replaces the specified route in the specified table table. The new route matches the specified CIDR and sends the traffic to the specified virtual private gateway. + +Command:: + + aws ec2 replace-route --route-table-id rtb-22574640 --destination-cidr-block 10.0.0.0/16 --gateway-id vgw-9a4cacf3 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/reset-image-attribute.rst b/awscli/examples/ec2/reset-image-attribute.rst new file mode 100644 index 000000000000..1ccf55ae9aa1 --- /dev/null +++ b/awscli/examples/ec2/reset-image-attribute.rst @@ -0,0 +1,13 @@ +**To reset the launchPermission attribute** + +This example resets the ``launchPermission`` attribute for the specified AMI to its default value. By default, AMIs are private. + +Command:: + + aws ec2 reset-image-attribute --image-id ami-5731123e --attribute launchPermission + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/ec2/reset-instance-attribute.rst b/awscli/examples/ec2/reset-instance-attribute.rst index 11ff723f704b..96460af5c989 100644 --- a/awscli/examples/ec2/reset-instance-attribute.rst +++ b/awscli/examples/ec2/reset-instance-attribute.rst @@ -4,7 +4,7 @@ This example resets the ``sourceDestCheck`` attribute of the specified instance. Command:: - aws ec2 reset-instance-attribute --instance-id i-5203422c --atribute sourceDestCheck + aws ec2 reset-instance-attribute --instance-id i-5203422c --attribute sourceDestCheck Output:: @@ -18,7 +18,7 @@ This example resets the ``kernel`` attribute of the specified instance. The inst Command:: - aws ec2 reset-instance-attribute --instance-id i-5203422c --atribute kernel + aws ec2 reset-instance-attribute --instance-id i-5203422c --attribute kernel Output:: @@ -32,7 +32,7 @@ This example resets the ``ramdisk`` attribute of the specified instance. The ins Command:: - aws ec2 reset-instance-attribute --instance-id i-5203422c --atribute ramdisk + aws ec2 reset-instance-attribute --instance-id i-5203422c --attribute ramdisk Output:: diff --git a/awscli/examples/ec2/run-instances.rst b/awscli/examples/ec2/run-instances.rst index dae41cd0e5ac..75bffcb1b77e 100644 --- a/awscli/examples/ec2/run-instances.rst +++ b/awscli/examples/ec2/run-instances.rst @@ -1,6 +1,6 @@ -**To launch an Amazon EC2 instance** +**To launch an instance in EC2-Classic** -This example launches a single Amazon EC2 instance of type ``t1.micro``. +This example launches a single instance of type ``t1.micro``. The key pair and security group, named ``MyKeyPair`` and ``MySecurityGroup``, must exist. @@ -52,7 +52,17 @@ Output:: "AvailabilityZone": "us-east-1b" }, "Hypervisor": "xen", - "BlockDeviceMappings": [], + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/sda1", + "Ebs": { + "Status": "attached", + "DeleteOnTermination": true, + "VolumeId": "vol-877166c8", + "AttachTime": "2013-07-19T02:42:39.000Z" + } + } + ], "Architecture": "x86_64", "StateReason": { "Message": "pending", @@ -61,6 +71,132 @@ Output:: "RootDeviceName": "/dev/sda1", "VirtualizationType": "hvm", "RootDeviceType": "ebs", + "Tags": [ + { + "Value": "MyInstance", + "Key": "Name" + } + ], + "AmiLaunchIndex": 0 + } + ] + } + +**To launch an instance in EC2-VPC** + +This example launches a single instance of type ``t1.micro`` into the specified subnet. + +The key pair named ``MyKeyPair`` and the security group sg-903004f8 must exist. + +Command:: + + aws ec2 run-instances --image-id ami-c3b8d6aa --count 1 --instance-type t1.micro --key-name MyKeyPair --security-group-ids sg-903004f8 --subnet-id subnet-6e7f829e + +Output:: + + { + "OwnerId": "123456789012", + "ReservationId": "r-5875ca20", + "Groups": [ + { + "GroupName": "MySecurityGroup", + "GroupId": "sg-903004f8" + } + ], + "Instances": [ + { + "Monitoring": { + "State": "disabled" + }, + "PublicDnsName": null, + "Platform": "windows", + "State": { + "Code": 0, + "Name": "pending" + }, + "EbsOptimized": false, + "LaunchTime": "2013-07-19T02:42:39.000Z", + "PrivateIpAddress": "10.0.1.114", + "ProductCodes": [], + "VpcId": "vpc-1a2b3c4d", + "InstanceId": "i-5203422c", + "ImageId": "ami-c3b8d6aa", + "PrivateDnsName": "ip-10-0-1-114.ec2.internal", + "KeyName": "MyKeyPair", + "SecurityGroups": [ + { + "GroupName": "MySecurityGroup", + "GroupId": "sg-903004f8" + } + ], + "ClientToken": null, + "SubnetId": "subnet-6e7f829e", + "InstanceType": "t1.micro", + "NetworkInterfaces": [ + { + "Status": "in-use", + "SourceDestCheck": true, + "VpcId": "vpc-1a2b3c4d", + "Description": "Primary network interface", + "NetworkInterfaceId": "eni-a7edb1c9", + "PrivateIpAddresses": [ + { + "PrivateDnsName": "ip-10-0-1-114.ec2.internal", + "Primary": true, + "PrivateIpAddress": "10.0.1.114" + } + ], + "PrivateDnsName": "ip-10-0-1-114.ec2.internal", + "Attachment": { + "Status": "attached", + "DeviceIndex": 0, + "DeleteOnTermination": true, + "AttachmentId": "eni-attach-52193138", + "AttachTime": "2013-07-19T02:42:39.000Z" + }, + "Groups": [ + { + "GroupName": "MySecurityGroup", + "GroupId": "sg-903004f8" + } + ], + "SubnetId": "subnet-6e7f829e", + "OwnerId": "123456789012", + "PrivateIpAddress": "10.0.1.114" + } + ], + "SourceDestCheck": true, + "Placement": { + "Tenancy": "default", + "GroupName": null, + "AvailabilityZone": "us-east-1b" + }, + "Hypervisor": "xen", + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/sda1", + "Ebs": { + "Status": "attached", + "DeleteOnTermination": true, + "VolumeId": "vol-877166c8", + "AttachTime": "2013-07-19T02:42:39.000Z" + } + } + ], + "Architecture": "x86_64", + "StateReason": { + "Message": "pending", + "Code": "pending" + }, + "RootDeviceName": "/dev/sda1", + "VirtualizationType": "hvm", + "RootDeviceType": "ebs", + "Tags": [ + { + "Value": "MyInstance", + "Key": "Name" + } + ], "AmiLaunchIndex": 0 } ] diff --git a/awscli/examples/ec2/unassign-private-ip-addresses.rst b/awscli/examples/ec2/unassign-private-ip-addresses.rst new file mode 100644 index 000000000000..067e690c13a1 --- /dev/null +++ b/awscli/examples/ec2/unassign-private-ip-addresses.rst @@ -0,0 +1,13 @@ +**To unassign a secondary private IP address from a network interface** + +This example unassigns the specified private IP address from the specified network interface. + +Command:: + + aws ec2 unassign-private-ip-addresses --network-interface-id eni-e5aa89a3 --private-ip-addresses 10.0.0.82 + +Output:: + + { + "return": "true" + } \ No newline at end of file diff --git a/awscli/examples/rds/create-db-instance.rst b/awscli/examples/rds/create-db-instance.rst new file mode 100644 index 000000000000..9000892d4fbb --- /dev/null +++ b/awscli/examples/rds/create-db-instance.rst @@ -0,0 +1,24 @@ +**To create an Amazon RDS DB instance** + +The following ``create-db-instance`` command launches a new Amazon RDS DB instance:: + + aws rds create-db-instance sg-CLI-Test --allocated-storage 20 --db-instance-class db.m1.small --engine mysql --master-username myawsuser --master-user-password myawsuser + +In the preceding example, the DB instance is created with 20 Gb of standard storage and has a DB engine class of db.m1.small. +The master username and master password are provided. + +This command outputs a JSON block that indicates that the DB instance was created. + +Output:: + + DBINSTANCE sg-cli-test db.m1.small mysql 20 myawsuser creating 1 **** n + 5.5.31 general-public-license y + SECGROUP default active + PARAMGRP default.mysql5.5 in-sync + + OPTIONGROUP default:mysql-5-5 in-sync + +For more information, see `Create an Amazon RDS DB Instance`_ in the *AWS Command Line Interface User Guide*. + +.. _`Create an Amazon RDS DB Instance`: http://docs.aws.amazon.com/cli/latest/userguide/cli-rds-create-instance.html + diff --git a/examples/elasticbeanstalk/create-environment.rst b/examples/elasticbeanstalk/create-environment.rst deleted file mode 100644 index 4fe17cf8ac7c..000000000000 --- a/examples/elasticbeanstalk/create-environment.rst +++ /dev/null @@ -1,9 +0,0 @@ -**To specify a JSON file to define environment configuration options** - -The following ``create-environment`` command specifies that a JSON file with the name ``myoptions.json`` should be used to override values obtained from the solution stack or the configuration template:: - - aws elasticbeanstalk create-environment --environment-name sample-env --application-name sampleapp --option-settings file://myoptions.json - -For more information, see `Option Values`_ in the *AWS Elastic Beanstalk Developer Guide*. - -.. _`Option Values`: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html