File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,14 @@ def setup():
146
146
print ('Created Monitor Lambda Function.' )
147
147
except lmbda .exceptions .ResourceConflictException :
148
148
print ('Skipping creation of Monitor Lambda Function. Already exists.' )
149
+ try :
150
+ lmbda .add_permission (
151
+ FunctionName = 'Monitor' ,
152
+ StatementId = 'InvokeBySNS' ,
153
+ Action = 'lambda:InvokeFunction' ,
154
+ Principal = 'sns.amazonaws.com' )
155
+ except lmbda .exceptions .ResourceConflictException :
156
+ print ('Monitor Lambda Function already has SNS invoke permission.' )
149
157
150
158
def destroy ():
151
159
# Delete roles
@@ -164,7 +172,7 @@ def destroy():
164
172
iam .delete_role (RoleName = "LambdaFullAccess" )
165
173
166
174
# Delete Monitor Lambda function
167
- lmbda .delete_function (FunctionName = "MonitorTEST " )
175
+ lmbda .delete_function (FunctionName = "Monitor " )
168
176
169
177
# Delete Monitor SNS topic
170
178
# create_topic is idempotent so we use it to return ARN since topic already exists
You can’t perform that action at this time.
0 commit comments