Created
April 10, 2022 22:57
-
-
Save louislatreille/122f0e4c2aaadc15c15d62e471d13813 to your computer and use it in GitHub Desktop.
Serverless Streamlined - cognitoUserPool.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
import { varToString } from "./utilities"; | |
export const createUserPool = () => { | |
const identityPoolRole = { | |
Type: "AWS::IAM::Role", | |
Properties: { | |
... | |
}, | |
}; | |
const userPool = { | |
Type: "AWS::Cognito::UserPool", | |
Properties: { | |
... | |
}, | |
}; | |
const client = { | |
Type: "AWS::Cognito::UserPoolClient", | |
Properties: { | |
... | |
}, | |
}; | |
const identityPool = { | |
Type: "AWS::Cognito::IdentityPool", | |
Properties: { | |
... | |
}, | |
}; | |
const identityPoolRoleAttachement = { | |
Type: "AWS::Cognito::IdentityPoolRoleAttachment", | |
Properties: { | |
... | |
}, | |
}; | |
return { | |
resources: { | |
userPool, | |
client, | |
identityPool, | |
identityPoolRole, | |
identityPoolRoleAttachement, | |
}, | |
userPoolId: { Ref: varToString({ userPool }) }, | |
userPoolArn: { "Fn::GetAtt": [varToString({ userPool }), "Arn"] }, | |
clientId: { Ref: varToString({ client: client }) }, | |
identityPoolId: { Ref: varToString({ identityPool }) }, | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment