Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AWS Outposts examples using AWS CLI

Focus mode
AWS Outposts examples using AWS CLI - AWS Command Line Interface

The following code examples show you how to perform actions and implement common scenarios by using the AWS Command Line Interface with AWS 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.

Each example includes a link to the complete source code, 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.

AWS 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 AWS Outposts User Guide.

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

AWS 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 AWS Outposts User Guide.

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

AWS 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 AWS Outposts User Guide.

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

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

AWS 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 AWS Outposts User Guide.

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

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

AWS CLI

To list Outposts

The following list-outposts example lists the Outposts in your AWS 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 AWS Outposts User Guide.

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

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

AWS CLI

To list Outposts

The following list-outposts example lists the Outposts in your AWS 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 AWS Outposts User Guide.

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

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

AWS CLI

To list sites

The following list-sites example lists the available Outpost sites in your AWS 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 AWS Outposts User Guide.

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

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

AWS CLI

To list sites

The following list-sites example lists the available Outpost sites in your AWS 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 AWS Outposts User Guide.

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

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.