-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Description
The user-pool-domain lambda is generating invalid configuration.json which contain a busted domain name like below
{
domainName: "2b7f08a6.auth.async () => {
if (runtimeConfig.region === void 0) {
throw new Error("Region is missing from runtimeConfig");
}
const region = runtimeConfig.region;
if (typeof region === "string") {
return region;
}
return region();
}.amazoncognito.com",
}I believe the faulting line is this one:
cdk-constructs/packages/cdk-cloudfront-authorization/src/lambdas/user-pool-domain/index.ts
Line 31 in 60f1d89
| return userPool.CustomDomain ?? `${userPool.Domain}.auth.${COGNITO_CLIENT.config.region}.amazoncognito.com`; |
the COGNITO_CLIENT.config.region which is a CognitoIdentityProviderClientResolvedConfig is able to return either a string, or a Provider<string>. The latter returns the promise of a string.
I'm not sure of the motivation behind using the resolved config, but seeing as we're feeding it from environment variables I suggest accessing that instead, because handling the choice of a string or a promise seems like unnecessary effort.
Metadata
Metadata
Assignees
Labels
No labels