Deploy AWS CDK using AppConfig Deployment

71 Views Asked by At

I want to deploy a stack using a deployment hosted in AppConfig, but I can't find a method in the documentation that allows to read from it. I searched on: CfnApplication, CfnEnvironment, CfnConfigurationProfile, CfnDeploymentStrategy or CfnDeployment.

Example of application:

// The goal is to retrieve data stored in AppConfig and return it as `config`
const { config } = new ReadEnvironmentFromAppConfig(app, 'conf')

// Then, use it as argument to deploy other stacks
config.clients.forEach(conf => new MyStack(app, `conf-${conf.name}`, { conf })

Is there any way to do something like:

// ./lib/readEnvironmentFromAppConfig

// I have this already
const deployment = new CfnDeployment(/*...*/)

// This is what I want
const config = deployment.fromLastDeployment(/*...*/)

Thanks,

1

There are 1 best solutions below

0
Chaurasiya On

You can read API provided by AWS App Config APIs.

Below are the JAVA API might be useful for your use case. Look the above docs for other programming languages.

There is a library(AppConfigClient) which is used to interact with AWS AppConfig.

More Links - https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/appconfigdata/package-summary.html

Note:- You have to use AWS Lambda or Some Computing Engine to run these API.