forked from segment-boneyard/segment-lambda-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SegmentLambdaDestinationCFTemplate
115 lines (115 loc) · 3.62 KB
/
SegmentLambdaDestinationCFTemplate
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Designer": {
"c181028f-4af2-46bb-a7c1-4ac5424197e2": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 383.0049133300781,
"y": 130.00657653808594
},
"z": 0,
"embeds": [],
"isassociatedwith": [
"b36f92be-db81-4587-9003-9e7cb36dd51e"
]
},
"b36f92be-db81-4587-9003-9e7cb36dd51e": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 149.00491333007812,
"y": 130.00657653808594
},
"z": 0,
"embeds": []
},
"d6a13e0a-4e28-4e47-9b9b-f1f4a4b73139": {
"source": {
"id": "c181028f-4af2-46bb-a7c1-4ac5424197e2"
},
"target": {
"id": "b36f92be-db81-4587-9003-9e7cb36dd51e"
},
"z": 1
}
}
},
"Resources": {
"invokeLambdaRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::595280932656:root"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": {
"Ref": "ExternalId"
}
}
}
}
]
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "b36f92be-db81-4587-9003-9e7cb36dd51e"
}
}
},
"invokeLambdaPolicy": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyName": "segment-invoke-lambda",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "lambda:InvokeFunction",
"Resource": [
{
"Ref": "LambdaARN"
}
]
}
]
},
"Roles": [
{
"Ref": "invokeLambdaRole"
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "c181028f-4af2-46bb-a7c1-4ac5424197e2"
}
}
}
},
"Parameters": {
"ExternalId": {
"Type": "String",
"Default": "external-id",
"Description": "Enter external ID for the role."
},
"LambdaARN": {
"Type": "String",
"Description": "Lambda ARN to invoke."
}
}
}