Created
December 12, 2022 20:47
-
-
Save fl0wo/2620229ad5c20359226abd713f34d92c to your computer and use it in GitHub Desktop.
Integration of register lambda stytch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getStytchRegisterLambdaIntegration = ( | |
stack: Construct, | |
id:string, | |
options:InfrastructureOptions) => { | |
const registerFunction = new NodejsFunction(stack, id, { | |
architecture: Architecture.ARM_64, | |
entry: `${__dirname}/register.ts`, | |
logRetention: RetentionDays.ONE_WEEK, | |
timeout: Duration.minutes(1), | |
memorySize: 256, | |
initialPolicy: [ | |
new PolicyStatement({ | |
actions: ["ssm:GetParameter","ssm:PutParameter"], | |
resources: ["*"], | |
}), | |
], | |
environment:{ | |
ENV: options.environ | |
} | |
}); | |
options.userDb.grantReadWriteData(registerFunction); | |
return registerFunction; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment