-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yml
55 lines (48 loc) · 1.61 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This file created with help from
# https://github.com/developmentseed/cogeo-mosaic-tiler/blob/master/serverless.yml
# https://serverless-stack.com/chapters/configure-dynamodb-in-serverless.html
service: landsat-mosaic-latest
custom:
# resources/dynamodb-table.yml relies on these keys
tableName: ${opt:table-name, 'landsat-mosaic-latest'}
cloudlessTableName: ${opt:cloudless-table-name, 'landsat-mosaic-latest-cloudless'}
provider:
name: aws
runtime: python3.7
stage: ${opt:stage, 'production'}
region: ${opt:region, 'us-west-2'}
# Add other buckets here if needed
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:HeadObject"
Resource:
- "arn:aws:s3:::*"
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
# Restrict our IAM role permissions to
# the specific table for the stage
Resource:
- "Fn::GetAtt": [ LandsatMosaicLatestTable, Arn ]
- "Fn::GetAtt": [ LandsatMosaicLatestCloudlessTable, Arn ]
package:
artifact: package.zip
functions:
dispatcher:
handler: landsat_mosaic_latest.handlers.lambda_handler.lambda_handler
memorySize: 1024
timeout: 30
environment:
MAX_CLOUD_COVER: ${opt:max-cloud-cover, '5'}
DYNAMODB_TABLE_NAME: ${self:custom.tableName}
DYNAMODB_CLOUDLESS_TABLE_NAME: ${self:custom.cloudlessTableName}
PYTHONWARNINGS: ignore
events:
- sns: arn:aws:sns:us-west-2:274514004127:NewSceneHTML
# Create our resources with separate CloudFormation templates
resources:
# DynamoDB
- ${file(resources/dynamodb-table.yml)}