- API Gateway
- HTTP API
- CloudFormation
- Cognito
- User Pool
- DynamoDB
- IAM
- Lambda
- S3 (implicit use by SAM)
Remove either the postfixes .dev
or .prod
for different environment.
Create an IAM Role for Lambda functions, attaching the AmazonDynamoDBFullAccess and AWSLambdaBasicExecutionRole AWS managed policies to the role, and put the role's ARN in this file as a YAML anchor.
Create a Cognito User Pool and its app client, remember to not generate an app client secret, then follow the comments in template.yaml
.
Remove either the postfixes .dev
or .prod
for different environment.
Edit stack_name
, or change it in the later steps when deploying using the SAM CLI --guided
option.
sam build
sam deploy --guided
In the AWS API Gateway console, update the CORS for the API with the following:
- Access-Control-Allow-Origin: *
- Access-Control-Allow-Headers: authorization, content-type
- Access-Control-Allow-Methods: *