Tutorial: Create a pipeline that uses Amazon AppConfig as a deployment provider - Amazon CodePipeline
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Tutorial: Create a pipeline that uses Amazon AppConfig as a deployment provider

In this tutorial, you configure a pipeline that continuously delivers configuration files using Amazon AppConfig as the deployment action provider in your deployment stage.


Before you begin, you must complete the following:

Step 1: Create your Amazon AppConfig resources

In this section, you create the following resources:

  • An application in Amazon AppConfig is a logical unit of code that provides capabilities for your customers.

  • An environment in Amazon AppConfig is a logical deployment group of AppConfig targets, such as applications in a beta or production environment.

  • A configuration profile is a collection of settings that influence the behavior of your application. The configuration profile enables Amazon AppConfig to access your configuration in its stored location.

  • (Optional) A deployment strategy in Amazon AppConfig defines the behavior of a configuration deployment, such as what percentage of clients should receive the new deployed config at any given time during a deployment.

To create an application, environment, configuration profile, and deployment strategy
  1. Sign in to the Amazon Web Services Management Console.

  2. Use the steps in the following topics to create your resources in Amazon AppConfig.

Step 2: Upload files to your S3 source bucket

In this section, create your configuration file or files. Then zip and push your source files to the bucket that the pipeline uses for your source stage.

To create configuration files
  1. Create a configuration.json file for each configuration in each Region. Include the following contents:

    Hello World!
  2. Use the following steps to zip and upload your configuration files.

To zip and upload source files
  1. Create a .zip file with your files and name the .zip file configuration-files.zip. As an example, your .zip file can use the following structure:

    . └── appconfig-configurations └── MyConfigurations ├── us-east-1 │ └── configuration.json └── us-west-2 └── configuration.json
  2. In the Amazon S3 console for your bucket, choose Upload, and follow the instructions to upload your .zip file.

Step 3: Create your pipeline

In this section, you create a pipeline with the following actions:

  • A source stage with an Amazon S3 action where the source artifacts are the files for your configuration.

  • A deployment stage with an AppConfig deployment action.

To create a pipeline with the wizard
  1. Sign in to the Amazon Web Services Management Console and open the CodePipeline console at http://console.www.amazonaws.cn/codesuite/codepipeline/home.

  2. On the Welcome page, Getting started page, or Pipelines page, choose Create pipeline.

  3. In Step 1: Choose pipeline settings, in Pipeline name, enter MyAppConfigPipeline.

  4. In Pipeline type, choose V1 for the purposes of this tutorial. You can also choose V2; however, note that pipeline types differ in characteristics and price. For more information, see Pipeline types.

  5. In Service role, choose New service role to allow CodePipeline to create a service role in IAM.

  6. Leave the settings under Advanced settings at their defaults, and then choose Next.

  7. In Step 2: Add source stage, in Source provider, choose Amazon S3. In Bucket, choose the name of your S3 source bucket.

    In S3 object key, enter the name of your .zip file: configuration-files.zip.

    Choose Next.

  8. In Step 3: Add build stage, choose Skip build stage, and then accept the warning message by choosing Skip again.

    Choose Next.

  9. In Step 4: Add deploy stage:

    1. In Deploy provider, choose Amazon AppConfig.

    2. In Application, choose the name of the application you created in Amazon AppConfig. The field shows the ID for your application.

    3. In Environment, choose the name of the environment you created in Amazon AppConfig. The field shows the ID for your environment.

    4. In Configuration profile, choose the name of the configuration profile you created in Amazon AppConfig. The field shows the ID for your configuration profile.

    5. In Deployment strategy, choose the name of your deployment strategy. This can be either a deployment strategy you created in AppConfig or one you have chosen from predefined deployment strategies in AppConfig. The field shows the ID for your deployment strategy.

    6. In Input artifact configuration path, enter the file path. Make sure that your input artifact configuration path matches the directory structure in your S3 bucket .zip file. For this example, enter the following file path: appconfig-configurations/MyConfigurations/us-west-2/configuration.json.

    7. Choose Next.

  10. In Step 5: Review, review the information, and then choose Create pipeline.

Step 4: Make a change to any source file and verify deployment

Make a change to your source files and upload the change to your bucket. This triggers your pipeline to run. Verify that your configuration is available by viewing the version.