Skip to content

Instantly share code, notes, and snippets.

@fl0wo
Created December 12, 2022 21:12
Show Gist options
  • Save fl0wo/25f1d5b208bf3ca4b0ddb2c63a513c13 to your computer and use it in GitHub Desktop.
Save fl0wo/25f1d5b208bf3ca4b0ddb2c63a513c13 to your computer and use it in GitHub Desktop.
Login stytch integration ts
export const getStytchLoginLambdaIntegration = (
stack: Construct,
id:string,
options:InfrastructureOptions) => {
const loginFunction = new NodejsFunction(stack, id, {
architecture: Architecture.ARM_64,
entry: `${__dirname}/login.ts`,
logRetention: RetentionDays.ONE_WEEK,
timeout: Duration.minutes(1),
memorySize: 256,
initialPolicy: [
new PolicyStatement({
actions: ["ssm:GetParameter","ssm:PutParameter"],
resources: ["*"],
}),
],
environment:{
PARAMETER_STORE_PREFIX:options.uniquePrefix,
ENV: options.environ
}
});
options.userDb.grantReadWriteData(loginFunction);
return loginFunction;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment