CDK split API Gateway stack into 2 small stacks

后端 未结 3 2113
情话喂你
情话喂你 2021-02-09 07:27

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

3条回答
  •  走了就别回头了
    2021-02-09 07:36

    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,
    });
    

提交回复
热议问题