-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
66 lines (57 loc) · 1.48 KB
/
serverless.yml
File metadata and controls
66 lines (57 loc) · 1.48 KB
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
service: node-template-lambda
provider:
name: aws
runtime: nodejs18.x
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'us-east-2'}
memorySize: 1024
timeout: 600
iam:
role:
statements:
- Effect: Allow
Action:
- secretsmanager:GetSecretValue
Resource: arn:aws:secretsmanager:${self:provider.region}:*:secret:${self:custom.secretName}-*
vpc:
securityGroupIds:
- ${env:SECURITY_GROUP_ID, ''}
subnetIds:
- ${env:SUBNET_ID_1, ''}
- ${env:SUBNET_ID_2, ''}
- ${env:SUBNET_ID_3, ''}
functions:
main:
handler: main.handler
events:
- http:
path: process-data
method: post
environment:
DB_PROXY_ENDPOINT: ${env:DB_PROXY_ENDPOINT, ''}
DB_PORT: ${env:DB_PORT, ''}
DB_NAME: ${env:DB_NAME, ''}
DB_USERNAME: ${env:DB_USERNAME, ''}
DB_PASSWORD: ${env:DB_PASSWORD, ''}
TEST_ENV: ${env:TEST_ENV, ''}
plugins:
- serverless-dotenv-plugin
custom:
secretName: ${self:service}-${self:provider.stage}-secrets
dotenv:
path: .env
package:
individually: true
exclude:
- .git/**
- .gitignore
- .env
- README.md
resources:
Resources:
SecretsManagerSecret:
Type: AWS::SecretsManager::Secret
Properties:
Name: ${self:custom.secretName}
Description: Secrets for ${self:service} Lambda function
SecretString: '{"DB_PROXY_ENDPOINT":"","DB_PORT":"","DB_NAME":"","DB_USERNAME":"","DB_PASSWORD":""}'