Deploy AWS CDK using AppConfig Deployment

0

Hello,

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

Example of application:

// Deployment hosted on AppConfig, from `CfnApplication` to `CfnDeployment` OK
const { config } = new ReadEnvironmentFromAppConfig(app, 'conf')

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 Answer
0

You cannot directly fetch runtime configurations from an AppConfig deployment as part of your infrastructure code. The CDK is used for defining and provisioning cloud infrastructure, not for runtime operations like retrieving the latest AppConfig deployment configurations. For dynamic configuration retrieval at runtime, you would typically use the AWS SDK in your application code, which is separate from your infrastructure provisioning code.

Using SDK you can get the latest Deployment Configuration: getDeployment

Resources:

profile picture
EXPERT
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions