Skip to content

Commit 3f67b05

Browse files
author
AWS Scripting Guy
committed
added cloudwatch event rule
1 parent c29c33e commit 3f67b05

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

snippets/snippets.json

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,46 @@
7171
"description": "",
7272
"scope": "source.cloudformation"
7373
},
74-
75-
76-
74+
"cloudwatch-events-eventrule": {
75+
"prefix": "cloudwatch-events-eventrule",
76+
"body": [
77+
"\"${1:eventRule}\": {",
78+
" \"Type\":\"AWS::Events::Rule\",",
79+
"\t\"Properties\":{",
80+
"\t\t\"Description\" : \"${2:--}\",",
81+
"\t\t\"EventPattern\":{",
82+
"\t\t\t\"source\": [",
83+
"\t\t\t\t\"${3:aws.ec2}\"",
84+
"\t\t\t],",
85+
"\t\t\t\"detail-type\": [",
86+
"\t\t\t\t\"${4:EC2 Instance State-change Notification}\"",
87+
"\t\t\t],",
88+
"\t\t\t\"detail\": {",
89+
"\t\t\t\t\"state\": [",
90+
"\t\t\t\t\t\"${5:stopping}\"",
91+
"\t\t\t\t]",
92+
"\t\t\t},",
93+
"\t\t\"State\": \"ENABLED\",",
94+
"\t\t\"Targets\": [{",
95+
"\t\t\t\t\"Arn\": \"${6:--}\",",
96+
"\t\t\t\t\"Id\": \"${7:--}\"",
97+
"\t\t }]",
98+
"\t\t}",
99+
"\t}",
100+
"},",
101+
"\"${8:permissionForEventsToInvokeLambda}\": {",
102+
"\t\"Type\": \"AWS::Lambda::Permission\",",
103+
"\t\"Properties\": {",
104+
"\t\t\"FunctionName\": \"${9:--}\",",
105+
"\t\t\"Action\": \"${10:lambda:InvokeFunction}\",",
106+
"\t\t\"Principal\": \"${11:events.amazonaws.com}\",",
107+
"\t\t\"SourceArn\": ${12:{ \"Fn::GetAtt\": [\"eventRule\", \"Arn\"] }}",
108+
"\t}",
109+
"}"
110+
],
111+
"description": "",
112+
"scope": "source.cloudformation"
113+
},
77114
"codecommit-repository": {
78115
"prefix": "codecommit-repository",
79116
"body": "\r\n\"${1:codeCommitRepository}\": {\r\n \"Type\": \"AWS::CodeCommit::Repository\",\r\n \"Properties\": {\r\n \"RepositoryDescription\": \"${2}\",\r\n \"RepositoryName\": \"${3}\",\r\n \"Triggers\": [ \"${4}\" ],\r\n }\r\n}\r\n",

0 commit comments

Comments
 (0)