Amazon Outposts examples using Amazon CLI - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon Outposts examples using Amazon CLI

The following code examples show you how to perform actions and implement common scenarios by using the Amazon Command Line Interface with Amazon Outposts.

Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios and cross-service examples.

Scenarios are code examples that show you how to accomplish a specific task by calling multiple functions within the same service.

Each example includes a link to GitHub, where you can find instructions on how to set up and run the code in context.

Topics

Actions

The following code example shows how to use get-outpost-instance-types.

Amazon CLI

To get the instance types on your Outpost

The following get-outpost-instance-types example gets the instance types for the specified Outpost.

aws outposts get-outpost-instance-types \ --outpost-id op-0ab23c4567EXAMPLE

Output:

{ "InstanceTypes": [ { "InstanceType": "c5d.large" }, { "InstanceType": "i3en.24xlarge" }, { "InstanceType": "m5d.large" }, { "InstanceType": "r5d.large" } ], "OutpostId": "op-0ab23c4567EXAMPLE", "OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-0ab23c4567EXAMPLE" }

For more information, see Launch an instance on your Outpost in the Amazon Outposts User Guide.

The following code example shows how to use get-outpost.

Amazon CLI

To get Outpost details

The following get-outpost example displays the details for the specified Outpost.

aws outposts get-outpost \ --outpost-id op-0ab23c4567EXAMPLE

Output:

{ "Outpost": { "OutpostId": "op-0ab23c4567EXAMPLE", "OwnerId": "123456789012", "OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-0ab23c4567EXAMPLE", "SiteId": "os-0ab12c3456EXAMPLE", "Name": "EXAMPLE", "LifeCycleStatus": "ACTIVE", "AvailabilityZone": "us-west-2a", "AvailabilityZoneId": "usw2-az1", "Tags": {} } }

For more information, see Working with Outposts in the Amazon Outposts User Guide.

  • For API details, see GetOutpost in Amazon CLI Command Reference.

The following code example shows how to use list-outposts.

Amazon CLI

To list Outposts

The following list-outposts example lists the Outposts in your Amazon account.

aws outposts list-outposts

Output:

{ "Outposts": [ { "OutpostId": "op-0ab23c4567EXAMPLE", "OwnerId": "123456789012", "OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-0ab23c4567EXAMPLE", "SiteId": "os-0ab12c3456EXAMPLE", "Name": "EXAMPLE", "Description": "example", "LifeCycleStatus": "ACTIVE", "AvailabilityZone": "us-west-2a", "AvailabilityZoneId": "usw2-az1", "Tags": { "Name": "EXAMPLE" } }, { "OutpostId": "op-4fe3dc21baEXAMPLE", "OwnerId": "123456789012", "OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-4fe3dc21baEXAMPLE", "SiteId": "os-0ab12c3456EXAMPLE", "Name": "EXAMPLE2", "LifeCycleStatus": "ACTIVE", "AvailabilityZone": "us-west-2a", "AvailabilityZoneId": "usw2-az1", "Tags": {} } ] }

For more information, see Working with Outposts in the Amazon Outposts User Guide.

  • For API details, see ListOutposts in Amazon CLI Command Reference.

The following code example shows how to use list-sites.

Amazon CLI

To list sites

The following list-sites example lists the available Outpost sites in your Amazon account.

aws outposts list-sites

Output:

{ "Sites": [ { "SiteId": "os-0ab12c3456EXAMPLE", "AccountId": "123456789012", "Name": "EXAMPLE", "Description": "example", "Tags": {} } ] }

For more information, see Working with Outposts in the Amazon Outposts User Guide.

  • For API details, see ListSites in Amazon CLI Command Reference.