Skip to content

Instantly share code, notes, and snippets.

@rajanpanchal
Created August 4, 2020 02:50
Show Gist options
  • Save rajanpanchal/75957770229cf61b58da4dd36de7aca8 to your computer and use it in GitHub Desktop.
Save rajanpanchal/75957770229cf61b58da4dd36de7aca8 to your computer and use it in GitHub Desktop.
Markdium-Sign Up
ApiGatewaySignupApi:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
Auth:
UsagePlan:
CreateUsagePlan: PER_API
Description: Usage plan for this API
Quota:
Limit: 500
Period: MONTH
Throttle:
BurstLimit: 100
RateLimit: 50
SignupFunction:
Type: AWS::Serverless::Function
Properties:
Environment:
Variables:
userTable: !Ref myDynamoDBTable
keyid: !Ref KmsKey
CodeUri: Lambda/
Handler: signup.lambda_handler
Runtime: python3.8
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref myDynamoDBTable
- KMSEncryptPolicy:
KeyId: !Ref KmsKey
- KMSDecryptPolicy:
KeyId: !Ref KmsKey
Events:
getCounter:
Type: Api
Properties:
Path: /signup
Method: POST
RestApiId: !Ref ApiGatewaySignupApi
ApiGatewayLoginApi:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
Auth:
UsagePlan:
CreateUsagePlan: PER_API
Description: Usage plan for this API
Quota:
Limit: 500
Period: MONTH
Throttle:
BurstLimit: 100
RateLimit: 50
LoginFunction:
Type: AWS::Serverless::Function
Properties:
Environment:
Variables:
userTable: !Ref myDynamoDBTable
keyid: !Ref KmsKey
CodeUri: Lambda/
Handler: login.lambda_handler
Runtime: python3.8
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref myDynamoDBTable
- KMSEncryptPolicy:
KeyId: !Ref KmsKey
- KMSDecryptPolicy:
KeyId: !Ref KmsKey
Events:
getCounter:
Type: Api
Properties:
Path: /login
Method: POST
RestApiId: !Ref ApiGatewayLoginApi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment