This documentation is for Version 1 of the AWS CLI only. For documentation related to Version 2 of the AWS CLI, see the Version 2 User Guide.
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-applicationexample 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.
-
For API details, see CreateApplication
in AWS CLI Command Reference.
-
The following code example shows how to use create-configuration-profile.
- AWS CLI
-
To create a configuration profile
The following
create-configuration-profileexample 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.
-
For API details, see CreateConfigurationProfile
in AWS CLI Command Reference.
-
The following code example shows how to use create-environment.
- AWS CLI
-
To create an environment
The following
create-environmentexample creates an AWS AppConfig environment named Example-Environment using the application you created using create-application.aws appconfig create-environment \ --application-id"339ohji"\ --name"Example-Environment"Output:
{ "ApplicationId": "339ohji", "Description": null, "Id": "54j1r29", "Monitors": null, "Name": "Example-Environment", "State": "ReadyForDeployment" }For more information, see Step 2: Creating an environment in the AWS AppConfig User Guide.
-
For API details, see CreateEnvironment
in AWS CLI Command Reference.
-
The following code example shows how to use create-extension-association.
- AWS CLI
-
To create an extension association
The following
create-extension-associationexample creates a new extension association in AWS AppConfig.aws appconfig create-extension-association \ --regionus-west-2\ --extension-identifierS3-backup-extension\ --resource-identifier"arn:aws:appconfig:us-west-2:123456789012:application/Finance"\ --parametersS3bucket=FinanceConfigurationBackupOutput:
{ "Id": "a1b2c3d4", "ExtensionArn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "ResourceArn": "arn:aws:appconfig:us-west-2:123456789012:application/Finance", "Parameters": { "S3bucket": "FinanceConfigurationBackup" }, "ExtensionVersionNumber": 1 }For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see CreateExtensionAssociation
in AWS CLI Command Reference.
-
The following code example shows how to use create-extension.
- AWS CLI
-
To create an extension
The following
create-extensionexample creates a new extension in AWS AppConfig.aws appconfig create-extension \ --regionus-west-2\ --nameS3-backup-extension\ --actionsPRE_CREATE_HOSTED_CONFIGURATION_VERSION=[{Name=S3backup,Uri=arn:aws:lambda:us-west-2:123456789012:function:s3backupfunction,RoleArn=arn:aws:iam::123456789012:role/appconfigextensionrole}]\ --parametersS3bucket={Required=true}Output:
{ "Id": "1A2B3C4D", "Name": "S3-backup-extension", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2:123456789012:extension/1A2B3C4D/1", "Actions": { "PRE_CREATE_HOSTED_CONFIGURATION_VERSION": [ { "Name": "S3backup", "Uri": "arn:aws:lambda:us-west-2:123456789012:function:s3backupfunction", "RoleArn": "arn:aws:iam::123456789012:role/appconfigextensionrole" } ] }, "Parameters": { "S3bucket": { "Required": true } } }For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see CreateExtension
in AWS CLI Command Reference.
-
The following code example shows how to use create-hosted-configuration-version.
- AWS CLI
-
To create a hosted configuration version
The following
create-hosted-configuration-versionexample creates a new configuration in the AWS AppConfig hosted configuration store. The configuration content must first be converted to base64.aws appconfig create-hosted-configuration-version \ --application-id"339ohji"\ --configuration-profile-id"ur8hx2f"\ --contenteyAiTmFtZSI6ICJFeGFtcGxlQXBwbGljYXRpb24iLCAiSWQiOiBFeGFtcGxlSUQsICJSYW5rIjogNyB9\ --content-type"application/json"\configuration_version_output_fileContents of
configuration_version_output_file:{ "Name": "ExampleApplication", "Id": ExampleID, "Rank": 7 }Output:
{ "ApplicationId": "339ohji", "ConfigurationProfileId": "ur8hx2f", "VersionNumber": "1", "ContentType": "application/json" }For more information, see About the AWS AppConfig hosted configuration store in the AWS Appconfig User Guide.
-
For API details, see CreateHostedConfigurationVersion
in AWS CLI Command Reference.
-
The following code example shows how to use delete-application.
- AWS CLI
-
To delete an application
The following
delete-applicationexample deletes the specified application.aws appconfig delete-application \ --application-id339ohjiThis command produces no output.
For more information, see Step 1: Creating an AWS AppConfig application in the AWS AppConfig User Guide.
-
For API details, see DeleteApplication
in AWS CLI Command Reference.
-
The following code example shows how to use delete-configuration-profile.
- AWS CLI
-
To delete a configuration profile
The following
delete-configuration-profileexample deletes the specified configuration profile.aws appconfig delete-configuration-profile \ --application-id339ohji\ --configuration-profile-idur8hx2fThis command produces no output.
For more information, see Step 3: Creating a configuration and a configuration profile in the AWS AppConfig User Guide.
-
For API details, see DeleteConfigurationProfile
in AWS CLI Command Reference.
-
The following code example shows how to use delete-deployment-strategy.
- AWS CLI
-
To delete a deployment strategy
The following
delete-deployment-strategyexample deletes the specified deployment strategy.aws appconfig delete-deployment-strategy \ --deployment-strategy-id1225qzkThis command produces no output.
For more information, see Step 4: Creating a deployment strategy in the AWS AppConfig User Guide.
-
For API details, see DeleteDeploymentStrategy
in AWS CLI Command Reference.
-
The following code example shows how to use delete-environment.
- AWS CLI
-
To delete an environment
The following
delete-environmentexample deletes the specified application environment.aws appconfig delete-environment \ --application-id339ohji\ --environment-id54j1r29This command produces no output.
For more information, see Step 2: Creating an environment in the AWS AppConfig User Guide.
-
For API details, see DeleteEnvironment
in AWS CLI Command Reference.
-
The following code example shows how to use delete-extension-association.
- AWS CLI
-
To delete an extension association
The following
delete-extension-associationexample deletes an extension association from AWS AppConfig.aws appconfig delete-extension-association \ --regionus-west-2\ --extension-association-ida1b2c3d4This command produces no output.
For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see DeleteExtensionAssociation
in AWS CLI Command Reference.
-
The following code example shows how to use delete-extension.
- AWS CLI
-
To delete an extension
The following
delete-extensionexample deletes an extension from AWS AppConfig.aws appconfig delete-extension \ --regionus-west-2\ --extension-identifierS3-backup-extensionThis command produces no output.
For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see DeleteExtension
in AWS CLI Command Reference.
-
The following code example shows how to use delete-hosted-configuration-version.
- AWS CLI
-
To delete a hosted configuration version
The following
delete-hosted-configuration-versionexample deletes a configuration version hosted in the AWS AppConfig hosted configuration store.aws appconfig delete-hosted-configuration-version \ --application-id339ohji\ --configuration-profile-idur8hx2f\ --version-number1Output:: This command produces no output.
For more information, see Step 3: Creating a configuration and a configuration profile in the AWS AppConfig User Guide.
-
For API details, see DeleteHostedConfigurationVersion
in AWS CLI Command Reference.
-
The following code example shows how to use get-application.
- AWS CLI
-
To list details of an application
The following
get-applicationexample lists the details of the specified application.aws appconfig get-application \ --application-id339ohjiOutput:
{ "Description": "An application used for creating an example.", "Id": "339ohji", "Name": "example-application" }For more information, see How AWS AppConfig works in the AWS AppConfig User Guide.
-
For API details, see GetApplication
in AWS CLI Command Reference.
-
The following code example shows how to use get-configuration-profile.
- AWS CLI
-
To retrieve configuration profile details
The following
get-configuration-profileexample returns the details of the specified configuration profile.aws appconfig get-configuration-profile \ --application-id339ohji\ --configuration-profile-idur8hx2fOutput:
{ "ApplicationId": "339ohji", "Id": "ur8hx2f", "Name": "Example-Configuration-Profile", "LocationUri": "ssm-parameter://Example-Parameter", "RetrievalRoleArn": "arn:aws:iam::111122223333:role/Example-App-Config-Role" }For more information, see Step 3: Creating a configuration and a configuration profile in the AWS AppConfig User Guide.
-
For API details, see GetConfigurationProfile
in AWS CLI Command Reference.
-
The following code example shows how to use get-configuration.
- AWS CLI
-
To retrieve configuration details
The following
get-configurationexample returns the configuration details of the example application. On subsequent calls to get-configuration use theclient-configuration-versionparameter to only update the configuration of your application if the version has changed. Only updating the configuration when the version has changed avoids excess charges incurred by calling get-configuration.aws appconfig get-configuration \ --application"example-application"\ --environment"Example-Environment"\ --configuration"Example-Configuration-Profile"\ --client-id"test-id"\configuration-output-fileContents of
configuration-output-file:{ "Name": "ExampleApplication", "Id": ExampleID, "Rank": 7 }Output:
{ "ConfigurationVersion": "1", "ContentType": "application/json" }For more information, see Step 6: Receiving the configuration in the AWS AppConfig User Guide.
-
For API details, see GetConfiguration
in AWS CLI Command Reference.
-
The following code example shows how to use get-deployment-strategy.
- AWS CLI
-
To retrieve details of a deployment strategy
The following
get-deployment-strategyexample lists the details of the specified deployment strategy.aws appconfig get-deployment-strategy \ --deployment-strategy-id1225qzkOutput:
{ "Id": "1225qzk", "Name": "Example-Deployment", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "ReplicateTo": "SSM_DOCUMENT" }For more information, see Step 4: Creating a deployment strategy in the AWS AppConfig User Guide.
-
For API details, see GetDeploymentStrategy
in AWS CLI Command Reference.
-
The following code example shows how to use get-deployment.
- AWS CLI
-
To retrieve deployment details
The following
get-deploymentexample lists details of the deployment to the application in the specified environment and deployment.aws appconfig get-deployment \ --application-id339ohji\ --environment-id54j1r29\ --deployment-number1Output:
{ "ApplicationId": "339ohji", "EnvironmentId": "54j1r29", "DeploymentStrategyId": "1225qzk", "ConfigurationProfileId": "ur8hx2f", "DeploymentNumber": 1, "ConfigurationName": "Example-Configuration-Profile", "ConfigurationLocationUri": "ssm-parameter://Example-Parameter", "ConfigurationVersion": "1", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "State": "COMPLETE", "EventLog": [ { "EventType": "DEPLOYMENT_COMPLETED", "TriggeredBy": "APPCONFIG", "Description": "Deployment completed", "OccurredAt": "2021-09-17T21:59:03.888000+00:00" }, { "EventType": "BAKE_TIME_STARTED", "TriggeredBy": "APPCONFIG", "Description": "Deployment bake time started", "OccurredAt": "2021-09-17T21:58:57.722000+00:00" }, { "EventType": "PERCENTAGE_UPDATED", "TriggeredBy": "APPCONFIG", "Description": "Configuration available to 100.00% of clients", "OccurredAt": "2021-09-17T21:55:56.816000+00:00" }, { "EventType": "PERCENTAGE_UPDATED", "TriggeredBy": "APPCONFIG", "Description": "Configuration available to 75.00% of clients", "OccurredAt": "2021-09-17T21:52:56.567000+00:00" }, { "EventType": "PERCENTAGE_UPDATED", "TriggeredBy": "APPCONFIG", "Description": "Configuration available to 50.00% of clients", "OccurredAt": "2021-09-17T21:49:55.737000+00:00" }, { "EventType": "PERCENTAGE_UPDATED", "TriggeredBy": "APPCONFIG", "Description": "Configuration available to 25.00% of clients", "OccurredAt": "2021-09-17T21:46:55.187000+00:00" }, { "EventType": "DEPLOYMENT_STARTED", "TriggeredBy": "USER", "Description": "Deployment started", "OccurredAt": "2021-09-17T21:43:54.205000+00:00" } ], "PercentageComplete": 100.0, "StartedAt": "2021-09-17T21:43:54.205000+00:00", "CompletedAt": "2021-09-17T21:59:03.888000+00:00" }For more information, see Step 5: Deploying a configuration in the AWS AppConfig User Guide.
-
For API details, see GetDeployment
in AWS CLI Command Reference.
-
The following code example shows how to use get-environment.
- AWS CLI
-
To retrieve environment details
The following
get-environmentexample returns the details and state of the specified environment.aws appconfig get-environment \ --application-id339ohji\ --environment-id54j1r29Output:
{ "ApplicationId": "339ohji", "Id": "54j1r29", "Name": "Example-Environment", "State": "ReadyForDeployment" }For more information, see Step 2: Creating an environment in the AWS AppConfig User Guide.
-
For API details, see GetEnvironment
in AWS CLI Command Reference.
-
The following code example shows how to use get-extension-association.
- AWS CLI
-
To get extension association details
The following
get-extension-associationexample displays information about an extension association.aws appconfig get-extension-association \ --regionus-west-2\ --extension-association-ida1b2c3d4Output:
{ "Id": "a1b2c3d4", "ExtensionArn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "ResourceArn": "arn:aws:appconfig:us-west-2:123456789012:application/Finance", "Parameters": { "S3bucket": "FinanceConfigurationBackup" }, "ExtensionVersionNumber": 1 }For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see GetExtensionAssociation
in AWS CLI Command Reference.
-
The following code example shows how to use get-extension.
- AWS CLI
-
To get extension details
The following
get-extensionexample displays information about an extension.aws appconfig get-extension \ --regionus-west-2\ --extension-identifierS3-backup-extensionOutput:
{ "Id": "1A2B3C4D", "Name": "S3-backup-extension", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "Actions": { "PRE_CREATE_HOSTED_CONFIGURATION_VERSION": [ { "Name": "S3backup", "Uri": "arn:aws:lambda:us-west-2:123456789012:function:S3backupfunction", "RoleArn": "arn:aws:iam::123456789012:role/appconfigextensionrole" } ] }, "Parameters": { "S3bucket": { "Required": true } } }For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see GetExtension
in AWS CLI Command Reference.
-
The following code example shows how to use get-hosted-configuration-version.
- AWS CLI
-
To retreive hosted configuration details
The following
get-hosted-configuration-versionexample retrieves the configuration details of the AWS AppConfig hosted configuration.aws appconfig get-hosted-configuration-version \ --application-id339ohji\ --configuration-profile-idur8hx2f\ --version-number1\hosted-configuration-version-outputContents of
hosted-configuration-version-output:{ "Name": "ExampleApplication", "Id": ExampleID, "Rank": 7 }Output:
{ "ApplicationId": "339ohji", "ConfigurationProfileId": "ur8hx2f", "VersionNumber": "1", "ContentType": "application/json" }For more information, see About the AWS AppConfig hosted configuration store in the AWS AppConfig User Guide.
-
For API details, see GetHostedConfigurationVersion
in AWS CLI Command Reference.
-
The following code example shows how to use list-applications.
- AWS CLI
-
To list the available applications
The following
list-applicationsexample lists the available applications in your AWS account.aws appconfig list-applicationsOutput:
{ "Items": [ { "Id": "339ohji", "Name": "test-application", "Description": "An application used for creating an example." }, { "Id": "rwalwu7", "Name": "Test-Application" } ] }For more information, see Step 1: Creating an AWS AppConfig application in the AWS AppConfig User Guide.
-
For API details, see ListApplications
in AWS CLI Command Reference.
-
The following code example shows how to use list-configuration-profiles.
- AWS CLI
-
To list the available configuration profiles
The following
list-configuration-profilesexample lists the available configuration profiles for the specified application.aws appconfig list-configuration-profiles \ --application-id339ohjiOutput:
{ "Items": [ { "ApplicationId": "339ohji", "Id": "ur8hx2f", "Name": "Example-Configuration-Profile", "LocationUri": "ssm-parameter://Example-Parameter" } ] }For more information, see Step 3: Creating a configuration and a configuration profile in the AWS AppConfig User Guide.
-
For API details, see ListConfigurationProfiles
in AWS CLI Command Reference.
-
The following code example shows how to use list-deployment-strategies.
- AWS CLI
-
To list the available deployment strategies
The following
list-deployment-strategiesexample lists the available deployment strategies in your AWS account.aws appconfig list-deployment-strategiesOutput:
{ "Items": [ { "Id": "1225qzk", "Name": "Example-Deployment", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "ReplicateTo": "SSM_DOCUMENT" }, { "Id": "AppConfig.AllAtOnce", "Name": "AppConfig.AllAtOnce", "Description": "Quick", "DeploymentDurationInMinutes": 0, "GrowthType": "LINEAR", "GrowthFactor": 100.0, "FinalBakeTimeInMinutes": 10, "ReplicateTo": "NONE" }, { "Id": "AppConfig.Linear50PercentEvery30Seconds", "Name": "AppConfig.Linear50PercentEvery30Seconds", "Description": "Test/Demo", "DeploymentDurationInMinutes": 1, "GrowthType": "LINEAR", "GrowthFactor": 50.0, "FinalBakeTimeInMinutes": 1, "ReplicateTo": "NONE" }, { "Id": "AppConfig.Canary10Percent20Minutes", "Name": "AppConfig.Canary10Percent20Minutes", "Description": "AWS Recommended", "DeploymentDurationInMinutes": 20, "GrowthType": "EXPONENTIAL", "GrowthFactor": 10.0, "FinalBakeTimeInMinutes": 10, "ReplicateTo": "NONE" } ] }For more information, see Step 4: Creating a deployment strategy in the AWS AppConfig User Guide.
-
For API details, see ListDeploymentStrategies
in AWS CLI Command Reference.
-
The following code example shows how to use list-deployments.
- AWS CLI
-
To list the available deployments
The following
list-deploymentsexample lists the available deployments in your AWS account for the specified application and environment.aws appconfig list-deployments \ --application-id339ohji\ --environment-id54j1r29Output:
{ "Items": [ { "DeploymentNumber": 1, "ConfigurationName": "Example-Configuration-Profile", "ConfigurationVersion": "1", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "State": "COMPLETE", "PercentageComplete": 100.0, "StartedAt": "2021-09-17T21:43:54.205000+00:00", "CompletedAt": "2021-09-17T21:59:03.888000+00:00" } ] }For more information, see Step 5: Deploying a configuration in the AWS AppConfig User Guide.
-
For API details, see ListDeployments
in AWS CLI Command Reference.
-
The following code example shows how to use list-environments.
- AWS CLI
-
To list the available environments
The following
list-environmentsexample lists the available environments in your AWS account for the specified application.aws appconfig list-environments \ --application-id339ohjiOutput:
{ "Items": [ { "ApplicationId": "339ohji", "Id": "54j1r29", "Name": "Example-Environment", "State": "ReadyForDeployment" } ] }For more information, see Step 2: Creating an environment in the AWS AppConfig User Guide.
-
For API details, see ListEnvironments
in AWS CLI Command Reference.
-
The following code example shows how to use list-extension-associations.
- AWS CLI
-
To list all AWS AppConfig extension associations in your AWS account for an AWS Region
The following
list-extension-associationsexample lists all AWS AppConfig extension associations for the current AWS account in a specific AWS Region.aws appconfig list-extension-associations \ --regionus-west-2Output:
{ "Items": [ { "Id": "a1b2c3d4", "ExtensionArn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "ResourceArn": "arn:aws:appconfig:us-west-2:123456789012:application/Finance" } ] }For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see ListExtensionAssociations
in AWS CLI Command Reference.
-
The following code example shows how to use list-extensions.
- AWS CLI
-
To list all AWS AppConfig extensions in your AWS account for an AWS Region
The following
list-extensionsexample lists all AWS AppConfig extensions for the current AWS account in a specific AWS Region. The command returns custom and AWS authored extensions.aws appconfig list-extensions \ --regionus-west-2Output:
{ "Items": [ { "Id": "1A2B3C4D", "Name": "S3-backup-extension", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2:123456789012:extension/1A2B3C4D/1" }, { "Id": "AWS.AppConfig.FeatureFlags", "Name": "AppConfig Feature Flags Helper", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2::extension/AWS.AppConfig.FeatureFlags/1", "Description": "Validates AppConfig feature flag data automatically against a JSON schema that includes structure and constraints. Also transforms feature flag data prior to sending to the client. This extension is automatically associated to configuration profiles with type \"AWS.AppConfig.FeatureFlags\"." }, { "Id": "AWS.AppConfig.JiraIntegration", "Name": "AppConfig integration with Atlassian Jira", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2::extension/AWS.AppConfig.JiraIntegration/1", "Description": "Exports feature flag data from AWS AppConfig into Jira. The lifecycle of each feature flag in AppConfig is tracked in Jira as an individual issue. Customers can see in Jira when flags are updated, turned on or off. Works in conjunction with the AppConfig app in the Atlassian Marketplace and is automatically associated to configuration profiles configured within that app." }, { "Id": "AWS.AppConfig.DeploymentNotificationsToEventBridge", "Name": "AppConfig deployment events to Amazon EventBridge", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2::extension/AWS.AppConfig.DeploymentNotificationsToEventBridge/1", "Description": "Sends events to Amazon EventBridge when a deployment of configuration data in AppConfig is started, completed, or rolled back. Can be associated to the following resources in AppConfig: Application, Environment, Configuration Profile." }, { "Id": "AWS.AppConfig.DeploymentNotificationsToSqs", "Name": "AppConfig deployment events to Amazon SQS", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2::extension/AWS.AppConfig.DeploymentNotificationsToSqs/1", "Description": "Sends messages to the configured Amazon SQS queue when a deployment of configuration data in AppConfig is started, completed, or rolled back. Can be associated to the following resources in AppConfig: Application, Environment, Configuration Profile." }, { "Id": "AWS.AppConfig.DeploymentNotificationsToSns", "Name": "AppConfig deployment events to Amazon SNS", "VersionNumber": 1, "Description": "Sends events to the configured Amazon SNS topic when a deployment of configuration data in AppConfig is started, completed, or rolled back. Can be associated to the following resources in AppConfig: Application, Environment, Configuration Profile." } ] }For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see ListExtensions
in AWS CLI Command Reference.
-
The following code example shows how to use list-hosted-configuration-versions.
- AWS CLI
-
To list the available hosted configuration versions
The following
list-hosted-configuration-versionsexample lists the configurations versions hosted in the AWS AppConfig hosted configuration store for the specified application and configuration profile.aws appconfig list-hosted-configuration-versions \ --application-id339ohji\ --configuration-profile-idur8hx2fOutput:
{ "Items": [ { "ApplicationId": "339ohji", "ConfigurationProfileId": "ur8hx2f", "VersionNumber": 1, "ContentType": "application/json" } ] }For more information, see About the AWS AppConfig hosted configuration store in the AWS AppConfig User Guide.
-
For API details, see ListHostedConfigurationVersions
in AWS CLI Command Reference.
-
The following code example shows how to use list-tags-for-resource.
- AWS CLI
-
To list the tags of an application
The following
list-tags-for-resourceexample lists the tags of a specified application.aws appconfig list-tags-for-resource \ --resource-arnarn:aws:appconfig:us-east-1:682428703967:application/339ohjiOutput:
{ "Tags": { "group1": "1" } }For more information, see Step 1: Creating an AWS AppConfig application in the AWS AppConfig User Guide.
-
For API details, see ListTagsForResource
in AWS CLI Command Reference.
-
The following code example shows how to use start-deployment.
- AWS CLI
-
To start a configuration deployment
The following
start-deploymentexample starts a deployment to the application using the specified environment, deployment strategy, and configuration profile.aws appconfig start-deployment \ --application-id339ohji\ --environment-id54j1r29\ --deployment-strategy-id1225qzk\ --configuration-profile-idur8hx2f\ --configuration-version1Output:
{ "ApplicationId": "339ohji", "EnvironmentId": "54j1r29", "DeploymentStrategyId": "1225qzk", "ConfigurationProfileId": "ur8hx2f", "DeploymentNumber": 1, "ConfigurationName": "Example-Configuration-Profile", "ConfigurationLocationUri": "ssm-parameter://Example-Parameter", "ConfigurationVersion": "1", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "State": "DEPLOYING", "EventLog": [ { "EventType": "DEPLOYMENT_STARTED", "TriggeredBy": "USER", "Description": "Deployment started", "OccurredAt": "2021-09-17T21:43:54.205000+00:00" } ], "PercentageComplete": 0.0, "StartedAt": "2021-09-17T21:43:54.205000+00:00" }For more information, see Step 5: Deploying a configuration in the AWS AppConfig User Guide.
-
For API details, see StartDeployment
in AWS CLI Command Reference.
-
The following code example shows how to use stop-deployment.
- AWS CLI
-
To stop configuration deployment
The following
stop-deploymentexample stops the deployment of an application configuration to the specified environment.aws appconfig stop-deployment \ --application-id339ohji\ --environment-id54j1r29\ --deployment-number2Output:
{ "DeploymentNumber": 0, "DeploymentDurationInMinutes": 0, "GrowthFactor": 0.0, "FinalBakeTimeInMinutes": 0, "PercentageComplete": 0.0 }For more information, see Step 5: Deploying a configuration in the AWS AppConfig User Guide.
-
For API details, see StopDeployment
in AWS CLI Command Reference.
-
The following code example shows how to use tag-resource.
- AWS CLI
-
To tag an application
The following
tag-resourceexample tags an application resource.aws appconfig tag-resource \ --resource-arnarn:aws:appconfig:us-east-1:682428703967:application/339ohji\ --tags '{"group1" : "1"}'This command produces no output.
For more information, see Step 1: Creating an AWS AppConfig application in the AWS AppConfig User Guide.
-
For API details, see TagResource
in AWS CLI Command Reference.
-
The following code example shows how to use untag-resource.
- AWS CLI
-
To remove a tag from an application
The following
untag-resourceexample removes the group1 tag from the specified application.aws appconfig untag-resource \ --resource-arnarn:aws:appconfig:us-east-1:111122223333:application/339ohji\ --tag-keys '["group1"]'This command produces no output.
For more information, see Step 1: Creating an AWS AppConfig application in the AWS AppConfig User Guide.
-
For API details, see UntagResource
in AWS CLI Command Reference.
-
The following code example shows how to use update-application.
- AWS CLI
-
To update an application
The following
update-applicationexample updates the name of the specified application.aws appconfig update-application \ --application-id339ohji\ --name"Example-Application"Output:
{ "Id": "339ohji", "Name": "Example-Application", "Description": "An application used for creating an example." }For more information, see Step 1: Creating an AWS AppConfig application in the AWS AppConfig User Guide.
-
For API details, see UpdateApplication
in AWS CLI Command Reference.
-
The following code example shows how to use update-configuration-profile.
- AWS CLI
-
To update a configuration profile
The following
update-configuration-profileexample updates the description of the specified configuration profile.aws appconfig update-configuration-profile \ --application-id339ohji\ --configuration-profile-idur8hx2f\ --description"Configuration profile used for examples."Output:
{ "ApplicationId": "339ohji", "Id": "ur8hx2f", "Name": "Example-Configuration-Profile", "Description": "Configuration profile used for examples.", "LocationUri": "ssm-parameter://Example-Parameter", "RetrievalRoleArn": "arn:aws:iam::111122223333:role/Example-App-Config-Role" }For more information, see Step 3: Creating a configuration and a configuration profile in the AWS AppConfig User Guide.
-
For API details, see UpdateConfigurationProfile
in AWS CLI Command Reference.
-
The following code example shows how to use update-deployment-strategy.
- AWS CLI
-
To update a deployment strategy
The following
update-deployment-strategyexample updates final bake time to 20 minutes in the specified deployment strategy.aws appconfig update-deployment-strategy \ --deployment-strategy-id1225qzk\ --final-bake-time-in-minutes20Output:
{ "Id": "1225qzk", "Name": "Example-Deployment", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 20, "ReplicateTo": "SSM_DOCUMENT" }For more information, see Step 4: Creating a deployment strategy in the AWS AppConfig User Guide.
-
For API details, see UpdateDeploymentStrategy
in AWS CLI Command Reference.
-
The following code example shows how to use update-environment.
- AWS CLI
-
To update an environment
The following
update-environmentexample updates an environment's description.aws appconfig update-environment \ --application-id339ohji\ --environment-id54j1r29\ --description"An environment for examples."Output:
{ "ApplicationId": "339ohji", "Id": "54j1r29", "Name": "Example-Environment", "Description": "An environment for examples.", "State": "RolledBack" }For more information, see Step 2: Creating an environment in the AWS AppConfig User Guide.
-
For API details, see UpdateEnvironment
in AWS CLI Command Reference.
-
The following code example shows how to use update-extension-association.
- AWS CLI
-
To update an AWS AppConfig extension association
The following
update-extension-associationexample adds a new parameter value to an extension association in AWS AppConfig.aws appconfig update-extension-association \ --regionus-west-2\ --extension-association-ida1b2c3d4\ --parametersS3bucket=FinanceMobileAppOutput:
{ "Id": "a1b2c3d4", "ExtensionArn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "ResourceArn": "arn:aws:appconfig:us-west-2:123456789012:application/Finance", "Parameters": { "S3bucket": "FinanceMobileApp" }, "ExtensionVersionNumber": 1 }For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see UpdateExtensionAssociation
in AWS CLI Command Reference.
-
The following code example shows how to use update-extension.
- AWS CLI
-
To update an AWS AppConfig extension
The following
update-extensionexample adds an additional parameter Key to an extension in AWS AppConfig.aws appconfig update-extension \ --regionus-west-2\ --extension-identifierS3-backup-extension\ --parametersS3bucket={Required=true},CampaignID={Required=false}Output:
{ "Id": "1A2B3C4D", "Name": "S3-backup-extension", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2:123456789012:extension/1A2B3C4D/1", "Actions": { "PRE_CREATE_HOSTED_CONFIGURATION_VERSION": [ { "Name": "S3backup", "Uri": "arn:aws:lambda:us-west-2:123456789012:function:S3backupfunction", "RoleArn": "arn:aws:iam::123456789012:role/appconfigextensionrole" } ] }, "Parameters": { "CampaignID": { "Required": false }, "S3bucket": { "Required": true } } }For more information, see Working with AWS AppConfig extensions in the AWS AppConfig User Guide.
-
For API details, see UpdateExtension
in AWS CLI Command Reference.
-
The following code example shows how to use validate-configuration.
- AWS CLI
-
To validate a configuration
The following
validate-configurationexample uses the validators in a configuration profile to validate a configuration.aws appconfig validate-configuration \ --application-idabc1234\ --configuration-profile-idur8hx2f\ --configuration-version1The command produces no output.
For more information, see Step 3: Creating a configuration and a configuration profile in the AWS AppConfig User Guide.
-
For API details, see ValidateConfiguration
in AWS CLI Command Reference.
-