Skip to content

Commit 3834e31

Browse files
author
AWS Scripting Guy
committed
cloudwatch events snippets
1 parent b8a5d6d commit 3834e31

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

snippets/yaml-snippets.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
23
"autoscaling-group-vpc": {
34
"prefix": "autoscaling-group-vpc",
45
"body": [
@@ -113,6 +114,59 @@
113114
"description": "",
114115
"scope": "source.cloudformation"
115116
},
117+
"cloudwatch-events-eventrule": {
118+
"prefix": "cloudwatch-events-eventrule",
119+
"body": [
120+
"${1:eventRule}:",
121+
" Type: AWS::Events::Rule",
122+
" Properties:",
123+
" Description: ${2}",
124+
" EventPattern:",
125+
" source:",
126+
" - ${3:\"\"} # Example: \"aws.ec2\"",
127+
" detail-type:",
128+
" - ${4:\"\"} # Example: \"EC2 Instance State-change Notification\"",
129+
" detail:",
130+
" state:",
131+
" - ${5:\"\"} # Example: \"stopping\"",
132+
" State: ${6} # Example: \"ENABLED\"}",
133+
" Targets:",
134+
" - ",
135+
" Arn: ${7}",
136+
" Id: ${8}",
137+
" RoleArn: ${9}"
138+
],
139+
"description": "",
140+
"scope": "source.cloudformation"
141+
},
142+
"cloudwatch-events-scheduledrule": {
143+
"prefix": "cloudwatch-events-scheduledrule",
144+
"body": [
145+
"${1:scheduledRule}:",
146+
" Type: AWS::Events::Rule",
147+
" Properties:",
148+
" Description: ${2}",
149+
" ScheduleExpression: \"rate(10 minutes)\"",
150+
" State: ${6} \"ENABLED\"",
151+
" Targets:",
152+
" - ",
153+
" Arn: ${7}",
154+
" Id: ${8}",
155+
" RoleArn: ${9}",
156+
"${10:permissionForEventsToInvokeLambda}:",
157+
" Type: AWS::Lambda::Permission",
158+
" Properties:",
159+
" FunctionName: ${11}",
160+
" Action: ${12} # Example: \"lambda:InvokeFunction\"",
161+
" Principal: ${13} # Example: \"events.amazonaws.com\"",
162+
" SourceArn: ${14}",
163+
" Fn::GetAtt:",
164+
" - \"scheduledRule\"",
165+
" - \"Arn\""
166+
],
167+
"description": "",
168+
"scope": "source.cloudformation"
169+
},
116170
"codecommit-repository": {
117171
"prefix": "codecommit-repository",
118172
"body": [

0 commit comments

Comments
 (0)