Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 39 additions & 7 deletions tests/cli/ec2/describe-ipam-scopes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -50,6 +50,38 @@ Output::
"Value": "Example name value"
}
]
}
]
}
}
]
}

**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"
}
]
}
]
}
8 changes: 8 additions & 0 deletions tests/cli/ec2/describe-scheduled-instance-availability.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 29 additions & 10 deletions tests/cli/ec2/describe-snapshot-attribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html#share-unencrypted-snapshot>`__ in the *Amazon Elastic Compute Cloud User Guide*.
}
]
}

**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 <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html#share-unencrypted-snapshot>`__ in the *Amazon Elastic Compute Cloud User Guide*.
13 changes: 13 additions & 0 deletions tests/cli/ec2/describe-spot-fleet-requests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/ec2/describe-spot-instance-requests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
14 changes: 14 additions & 0 deletions tests/cli/ec2/describe-tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
31 changes: 30 additions & 1 deletion tests/cli/ec2/describe-vpc-endpoint-connections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,33 @@ Output::
"VpcEndpointOwner": "123456789012"
}
]
}
}

**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"
}
]
}
16 changes: 15 additions & 1 deletion tests/cli/ec2/describe-vpc-endpoint-service-permissions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ Output::
"Principal": "arn:aws:iam::123456789012:root"
}
]
}
}

**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"
]
26 changes: 19 additions & 7 deletions tests/cli/ec2/get-serial-console-access-status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html>`__ in the *Amazon EC2 User Guide*.
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 <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html>`__ in the *Amazon EC2 User Guide*.
28 changes: 21 additions & 7 deletions tests/cli/ec2/modify-security-group-rules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html>`__ in the *Amazon EC2 User Guide*.
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 <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html>`__ in the *Amazon EC2 User Guide*.
26 changes: 25 additions & 1 deletion tests/cli/ec2/modify-subnet-attribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
.. _`IP Addressing in Your VPC`: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-ip-addressing.html
30 changes: 29 additions & 1 deletion tests/cli/ec2/modify-vpc-endpoint-service-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,32 @@ Output::

{
"ReturnValue": true
}
}

**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
}
2 changes: 1 addition & 1 deletion tests/cli/ec2/run-scheduled-instances.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Launch-specification.json::
"InstanceType": "c4.large",
"Placement": {
"AvailabilityZone": "us-west-2b"
}
},
"IamInstanceProfile": {
"Name": "my-iam-role"
}
Expand Down