-
Notifications
You must be signed in to change notification settings - Fork 21
/
serverless.yml
68 lines (63 loc) · 1.7 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
56
57
58
59
60
61
62
63
64
65
66
67
68
service: cmr-stac-api
provider:
name: aws
runtime: nodejs18.x
region: us-east-1
iam:
role: cmrStacRole
vpc:
securityGroupIds:
- ${cf:${opt:stage}.servicesSecurityGroupId}
subnetIds: !Split [",", "${cf:${opt:stage}.subnetIds}"]
environment:
CMR_URL: ${param:cmr-url, "https://cmr${self:custom.stagePrefix.${opt:stage}}.earthdata.nasa.gov"}
CMR_LB_URL: ${param:cmr-lb-url, "http://${cf:${opt:stage}.servicesDnsName}"}
GRAPHQL_URL: ${param:graphql-url, "https://graphql${self:custom.stagePrefix.${opt:stage}}.earthdata.nasa.gov/api"}
STAC_VERSION: "1.0.0"
PAGE_SIZE: "100"
LOG_LEVEL: INFO
custom:
stagePrefix:
sit: ".sit"
uat: ".uat"
prod: ""
logSubscription:
enabled: true
destinationArn: ${cf:${opt:stage}.logForwardingArn}
docsBucket: cmr-stac-static-bucket-${opt:stage}
s3Sync:
- bucketName: cmr-stac-static-bucket-${opt:stage}
localDir: docs/index
bucketPrefix: docs/
functions:
stac:
handler: src/lambda.handler
timeout: 180
events:
- alb:
listenerArn: ${cf:${opt:stage}.servicesLbListenerArn}
priority: 500
conditions:
path: "/stac*"
method:
- GET
- POST
- OPTIONS
- alb:
listenerArn: ${cf:${opt:stage}.servicesLbListenerArn}
priority: 501
conditions:
path: "/cloudstac*"
method:
- GET
- POST
- OPTIONS
resources:
# IAM
- ${file(resources/iam-cmrStacRole.yml)}
# S3
- ${file(resources/s3-docsBucket.yml)}
plugins:
- serverless-plugin-typescript
- serverless-s3-sync
- serverless-plugin-log-subscription