Similar to How to run certain scripts/commands after stack creation, I’d like to execute one or more functions declared on my stack, just before synth.
For example, I currently have a stack that accumulates data everytime some functions are called, and then needs a final call to apply that data:
const publicApiServiceStack = new DcxServiceStack(TerraformApplication, "publicApi", profile, awsRegion, InfrastructureLayers.API_WEB, {
name: 'publicApi',
openApiDefinitionFilePath: 'C:/_workspaces/test-service-container/docs/open-api.yaml'
});
publicApiServiceStack.addContainerisedService(...);
publicApiServiceStack.addContainerisedService(...);
publicApiServiceStack.finalizeApiGateway();
I’d like that final finalizeApiGateway()
call to remain private and be invoked automatically.
Is there a hook I could use?
I’ve spotted prepareStack()
in v0.9, would that work?
Thanks