Guy Shechter
12/29/2021, 6:05 AMIt seems you are configuring custom domains for you URL. And SST is not able to find the hosted zone "<http://qa.mydomain.com|qa.mydomain.com>" in your AWS Route 53 account. Please double check and make sure the zone exists, or pass in a different zone.
thoughts?Derek Kershner
12/29/2021, 4:59 PMaddDependency for this purposeDerek Kershner
12/29/2021, 4:59 PMGuy Shechter
12/29/2021, 5:00 PMGuy Shechter
12/29/2021, 5:01 PMDerek Kershner
12/29/2021, 5:04 PMDerek Kershner
12/30/2021, 3:58 PMJay
Frank
Frank
Frank
Api construct calls HostedZone.fromLookup(), which makes an AWS SDK call to Route 53 to look up the hosted zone at build time. Since the zone hasn’t been deployed, hence the error. https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-route53.HostedZone.html#static-fromwbrlookupscope-id-queryFrank
customDomain?Guy Shechter
01/04/2022, 1:24 AMFrank
customDomain definition? I will give it a try on my end. (Most likely need to push out an update for this)Guy Shechter
01/04/2022, 1:25 AMGuy Shechter
01/04/2022, 4:33 AMPlatformStack.js
this.hostedZone = new route53.HostedZone(this, 'route53zone', {
zoneName: ( this.scope.stage === 'prod' )
? process.env.DOMAIN_NAME
: `${ this.scope.stage }.${ process.env.DOMAIN_NAME }`,
});
And in the ApiStack.js
const { hostedZone } = props;
this.api = new sst.Api(this, 'api', {
customDomain: {
domainName: `api.${ hostedZone.zoneName }`,
hostedZone: hostedZone.zoneName,
path: 'v1',
},
....
}
Let me know if you need anything else @FrankFrank
const { hostedZone } = props;
this.api = new sst.Api(this, 'api', {
customDomain: {
domainName: `api.${ hostedZone.zoneName }`,
hostedZone: hostedZone,
path: 'v1',
},
....
}
So pass in hostedZone directly into customDomain.hostedZone.Frank
customDomain.hostedZone takes both a string or a Route53.HostedZone construct. The latter is meant to handle this exact case.Frank
Guy Shechter
01/25/2022, 2:37 AMGuy Shechter
01/25/2022, 2:39 AMconst vpcStack = new VpcStack(app, "vpc");
const dbStack = new DatabaseStack(app, "db", {
vpc: vpcStack.vpc
});
I initially had dbStack look up the vpc by name, which also failed at build time.. passing in the reference ec2.Vpc fixed it.Derek Kershner
01/25/2022, 3:37 PMfrom constructs decouples them, and they will operate independently.