mirror of
https://github.com/alexgo-io/peggedassets-server.git
synced 2026-01-12 22:43:29 +08:00
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
Resources:
|
|
# DynamoDB
|
|
DynamoTable:
|
|
Type: AWS::DynamoDB::Table
|
|
DeletionPolicy: Retain # Make sure the tables can't be deleted by CloudFormation/Serverless
|
|
Properties:
|
|
TableName: ${self:custom.tableName}
|
|
AttributeDefinitions:
|
|
- AttributeName: PK
|
|
AttributeType: S
|
|
- AttributeName: SK
|
|
AttributeType: N
|
|
KeySchema:
|
|
- AttributeName: PK
|
|
KeyType: HASH
|
|
- AttributeName: SK
|
|
KeyType: RANGE
|
|
# Set the capacity to auto-scale
|
|
BillingMode: PAY_PER_REQUEST
|
|
# CORS for api gateway errors
|
|
GatewayResponseDefault4XX:
|
|
Type: 'AWS::ApiGateway::GatewayResponse'
|
|
Properties:
|
|
ResponseParameters:
|
|
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
|
|
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
|
|
ResponseType: DEFAULT_4XX
|
|
RestApiId:
|
|
Ref: 'ApiGatewayRestApi'
|
|
GatewayResponseDefault5XX:
|
|
Type: 'AWS::ApiGateway::GatewayResponse'
|
|
Properties:
|
|
ResponseParameters:
|
|
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
|
|
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
|
|
ResponseType: DEFAULT_5XX
|
|
RestApiId:
|
|
Ref: 'ApiGatewayRestApi' |