I\'m trying to create a CDK stack in order to create API Gateway. Everything working as excepted if I create the stack in "small pieces" (comment part of the resources
Just pass the data using properties.
This requires to define public properties on the stack that provides output variables, and create an interface that extends StackProperties
with the required properties to pass in.
The result may look like this:
const domain = new DomainStack(app, 'domain', {
env: env,
domainName: domainName,
hostedZoneId: hostedZoneId
});
new WebsiteStack(app, 'website', {
env: env,
domainName: domainName,
certificate: domain.certificate,
hostedZone: domain.hostedZone,
});