-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathfunctionStack.yaml
48 lines (48 loc) · 1.16 KB
/
functionStack.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
AWSTemplateFormatVersion: '2010-09-09'
Description: A simple function.
Parameters:
Name:
Type: String
Resources:
FunctionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Action:
- sts:AssumeRole
Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Version: "2012-10-17"
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Function:
Type: AWS::Lambda::Function
Properties:
Architectures:
- x86_64
Handler: index.handler
Role:
Fn::GetAtt:
- FunctionRole
- Arn
Runtime: nodejs18.x
Code:
ZipFile:
Fn::Sub: |
exports.handler = async (event, context) => {
return {
'statusCode': 200,
'body': JSON.stringify({
message: 'hello world!!! I\'m ${Name}.',
})
};
};
Outputs:
FunctionArn:
Value:
Fn::GetAtt:
- Function
- Arn