Skip to content

Commit

Permalink
Merge pull request #8425 from elysahall/awsdocs-12-18-23
Browse files Browse the repository at this point in the history
CLI examples for ec2, elbv2, iot, ivs-realtime, lambda, omics, secret…
  • Loading branch information
kyleknap authored Dec 22, 2023
2 parents 38b00c2 + 721728c commit 518a914
Show file tree
Hide file tree
Showing 54 changed files with 1,650 additions and 376 deletions.
233 changes: 194 additions & 39 deletions awscli/examples/ec2/create-network-interface.rst
Original file line number Diff line number Diff line change
@@ -1,39 +1,194 @@
**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",
"Ipv6Addresses": [],
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-903004f8"
}
],
"SubnetId": "subnet-9d4a7b6c",
"OwnerId": "123456789012",
"TagSet": [],
"PrivateIpAddress": "10.0.2.17"
}
}
**Example 1: To specify an IPv4 address for a network interface**

The following ``create-network-interface`` example creates a network interface for the specified subnet with the specified primary IPv4 address. ::

aws ec2 create-network-interface \
--subnet-id subnet-00a24d0d67acf6333 \
--description "my network interface" \
--groups sg-09dfba7ed20cda78b \
--private-ip-address 10.0.8.17

Output::

{
"NetworkInterface": {
"AvailabilityZone": "us-west-2a",
"Description": "my network interface",
"Groups": [
{
"GroupName": "my-security-group",
"GroupId": "sg-09dfba7ed20cda78b"
}
],
"InterfaceType": "interface",
"Ipv6Addresses": [],
"MacAddress": "06:6a:0f:9a:49:37",
"NetworkInterfaceId": "eni-0492b355f0cf3b3f8",
"OwnerId": "123456789012",
"PrivateDnsName": "ip-10-0-8-18.us-west-2.compute.internal",
"PrivateIpAddress": "10.0.8.17",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateDnsName": "ip-10-0-8-17.us-west-2.compute.internal",
"PrivateIpAddress": "10.0.8.17"
}
],
"RequesterId": "AIDA4Z3Y7GSXTMEXAMPLE",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "pending",
"SubnetId": "subnet-00a24d0d67acf6333",
"TagSet": [],
"VpcId": "vpc-02723a0feeeb9d57b"
}
}

**Example 2: To create a network interface with an IPv4 address and an IPv6 address**

The following ``create-network-interface`` example creates a network interface for the specified subnet with an IPv4 address and an IPv6 address that are selected by Amazon EC2. ::

aws ec2 create-network-interface \
--subnet-id subnet-00a24d0d67acf6333 \
--description "my dual stack network interface" \
--ipv6-address-count 1 \
--groups sg-09dfba7ed20cda78b

Output::

{
"NetworkInterface": {
"AvailabilityZone": "us-west-2a",
"Description": "my dual stack network interface",
"Groups": [
{
"GroupName": "my-security-group",
"GroupId": "sg-09dfba7ed20cda78b"
}
],
"InterfaceType": "interface",
"Ipv6Addresses": [
{
"Ipv6Address": "2600:1f13:cfe:3650:a1dc:237c:393a:4ba7",
"IsPrimaryIpv6": false
}
],
"MacAddress": "06:b8:68:d2:b2:2d",
"NetworkInterfaceId": "eni-05da417453f9a84bf",
"OwnerId": "123456789012",
"PrivateDnsName": "ip-10-0-8-18.us-west-2.compute.internal",
"PrivateIpAddress": "10.0.8.18",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateDnsName": "ip-10-0-8-18.us-west-2.compute.internal",
"PrivateIpAddress": "10.0.8.18"
}
],
"RequesterId": "AIDA4Z3Y7GSXTMEXAMPLE",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "pending",
"SubnetId": "subnet-00a24d0d67acf6333",
"TagSet": [],
"VpcId": "vpc-02723a0feeeb9d57b",
"Ipv6Address": "2600:1f13:cfe:3650:a1dc:237c:393a:4ba7"
}
}

**Example 3: To create a network interface with connection tracking configuration options**

The following ``create-network-interface`` example creates a network interface and configures the idle connection tracking timeouts. ::

aws ec2 create-network-interface \
--subnet-id subnet-00a24d0d67acf6333 \
--groups sg-02e57dbcfe0331c1b \
--connection-tracking-specification TcpEstablishedTimeout=86400,UdpTimeout=60

Output::

{
"NetworkInterface": {
"AvailabilityZone": "us-west-2a",
"ConnectionTrackingConfiguration": {
"TcpEstablishedTimeout": 86400,
"UdpTimeout": 60
},
"Description": "",
"Groups": [
{
"GroupName": "my-security-group",
"GroupId": "sg-02e57dbcfe0331c1b"
}
],
"InterfaceType": "interface",
"Ipv6Addresses": [],
"MacAddress": "06:4c:53:de:6d:91",
"NetworkInterfaceId": "eni-0c133586e08903d0b",
"OwnerId": "123456789012",
"PrivateDnsName": "ip-10-0-8-94.us-west-2.compute.internal",
"PrivateIpAddress": "10.0.8.94",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateDnsName": "ip-10-0-8-94.us-west-2.compute.internal",
"PrivateIpAddress": "10.0.8.94"
}
],
"RequesterId": "AIDA4Z3Y7GSXTMEXAMPLE",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "pending",
"SubnetId": "subnet-00a24d0d67acf6333",
"TagSet": [],
"VpcId": "vpc-02723a0feeeb9d57b"
}
}

**Example 4: To create an Elastic Fabric Adapter**

The following ``create-network-interface`` example creates an EFA. ::

aws ec2 create-network-interface \
--interface-type efa \
--subnet-id subnet-00a24d0d67acf6333 \
--description "my efa" \
--groups sg-02e57dbcfe0331c1b

Output::

{
"NetworkInterface": {
"AvailabilityZone": "us-west-2a",
"Description": "my efa",
"Groups": [
{
"GroupName": "my-efa-sg",
"GroupId": "sg-02e57dbcfe0331c1b"
}
],
"InterfaceType": "efa",
"Ipv6Addresses": [],
"MacAddress": "06:d7:a4:f7:4d:57",
"NetworkInterfaceId": "eni-034acc2885e862b65",
"OwnerId": "123456789012",
"PrivateDnsName": "ip-10-0-8-180.us-west-2.compute.internal",
"PrivateIpAddress": "10.0.8.180",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateDnsName": "ip-10-0-8-180.us-west-2.compute.internal",
"PrivateIpAddress": "10.0.8.180"
}
],
"RequesterId": "AIDA4Z3Y7GSXTMEXAMPLE",
"RequesterManaged": false,
"SourceDestCheck": true,
"Status": "pending",
"SubnetId": "subnet-00a24d0d67acf6333",
"TagSet": [],
"VpcId": "vpc-02723a0feeeb9d57b"
}
}

For more information, see `Elastic network interfaces <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html>`__ in the *Amazon EC2 User Guide*.
3 changes: 2 additions & 1 deletion awscli/examples/ec2/create-store-image-task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ Output::
"ObjectKey": "ami-1234567890abcdef0.bin"
}

For more information about storing and restoring an AMI using S3, see `Store and restore an AMI using S3 <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html>` in the *Amazon EC2 User Guide*.
For more information, see `Store and restore an AMI using S3 <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html>`__ in the *Amazon EC2 User Guide*.

19 changes: 19 additions & 0 deletions awscli/examples/ec2/create-transit-gateway-policy-table.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
**To create a transit gateway policy table**

The following ``create-transit-gateway-policy-table`` example creates a transit gateway policy table for the specified transit gateway. ::

aws ec2 create-transit-gateway-policy-table \
--transit-gateway-id tgw-067f8505c18f0bd6e

Output::

{
"TransitGatewayPolicyTable": {
"TransitGatewayPolicyTableId": "tgw-ptb-0a16f134b78668a81",
"TransitGatewayId": "tgw-067f8505c18f0bd6e",
"State": "pending",
"CreationTime": "2023-11-28T16:36:43+00:00"
}
}

For more information, see `Transit gateway policy tables <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-policy-tables.html>`__ in the *Transit Gateway User Guide*.
27 changes: 15 additions & 12 deletions awscli/examples/ec2/delete-key-pair.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
**To delete a key pair**

This example deletes the key pair named ``MyKeyPair``. If the command succeeds, no output is returned.

Command::

aws ec2 delete-key-pair --key-name MyKeyPair

For more information, see `Using Key Pairs`_ in the *AWS Command Line Interface User Guide*.

.. _`Using Key Pairs`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html

**To delete a key pair**

The following ``delete-key-pair`` example deletes the specified key pair. ::

aws ec2 delete-key-pair \
--key-name my-key-pair

Output::

{
"Return": true,
"KeyPairId": "key-03c8d3aceb53b507"
}

For more information, see `Create and delete key pairs <https://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html>`__ in the *AWS Command Line Interface User Guide*.
22 changes: 22 additions & 0 deletions awscli/examples/ec2/delete-transit-gateway-policy-table.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
**To delete a transit gateway policy table**

The following ``delete-transit-gateway-policy-table`` example deletes the specified transit gateway policy table. ::

aws ec2 delete-transit-gateway-policy-table \
--transit-gateway-policy-table-id tgw-ptb-0a16f134b78668a81

Output::

{
"TransitGatewayPolicyTables": [
{
"TransitGatewayPolicyTableId": "tgw-ptb-0a16f134b78668a81",
"TransitGatewayId": "tgw-067f8505c18f0bd6e",
"State": "deleting",
"CreationTime": "2023-11-28T16:36:43+00:00",
"Tags": []
}
]
}

For more information, see `Transit gateway policy tables <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-policy-tables.html>`__ in the *Transit Gateway User Guide*.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
**To describe your metric subscriptions**

The following ``describe-aws-network-performance-metric-subscriptions`` example describes your metric subscriptions. ::

aws ec2 describe-aws-network-performance-metric-subscriptions

Output::

{
"Subscriptions": [
{
"Source": "us-east-1",
"Destination": "eu-west-1",
"Metric": "aggregate-latency",
"Statistic": "p50",
"Period": "five-minutes"
}
]
}

For more information, see `Manage subscriptions <https://docs.aws.amazon.com/network-manager/latest/infrastructure-performance/nmip-subscriptions-cw.html>`__ in the *Infrastructure Performance User Guide*.
61 changes: 61 additions & 0 deletions awscli/examples/ec2/describe-instance-topology.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
**To describe the instance topology of all your instances**

The following ``describe-instance-topology`` example describes the topology of all your instances that match the supported instance types for this command. ::

aws ec2 describe-instance-topology \
--region us-west-2

Output::

{
"Instances": [
{
"InstanceId": "i-1111111111example",
"InstanceType": "p4d.24xlarge",
"GroupName": "my-ml-cpg",
"NetworkNodes": [
"nn-1111111111example",
"nn-2222222222example",
"nn-3333333333example"
],
"ZoneId": "usw2-az2",
"AvailabilityZone": "us-west-2a"
},
{
"InstanceId": "i-2222222222example",
"InstanceType": "p4d.24xlarge",
"NetworkNodes": [
"nn-1111111111example",
"nn-2222222222example",
"nn-3333333333example"
],
"ZoneId": "usw2-az2",
"AvailabilityZone": "us-west-2a"
},
{
"InstanceId": "i-3333333333example",
"InstanceType": "trn1.32xlarge",
"NetworkNodes": [
"nn-1212121212example",
"nn-1211122211example",
"nn-1311133311example"
],
"ZoneId": "usw2-az4",
"AvailabilityZone": "us-west-2d"
},
{
"InstanceId": "i-444444444example",
"InstanceType": "trn1.2xlarge",
"NetworkNodes": [
"nn-1111111111example",
"nn-5434334334example",
"nn-1235301234example"
],
"ZoneId": "usw2-az2",
"AvailabilityZone": "us-west-2a"
}
],
"NextToken": "SomeEncryptedToken"
}

For more information, including more examples, see `Amazon EC2 instance topology <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology.html>`__ in the *Amazon EC2 User Guide*.
Loading

0 comments on commit 518a914

Please sign in to comment.