Created
December 12, 2022 21:12
-
-
Save fl0wo/25f1d5b208bf3ca4b0ddb2c63a513c13 to your computer and use it in GitHub Desktop.
Login stytch integration ts
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 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