-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
53 lines (47 loc) · 1.2 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
45
46
47
48
49
50
51
52
53
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Custom Resource
Globals:
Function:
Timeout: 20
Resources:
LambdaFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: target/custom-resource-1.0.jar
Handler: org.saabye_pedersen.cfn.CustomResourceFunctionHandler::handleRequest
Runtime: java8
LambdaRole:
Type: "AWS::IAM::Role"
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Principal:
Service:
- "states.amazonaws.com"
Action:
- "sts:AssumeRole"
Path: "/"
LambdaRolePolicy:
Type: "AWS::IAM::Policy"
Properties:
PolicyName: "customResourcePolicy"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "logs:CreateLogGroup"
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource: arn:aws:logs:*:*:*
Roles:
- Ref: "LambdaRole"
CfnCustomResource:
Type: "Custom::MyCustomResource"
Version: "1.0"
Properties:
ServiceToken: !GetAtt LambdaFunction.Arn