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 réponse
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
répondu il y a 3 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions