Skip to content

Instantly share code, notes, and snippets.

@fl0wo
Created December 12, 2022 20:47
Show Gist options
  • Save fl0wo/2620229ad5c20359226abd713f34d92c to your computer and use it in GitHub Desktop.
Save fl0wo/2620229ad5c20359226abd713f34d92c to your computer and use it in GitHub Desktop.
Integration of register lambda stytch
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