Finding a subnet ID - AMS Advanced User Guide

Finding a subnet ID

Several resources require that you specify a subnet, or list of subnets, at configuration time. To find subnets, you can use either the AMS console or AMS SKMS API/CLI. Note that the AMS SKMS API/CLI is private and must be installed before you can use it.

AMS Console:

  1. In the navigation pane, select VPCs and the relevant VPC. The VPC details page for the selected VPC opens with a table of subnets, click a subnet ID to open the details page and find the ID.

AMS SKMS API ListSubnetSummaries or CLI (for the AMS SKMS API reference, see the Reports tab in the AWS Artifact Console):

Note

The AMS CLI must be installed for these commands to work. To install the AMS API or CLI, go to the AMS console Developers Resources page. For reference material on the AMS CM API or AMS SKMS API, see the AMS Information Resources section in the User Guide.

To find the subnets for your VPC by Visibility status, private or public, you can search with the list-subnet-summaries command as shown.

  1. The SKMS API ListSubnetSummaries operation has parameters to narrow the results based on visibility. In addition, you can Filter results based on name. If you're using the CLI, you can also use the --query option to narrow the output or search on a portion of a value. For example, to find all of the subnets for a particular VPC, you can use this command:

    aws amsskms list-subnet-summaries --query "SubnetSummaries.sort_by(@,&Visibility.Name)[].[Visibility.Name,SubnetId,Name]" --output table

    Which returns something like this:

    -------------------------------------------------------------------- | ListSubnetSummaries | +---------+------------ -------+---------------------------+ | Private| subnet-01234567890abcdef | Demo Deployment Zone #1 | | Private| subnet-01234567890abcdef | Demo Deployment Zone #1 | | Public | subnet-01234567890abcdef | Demo DMZ #1 | | Public | subnet-01234567890abcdef | Demo DMZ #1 | +---------+---------- ---------+---------------------------+

    For information about using CLI queries, see How to Filter the Output with the --query Option and the query language reference, JMESPath Specification.

  2. If you have multiple VPCs, include a VPC filter in the command, and then run the command for each VPC. For example:

    list-subnet-summaries --filter Attribute=VpcId,Value=vpc-xxxxxxxx --query "SubnetSummaries.sort_by(@,&Visibility.Name)[].[Visibility.Name,SubnetId,Name]" --output table

For information about using CLI queries, see How to Filter the Output with the --query Option and the query language reference, JMESPath Specification..