-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate.yml
More file actions
32 lines (29 loc) · 955 Bytes
/
template.yml
File metadata and controls
32 lines (29 loc) · 955 Bytes
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An example AWS Serverless Application.
Resources:
MyApi:
Type: 'AWS::Serverless::Api'
Properties:
StageName: Prod
BinaryMediaTypes:
- '*/*'
MyFunction:
Type: 'AWS::Serverless::Function'
Properties:
Handler: yuta # Set your handler here
Runtime: go1.x # Specify the Go runtime version
CodeUri: . # Path to your Go code
MemorySize: 128 # Set the desired memory size
Timeout: 10 # Set the function timeout
Events:
ApiEvent:
Type: Api # This connects the Lambda to an API Gateway
Properties:
Path: /myresource
Method: POST # Define the HTTP method (e.g., GET, POST)
Outputs:
ApiEndpoint:
Description: "API Gateway endpoint URL"
Value:
Fn::Sub: "https://${MyApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/myresource"