forked from aws-samples/serverless-test-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
44 lines (41 loc) · 1.25 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Timeout: 60
Resources:
ListBucketsFunction:
Type: AWS::Serverless::Function
Properties:
Handler: com.example.App::handleRequest
Runtime: java11
Tracing: Active
Architectures:
- x86_64
MemorySize: 512
Environment:
Variables:
JAVA_TOOL_OPTIONS: -XX:+TieredCompilation -XX:TieredStopAtLevel=1
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- s3:ListAllMyBuckets
Resource: 'arn:aws:s3:::*'
Events:
HelloWorld:
Type: Api
Properties:
Path: /listBuckets
Method: get
Outputs:
ListBucketsApi:
Description: "API Gateway endpoint URL for Prod stage for Listing S3 Buckets function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/listBuckets/"
ListBucketsFunction:
Description: "List S3 Buckets Lambda Function ARN"
Value: !GetAtt ListBucketsFunction.Arn
ListBucketsFunctionIamRole:
Description: "Implicit IAM Role created for List Buckets function"
Value: !GetAtt ListBucketsFunction.Arn