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,

Camilo
preguntada hace 3 meses123 visualizaciones
1 Respuesta
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
EXPERTO
respondido hace 3 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas