Michael van Leest
11/19/2021, 10:39 AMError: Cannot find asset at ---/.build/lib/runtime
at new AssetStaging (---/node_modules/@aws-cdk/core/lib/asset-staging.ts:113:13)
at new Asset (---/node_modules/@aws-cdk/aws-s3-assets/lib/asset.ts:68:21)
at AssetCode.bind (---/node_modules/@aws-cdk/aws-lambda/lib/code.ts:183:20)
at new Function2 (---/node_modules/@aws-cdk/aws-lambda/lib/function.ts:338:29)
at SingletonFunction.ensureLambda (---/node_modules/@aws-cdk/aws-lambda/lib/singleton-lambda.ts:93:12)
at new SingletonFunction (---/node_modules/@aws-cdk/aws-lambda/lib/singleton-lambda.ts:32:32)
at new AwsCustomResource (---/node_modules/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts:194:22)
at UserPoolDomain2.get cloudFrontDomainName [as cloudFrontDomainName] (---/node_modules/@aws-cdk/aws-cognito/lib/user-pool-domain.ts:98:39)
at UserPoolDomainTarget2.bind (---/node_modules/@aws-cdk/aws-route53-targets/lib/userpool-domain.ts:12:28)
at new RecordSet (---/node_modules/@aws-cdk/aws-route53/lib/record-set.ts:124:73)
My code looks something like this:
const hostedZone = HostedZone.fromHostedZoneAttributes(this, 'HostedZone', {
hostedZoneId: process.env.SYSTEM_HOSTEDZONE_ID,
zoneName: process.env.SYSTEM_HOSTEDZONE_DOMAIN
});
const userPool = new UserPool(this, 'UserPool', {
userPoolName: scope.stage && '-test-userPool',
selfSignUpEnabled: true,
signInAliases: {
email: true,
},
autoVerify: {
email: true,
},
standardAttributes: {
givenName: {
required: true,
mutable: true,
},
familyName: {
required: true,
mutable: true,
},
},
customAttributes: {
country: new StringAttribute({mutable: true}),
city: new StringAttribute({mutable: true}),
isAdmin: new StringAttribute({mutable: true}),
},
passwordPolicy: {
minLength: 6,
requireLowercase: true,
requireDigits: true,
requireUppercase: false,
requireSymbols: false,
},
accountRecovery: AccountRecovery.EMAIL_ONLY,
removalPolicy: removalPolicy,
});
const userPoolClient = new UserPoolClient(this, "UserPoolClient", {
userPool,
disableOAuth: true,
});
this.auth = new Auth(this, "Auth", {
cognito: {
userPool: userPool,
userPoolClient: userPoolClient,
},
});
const userPoolDomain = new UserPoolDomain(this, "AuthDomain",{
userPool: userPool,
customDomain: {
certificate: Certificate.fromCertificateArn(this, "AuthCert", process.env.SYSTEM_AUTH_CERT),
domainName: process.env.SYSTEM_AUTH_DOMAIN,
}
});
new ARecord(this, 'UserPoolCloudFrontAliasRecord', {
zone: hostedZone,
recordName: process.env.SYSTEM_AUTH_DOMAIN,
target: RecordTarget.fromAlias(new UserPoolDomainTarget(userPoolDomain)),
});
Michael van Leest
11/19/2021, 10:41 AMMichael van Leest
11/19/2021, 1:04 PMFrank
Frank