diff --git a/tests/cli/ec2/describe-ipam-scopes.rst b/tests/cli/ec2/describe-ipam-scopes.rst index a19fd7f..5523852 100644 --- a/tests/cli/ec2/describe-ipam-scopes.rst +++ b/tests/cli/ec2/describe-ipam-scopes.rst @@ -5,10 +5,10 @@ The following ``describe-ipam-scopes`` example shows the details for scopes. :: aws ec2 describe-ipam-scopes \ --filters Name=owner-id,Values=123456789012 Name=ipam-id,Values=ipam-08440e7a3acde3908 -Output:: - - { - "IpamScopes": [ +Output:: + + { + "IpamScopes": [ { "OwnerId": "123456789012", "IpamScopeId": "ipam-scope-02fc38cd4c48e7d38", @@ -50,6 +50,38 @@ Output:: "Value": "Example name value" } ] - } - ] - } \ No newline at end of file + } + ] + } + +**To view the details for a specific IPAM scope** + +The following ``describe-ipam-scopes`` example shows the details for a single scope. :: + + aws ec2 describe-ipam-scopes \ + --ipam-scope-ids ipam-scope-0f1aff29486355c22 + +Output:: + + { + "IpamScopes": [ + { + "OwnerId": "123456789012", + "IpamScopeId": "ipam-scope-0f1aff29486355c22", + "IpamScopeArn": "arn:aws:ec2::123456789012:ipam-scope/ipam-scope-0f1aff29486355c22", + "IpamArn": "arn:aws:ec2::123456789012:ipam/ipam-08440e7a3acde3908", + "IpamRegion": "us-east-1", + "IpamScopeType": "private", + "IsDefault": false, + "Description": "Example description", + "PoolCount": 0, + "State": "create-complete", + "Tags": [ + { + "Key": "Name", + "Value": "Example name value" + } + ] + } + ] + } diff --git a/tests/cli/ec2/describe-scheduled-instance-availability.rst b/tests/cli/ec2/describe-scheduled-instance-availability.rst index 4a3bd17..5794a3b 100644 --- a/tests/cli/ec2/describe-scheduled-instance-availability.rst +++ b/tests/cli/ec2/describe-scheduled-instance-availability.rst @@ -41,3 +41,11 @@ To narrow the results, you can add filters that specify the operating system, ne Command: --filters Name=platform,Values=Linux/UNIX Name=network-platform,Values=EC2-VPC Name=instance-type,Values=c4.large + +**To describe available schedules for a specific instance type** + +This example narrows the results to Linux/UNIX ``c4.large`` schedules in EC2-VPC. + +Command:: + + aws ec2 describe-scheduled-instance-availability --recurrence Frequency=Weekly,Interval=1,OccurrenceDays=[1] --first-slot-start-time-range EarliestTime=2016-01-31T00:00:00Z,LatestTime=2016-01-31T04:00:00Z --filters Name=platform,Values=Linux/UNIX Name=network-platform,Values=EC2-VPC Name=instance-type,Values=c4.large diff --git a/tests/cli/ec2/describe-snapshot-attribute.rst b/tests/cli/ec2/describe-snapshot-attribute.rst index cac65fe..cd66bfe 100644 --- a/tests/cli/ec2/describe-snapshot-attribute.rst +++ b/tests/cli/ec2/describe-snapshot-attribute.rst @@ -6,15 +6,34 @@ The following ``describe-snapshot-attribute`` example lists the accounts with wh --snapshot-id snap-01234567890abcedf \ --attribute createVolumePermission -Output:: - - { - "SnapshotId": "snap-01234567890abcedf", - "CreateVolumePermissions": [ +Output:: + + { + "SnapshotId": "snap-01234567890abcedf", + "CreateVolumePermissions": [ { "UserId": "123456789012" - } - ] - } - -For more information, see `Share an Amazon EBS snapshot `__ in the *Amazon Elastic Compute Cloud User Guide*. \ No newline at end of file + } + ] + } + +**To describe the snapshot attributes for a public snapshot** + +The following ``describe-snapshot-attribute`` example lists the create volume permissions for a public snapshot. :: + + aws ec2 describe-snapshot-attribute \ + --snapshot-id snap-0abc1234def567890 \ + --attribute createVolumePermission + +Output:: + + { + "SnapshotId": "snap-0abc1234def567890", + "CreateVolumePermissions": [ + { + "Group": "all" + } + ] + } + +For more information, see `Share an Amazon EBS snapshot `__ in the *Amazon Elastic Compute Cloud User Guide*. diff --git a/tests/cli/ec2/describe-spot-fleet-requests.rst b/tests/cli/ec2/describe-spot-fleet-requests.rst index d52ab4d..93a7b6b 100644 --- a/tests/cli/ec2/describe-spot-fleet-requests.rst +++ b/tests/cli/ec2/describe-spot-fleet-requests.rst @@ -77,6 +77,19 @@ Output:: ] } +**To list the IDs of active Spot fleet requests** + +This example lists the IDs of Spot fleet requests that are currently active. + +Command:: + + aws ec2 describe-spot-fleet-requests --query "SpotFleetRequestConfigs[?SpotFleetRequestState=='active'].SpotFleetRequestId" --output text + +Output:: + + sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE + sfr-306341ed-9739-402e-881b-ce47bEXAMPLE + **To describe a Spot fleet request** This example describes the specified Spot fleet request. diff --git a/tests/cli/ec2/describe-spot-instance-requests.rst b/tests/cli/ec2/describe-spot-instance-requests.rst index 287192b..022d7b1 100644 --- a/tests/cli/ec2/describe-spot-instance-requests.rst +++ b/tests/cli/ec2/describe-spot-instance-requests.rst @@ -52,8 +52,8 @@ Output:: "LaunchedAvailabilityZone": "us-east-2b", "ProductDescription": "Linux/UNIX", "SpotInstanceRequestId": "sir-08b93456", - "SpotPrice": "0.010000" - "State": "active", + "SpotPrice": "0.010000", + "State": "active", "Status": { "Code": "fulfilled", "Message": "Your Spot request is fulfilled.", diff --git a/tests/cli/ec2/describe-tags.rst b/tests/cli/ec2/describe-tags.rst index fcc3c8d..9d7f444 100755 --- a/tests/cli/ec2/describe-tags.rst +++ b/tests/cli/ec2/describe-tags.rst @@ -130,3 +130,17 @@ Output:: } ] } + +**Example 6: To list resource IDs that match a tag filter** + +The following ``describe-tags`` example returns only the resource IDs for subnets tagged ``Environment=prod``. :: + + aws ec2 describe-tags \ + --filters Name=resource-type,Values=subnet Name=key,Values=Environment Name=value,Values=prod \ + --query "Tags[*].ResourceId" \ + --output text + +Output:: + + subnet-0abc1234def567890 + subnet-0123abcd4567ef890 diff --git a/tests/cli/ec2/describe-vpc-endpoint-connections.rst b/tests/cli/ec2/describe-vpc-endpoint-connections.rst index 4189097..6b0811b 100644 --- a/tests/cli/ec2/describe-vpc-endpoint-connections.rst +++ b/tests/cli/ec2/describe-vpc-endpoint-connections.rst @@ -18,4 +18,33 @@ Output:: "VpcEndpointOwner": "123456789012" } ] - } \ No newline at end of file + } + +**To describe VPC endpoint connections for a specific endpoint service** + +This example describes the interface endpoint connections for the specified endpoint service. + +Command:: + + aws ec2 describe-vpc-endpoint-connections --filters Name=service-id,Values=vpce-svc-0abced088d20def56 + +Output:: + + { + "VpcEndpointConnections": [ + { + "VpcEndpointId": "vpce-0abed31004e618123", + "ServiceId": "vpce-svc-0abced088d20def56", + "CreationTimestamp": "2017-11-30T10:00:24.350Z", + "VpcEndpointState": "available", + "VpcEndpointOwner": "123456789012" + }, + { + "VpcEndpointId": "vpce-0f46ed8b3a1c9d456", + "ServiceId": "vpce-svc-0abced088d20def56", + "CreationTimestamp": "2017-12-01T08:42:10.000Z", + "VpcEndpointState": "available", + "VpcEndpointOwner": "210987654321" + } + ] + } diff --git a/tests/cli/ec2/describe-vpc-endpoint-service-permissions.rst b/tests/cli/ec2/describe-vpc-endpoint-service-permissions.rst index d947f60..008820c 100644 --- a/tests/cli/ec2/describe-vpc-endpoint-service-permissions.rst +++ b/tests/cli/ec2/describe-vpc-endpoint-service-permissions.rst @@ -15,4 +15,18 @@ Output:: "Principal": "arn:aws:iam::123456789012:root" } ] - } \ No newline at end of file + } + +**To describe endpoint service permissions with a query** + +This example lists only the principals that are allowed to connect to the specified endpoint service. + +Command:: + + aws ec2 describe-vpc-endpoint-service-permissions --service-id vpce-svc-03d5ebb7d9579a2b3 --query "AllowedPrincipals[*].Principal" + +Output:: + + [ + "arn:aws:iam::123456789012:root" + ] diff --git a/tests/cli/ec2/get-serial-console-access-status.rst b/tests/cli/ec2/get-serial-console-access-status.rst index bc96aca..e160b98 100644 --- a/tests/cli/ec2/get-serial-console-access-status.rst +++ b/tests/cli/ec2/get-serial-console-access-status.rst @@ -4,10 +4,22 @@ The following ``get-serial-console-access-status`` example determines whether se aws ec2 get-serial-console-access-status -Output:: - - { - "SerialConsoleAccessEnabled": true - } - -For more information, see `EC2 Serial Console `__ in the *Amazon EC2 User Guide*. \ No newline at end of file +Output:: + + { + "SerialConsoleAccessEnabled": true + } + +**To return the serial console access flag as text** + +The following ``get-serial-console-access-status`` example returns only the access flag for machine-consumable checks. :: + + aws ec2 get-serial-console-access-status \ + --query "SerialConsoleAccessEnabled" \ + --output text + +Output:: + + true + +For more information, see `EC2 Serial Console `__ in the *Amazon EC2 User Guide*. diff --git a/tests/cli/ec2/modify-security-group-rules.rst b/tests/cli/ec2/modify-security-group-rules.rst index 8fd6021..7363275 100644 --- a/tests/cli/ec2/modify-security-group-rules.rst +++ b/tests/cli/ec2/modify-security-group-rules.rst @@ -6,10 +6,24 @@ The following ``modify-security-group-rules`` example updates the description, t --group-id sg-1234567890abcdef0 \ --security-group-rules SecurityGroupRuleId=sgr-abcdef01234567890,SecurityGroupRule='{Description=test,IpProtocol=-1,CidrIpv4=0.0.0.0/0}' -Output:: - - { - "Return": true - } - -For more information about security group rules, see `Security group rules `__ in the *Amazon EC2 User Guide*. \ No newline at end of file +Output:: + + { + "Return": true + } + +**To modify a security group rule to update the description and port range** + +The following ``modify-security-group-rules`` example updates the description and the port range of a TCP ingress rule for HTTPS traffic. :: + + aws ec2 modify-security-group-rules \ + --group-id sg-1234567890abcdef0 \ + --security-group-rules SecurityGroupRuleId=sgr-bcdef01234567890a,SecurityGroupRule='{Description=HTTPS access for corporate clients,IpProtocol=tcp,FromPort=443,ToPort=443,CidrIpv4=203.0.113.0/24}' + +Output:: + + { + "Return": true + } + +For more information about security group rules, see `Security group rules `__ in the *Amazon EC2 User Guide*. diff --git a/tests/cli/ec2/modify-subnet-attribute.rst b/tests/cli/ec2/modify-subnet-attribute.rst index a36164f..36264e8 100644 --- a/tests/cli/ec2/modify-subnet-attribute.rst +++ b/tests/cli/ec2/modify-subnet-attribute.rst @@ -14,6 +14,30 @@ Command:: aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --assign-ipv6-address-on-creation +**To enable DNS64 for a subnet** + +This example modifies ``subnet-1a2b3c4d`` so IPv6-only workloads in the subnet can reach IPv4 destinations through a NAT64 gateway. If the command succeeds, no output is returned. + +Command:: + + aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --enable-dns64 + +**To change the private DNS hostname type for a subnet** + +This example modifies ``subnet-1a2b3c4d`` so that instances launched into the subnet use resource-name based private DNS hostnames. If the command succeeds, no output is returned. + +Command:: + + aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --private-dns-hostname-type-on-launch resource-name + +**To enable resource-name AAAA records for a subnet** + +This example modifies ``subnet-1a2b3c4d`` so that instances launched into the subnet receive IPv6 AAAA records that are derived from the resource name. If the command succeeds, no output is returned. + +Command:: + + aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --enable-resource-name-dns-aaaa-record-on-launch + For more information, see `IP Addressing in Your VPC`_ in the *AWS Virtual Private Cloud User Guide*. -.. _`IP Addressing in Your VPC`: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-ip-addressing.html \ No newline at end of file +.. _`IP Addressing in Your VPC`: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-ip-addressing.html diff --git a/tests/cli/ec2/modify-vpc-endpoint-service-configuration.rst b/tests/cli/ec2/modify-vpc-endpoint-service-configuration.rst index ab64c04..966ee84 100644 --- a/tests/cli/ec2/modify-vpc-endpoint-service-configuration.rst +++ b/tests/cli/ec2/modify-vpc-endpoint-service-configuration.rst @@ -10,4 +10,32 @@ Output:: { "ReturnValue": true - } \ No newline at end of file + } + +**To add supported Regions to an endpoint service** + +This example adds two supported Regions to the specified endpoint service so interface endpoints can be created from those Regions. + +Command:: + + aws ec2 modify-vpc-endpoint-service-configuration --service-id vpce-svc-09222513e6e77dc86 --add-supported-regions us-east-1 us-west-2 + +Output:: + + { + "ReturnValue": true + } + +**To set a private DNS name for an endpoint service** + +This example configures a private DNS name for the specified endpoint service. + +Command:: + + aws ec2 modify-vpc-endpoint-service-configuration --service-id vpce-svc-09222513e6e77dc86 --private-dns-name api.internal.example.com + +Output:: + + { + "ReturnValue": true + } diff --git a/tests/cli/ec2/run-scheduled-instances.rst b/tests/cli/ec2/run-scheduled-instances.rst index 92f2c9a..9269f3c 100644 --- a/tests/cli/ec2/run-scheduled-instances.rst +++ b/tests/cli/ec2/run-scheduled-instances.rst @@ -48,7 +48,7 @@ Launch-specification.json:: "InstanceType": "c4.large", "Placement": { "AvailabilityZone": "us-west-2b" - } + }, "IamInstanceProfile": { "Name": "my-iam-role" }