-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsam.yml
53 lines (49 loc) · 2.09 KB
/
sam.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Cerbos server
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 5
Parameters:
ArchitectureParameter:
Type: String
Default: x86_64
AllowedValues:
- x86_64
- arm64
Description: "AWS Lambda function architecture: x86_64 or arm64."
Resources:
CerbosServerFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
Architectures:
- { Ref: ArchitectureParameter }
PackageType: Image
ImageUri: 414605243264.dkr.ecr.us-east-2.amazonaws.com/lambda:latest
MemorySize: 1024
Events:
CatchAll:
Type: HttpApi # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /{proxy+}
Method: ANY
Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
Variables:
BUCKET_URL: ""
BUCKET_PREFIX: ""
CERBOS_LOG_LEVEL: INFO
XDG_CACHE_HOME: /tmp
Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
# Find out more about other implicit resources you can reference within SAM
# https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
CerbosServerFunctionAPI:
Description: "API Gateway endpoint URL"
Value: !Sub "https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com"
CerbosServerFunction:
Description: "Cerbos Server Function ARN"
Value: !GetAtt CerbosServerFunction.Arn
HelloWorldFunctionIamRole:
Description: "IAM Role created for the Cerbos Server function"
Value: !GetAtt CerbosServerFunctionRole.Arn