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