Get started with AWS AppConfig on LocalStack

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:

  1. Create an AWS AppConfig application via the awslocal CLI:

    $ awslocal appconfig create-application \
            --name <APPLICATION_NAME> \
            --description <APPLICATION_DESCRIPTION>
    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:
            "Id": "<APPLICATION_ID>",
            "Name": "<APPLICATION_NAME>",
            "Description": "<APPLICATION_DESCRIPTION>",

  2. Create an AppConfig environment using the create-environment command:

    $ awslocal appconfig create-environment \
            --application-id <APPLICATION_ID> \
            --name <ENVIRONMENT_NAME> \
            --description <ENVIRONMENT_DESCRIPTION>
    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:
            "ApplicationId": "<APPLICATION_ID>",
            "Id": "<ENVIRONMENT_ID>",
            "Name": "<ENVIRONMENT_NAME>",
            "Description": "<ENVIRONMENT_DESCRIPTION>",
            "State": "READY_FOR_DEPLOYMENT"

  3. Create an AppConfig feature flag configuration profile using the create-configuration-profile command:

    $ awslocal appconfig create-configuration-profile \
            --application-id <APPLICATION_ID> \
            --name <CONFIGURATION_PROFILE_NAME> \
            --location-uri hosted \
            --type AWS.AppConfig.FeatureFlags
    You can further create your feature flag configuration data in JSON format by conforming to the AWS.AppConfig.FeatureFlags JSON schema. Follow the schema documentation to use the create-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" \

  4. 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>,

  5. 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.

Last modified December 1, 2022: LocalStack Beta Docs (#337) (28576f899)