1 | service: ${file(APIDeploymentConfig.json):SERVICE_NAME, "my-api-service"}
|
2 |
|
3 | plugins:
|
4 | - serverless-api-compression
|
5 |
|
6 | custom:
|
7 | NODE_ENV:
|
8 | dev: development
|
9 | prod: production
|
10 | contentEncoding:
|
11 | contentCompression: 100 # Minimum body size required for compression in bytes
|
12 |
|
13 | provider:
|
14 | name: aws
|
15 | runtime: nodejs8.10
|
16 | stage: ${opt:stage, "dev"}
|
17 | region: ${file(APIDeploymentConfig.json):AWS_REGION, "us-east-1"}
|
18 | apiName: ${self:service}-api
|
19 | profile: ${opt:profile}
|
20 | memorySize: 512
|
21 | timeout: 30
|
22 | logRetentionInDays: 14
|
23 | environment:
|
24 | NODE_ENV: ${self:custom.NODE_ENV.${opt:stage, self:provider.stage}}
|
25 | # Override this value if you want to use a custom domain name
|
26 | API_URL_BASE: { "Fn::Join" : ["", [ "https://", { "Ref" : "ApiGatewayRestApi" }, ".execute-api.${self:provider.region}.amazonaws.com/${self:provider.stage}" ] ] }
|
27 | # Uncomment if you want S3 support for file storage
|
28 | # FILE_STORAGE_SERVICE_PROVIDER: "S3FileService"
|
29 | # S3_FILE_SERVICE_BUCKET_NAME: "my.bucket.name"
|
30 |
|
31 | # Uncomment if you want DynamoDB support for key-value storage
|
32 | # KV_STORAGE_SERVICE_PROVIDER: "DynamoDBKVService"
|
33 | # DYNAMO_KV_STORAGE_TABLE_NAME: ${self:service}-kv-storage
|
34 | # iamRoleStatements:
|
35 | # - Effect: "Allow"
|
36 | # Action:
|
37 | # - dynamodb:DeleteItem
|
38 | # - dynamodb:GetItem
|
39 | # - dynamodb:PutItem
|
40 | # - dynamodb:UpdateItem
|
41 | # - dynamodb:Query
|
42 | # Resource:
|
43 | # Fn::GetAtt:
|
44 | # - kvStorageTable
|
45 | # - Arn
|
46 |
|
47 | package:
|
48 | exclude:
|
49 | - readme.md
|
50 | - node_modules/@types/**
|
51 | - .git
|
52 | - .secrets*
|
53 | - "*.ts"
|
54 | - "*.js.map"
|
55 |
|
56 | functions:
|
57 | API:
|
58 | handler: ${file(APIDeploymentConfig.json):API_HANDLER, "APIHandler.handler"}
|
59 | events:
|
60 | - http: ANY /
|
61 | - http: "ANY {proxy+}"
|
62 |
|
63 | # Uncomment if you want DynamoDB support for key-value storage
|
64 | #resources:
|
65 | # Resources:
|
66 | # kvStorageTable:
|
67 | # Type: AWS::DynamoDB::Table
|
68 | # DeletionPolicy: Retain
|
69 | # Properties:
|
70 | # TableName: ${self:provider.environment.DYNAMO_KV_STORAGE_TABLE_NAME}
|
71 | # AttributeDefinitions:
|
72 | # - AttributeName: namespace
|
73 | # AttributeType: S
|
74 | # - AttributeName: key
|
75 | # AttributeType: S
|
76 | # KeySchema:
|
77 | # - AttributeName: namespace
|
78 | # KeyType: HASH
|
79 | # - AttributeName: key
|
80 | # KeyType: RANGE
|
81 | # ProvisionedThroughput:
|
82 | # ReadCapacityUnits: 5
|
83 | # WriteCapacityUnits: 5
|
84 | # SSESpecification:
|
85 | # SSEEnabled: true
|
86 | # TimeToLiveSpecification:
|
87 | # AttributeName: expires
|
88 | # Enabled: true |
\ | No newline at end of file |