View a markdown version of this page

AWS AppConfig examples using AWS CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

AWS AppConfig examples using AWS CLI

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

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 create-application.

AWS CLI

To create an application

The following create-application example creates an application in AWS AppConfig.

aws appconfig create-application \ --name "example-application" \ --description "An application used for creating an example."

Output:

{ "Description": "An application used for creating an example.", "Id": "339ohji", "Name": "example-application" }

For more information, see Step 1: Creating an AWS AppConfig application in the AWS AppConfig User Guide.

The following code example shows how to use create-configuration-profile.

AWS CLI

To create a configuration profile

The following create-configuration-profile example creates a configuration profile using a configuration stored in Parameter Store, a capability of Systems Manager.

aws appconfig create-configuration-profile \ --application-id "339ohji" \ --name "Example-Configuration-Profile" \ --location-uri "ssm-parameter://Example-Parameter" \ --retrieval-role-arn "arn:aws:iam::111122223333:role/Example-App-Config-Role"

Output:

{ "ApplicationId": "339ohji", "Description": null, "Id": "ur8hx2f", "LocationUri": "ssm-parameter://Example-Parameter", "Name": "Example-Configuration-Profile", "RetrievalRoleArn": "arn:aws:iam::111122223333:role/Example-App-Config-Role", "Type": null, "Validators": null }

For more information, see Step 3: Creating a configuration and a configuration profile in the AWS AppConfig User Guide.