-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
51 lines (48 loc) · 1.41 KB
/
template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Function and API for scheduling events
Globals:
Function:
Environment:
Variables:
dynamoDbTable: test_devices_table
s3Bucket: project-intro-bucket-2
awsRegion: us-west-2
secretName: faketoken
Resources:
ScheduleFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: schedule/
Handler: app.lambda_handler
Runtime: python3.9
Timeout: 6
Events:
Schedule:
Type: Api
Properties:
Path: /schedule
Method: POST
Policies:
- AmazonDynamoDBFullAccess
- Statement:
- Sid: SSMDescribeParametersPolicy
Effect: Allow
Action:
- secretsmanager:GetSecretValue
Resource: '*'
- Sid: S3PUTOBJECT
Effect: Allow
Action:
- s3:PutObject
Resource: '*'
Outputs:
ScheduleApi:
Description: "API Gateway endpoint URL for dev stage for Schedule function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/schedule/"
ScheduleFunction:
Description: "Schedule Lambda Function ARN"
Value: !GetAtt ScheduleFunction.Arn
ScheduleFunctionIamRole:
Description: "Implicit IAM Role created for Schedule function"
Value: !GetAtt ScheduleFunctionRole.Arn