@jaypie/constructs 1.1.30 → 1.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -141,7 +141,23 @@ function stackTagger(stack, { name } = {}) {
141
141
  class JaypieApiGateway extends constructs.Construct {
142
142
  constructor(scope, id, props) {
143
143
  super(scope, id);
144
- const { certificate = true, handler, host, name, roleTag = cdk.CDK.ROLE.API, zone, } = props;
144
+ const { certificate = true, handler, host: propsHost, name, roleTag = cdk.CDK.ROLE.API, zone: propsZone, } = props;
145
+ // Determine zone from props or environment
146
+ let zone = propsZone;
147
+ if (!zone && process.env.CDK_ENV_API_HOSTED_ZONE) {
148
+ zone = process.env.CDK_ENV_API_HOSTED_ZONE;
149
+ }
150
+ // Determine host from props or environment
151
+ let host = propsHost;
152
+ if (!host) {
153
+ if (process.env.CDK_ENV_API_HOST_NAME) {
154
+ host = process.env.CDK_ENV_API_HOST_NAME;
155
+ }
156
+ else if (process.env.CDK_ENV_API_SUBDOMAIN &&
157
+ process.env.CDK_ENV_API_HOSTED_ZONE) {
158
+ host = cdk.mergeDomain(process.env.CDK_ENV_API_SUBDOMAIN, process.env.CDK_ENV_API_HOSTED_ZONE);
159
+ }
160
+ }
145
161
  const apiGatewayName = name || constructEnvName("ApiGateway");
146
162
  const certificateName = constructEnvName("Certificate");
147
163
  const apiDomainName = constructEnvName("ApiDomainName");