AppConfig
3 minute read
AWS AppConfig offers centralized management of configuration data and the ability to create, manage, and deploy configuration changes separately. It allows you to avoid deploying the service repeatedly for smaller changes, enables controlled deployments to applications and includes built-in validation checks & monitoring. With AppConfig, the configuration management is safe and secure, with automated monitoring and validation alongside roll-back capabilities.
LocalStack provides AppConfig support via our Pro offering. You can use the AppConfig API to configure and set up an application, create an AppConfig environment, build a configuration profile, and detail your deployment strategy. The supported APIs are available over our feature coverage page.
Getting started
In this getting started guide, you’ll learn how to make basic usage of AppConfig over LocalStack. This guide is intended for users who wish to get more acquainted with AppConfig, and assumes you have basic knowledge of the AWS CLI (and our awslocal
wrapper script). First, start your LocalStack instance using your preferred method, then run the following commands:
Create an AWS AppConfig application via the
awslocal
CLI:In AppConfig, an application is a folder/directory that contains the configuration data for your specific application. The output of this command will be the application ID, which you will need for the next step:$ awslocal appconfig create-application \ --name <APPLICATION_NAME> \ --description <APPLICATION_DESCRIPTION>
{ "Id": "<APPLICATION_ID>", "Name": "<APPLICATION_NAME>", "Description": "<APPLICATION_DESCRIPTION>", }
Create an AppConfig environment using the
create-environment
command:An environment consists of the deployment group of your AppConfig applications. The output of this command will be the environment ID, which you will need for the next step:$ awslocal appconfig create-environment \ --application-id <APPLICATION_ID> \ --name <ENVIRONMENT_NAME> \ --description <ENVIRONMENT_DESCRIPTION>
{ "ApplicationId": "<APPLICATION_ID>", "Id": "<ENVIRONMENT_ID>", "Name": "<ENVIRONMENT_NAME>", "Description": "<ENVIRONMENT_DESCRIPTION>", "State": "READY_FOR_DEPLOYMENT" }
Create an AppConfig feature flag configuration profile using the
create-configuration-profile
command:You can further create your feature flag configuration data in JSON format by conforming to the$ awslocal appconfig create-configuration-profile \ --application-id <APPLICATION_ID> \ --name <CONFIGURATION_PROFILE_NAME> \ --location-uri hosted \ --type AWS.AppConfig.FeatureFlags
AWS.AppConfig.FeatureFlags
JSON schema. Follow the schema documentation to use thecreate-hosted-configuration-version
command to save your feature flag configuration data to AppConfig:$ awslocal appconfig create-hosted-configuration-version \ --application-id <APPLICATION_ID> \ --configuration-profile-id <CONFIGURATION_PROFILE_ID> \ --content-type "application/json" \ --content <FEATURE_FLAG_CONFIGURATION_DATA_FILE>
Create an AppConfig deployment strategy using the
create-deployment-strategy
command:$ awslocal appconfig create-deployment-strategy \ --name <DEPLOYMENT_STRATEGY_NAME> \ --description <DEPLOYMENT_STRATEGY_DESCRIPTION> \ --deployment-duration-in-minutes <DEPLOYMENT_DURATION_IN_MINUTES> \ --growth-factor <GROWTH_FACTOR> \
For more information on deployment strategies, see the AppConfig documentation. The above command will return the following information:
{ "Id": "<DEPLOYMENT_STRATEGY_ID>", "Name": "<DEPLOYMENT_STRATEGY_NAME>", "Description": "<DEPLOYMENT_STRATEGY_DESCRIPTION>", "DeploymentDurationInMinutes": <DEPLOYMENT_DURATION_IN_MINUTES>, "GrowthFactor": <GROWTH_FACTOR>, }
Deploy the configuration using the
start-deployment
command:$ awslocal appconfig start-deployment \ --application-id <APPLICATION_ID> \ --environment-id <ENVIRONMENT_ID> \ --deployment-strategy-id <DEPLOYMENT_STRATEGY_ID> \ --configuration-profile-id <CONFIGURATION_PROFILE_ID> \ --configuration-version <CONFIGURATION_VERSION> --description <DEPLOYMENT_DESCRIPTION>
Navigate to the AppConfig extensions and services that integrate with AppConfig in the official documentation to learn more about how to inject logic in your configuration, and use AppConfig with other AWS services respectively.