@@ -269,7 +269,7 @@ def _depend_on_lambda_permissions_using_tag(self, bucket, permission):
269
269
270
270
See https://stackoverflow.com/questions/34607476/cloudformation-apply-condition-on-dependson
271
271
272
- It is done by using Fn:GetAtt wrapped in a conditional Fn:If. Using Fn:GetAtt implies a
272
+ It is done by using Ref wrapped in a conditional Fn:: If. Using Ref implies a
273
273
dependency, so CloudFormation will automatically wait once it reaches that function, the same
274
274
as if you were using a DependsOn.
275
275
"""
@@ -283,9 +283,9 @@ def _depend_on_lambda_permissions_using_tag(self, bucket, permission):
283
283
properties ['Tags' ] = tags
284
284
dep_tag = {
285
285
'sam:ConditionalDependsOn:' + permission .logical_id : {
286
- 'Fn:If' : [
286
+ 'Fn:: If' : [
287
287
permission .resource_attributes ['Condition' ],
288
- fnGetAtt (permission .logical_id , 'Arn' ),
288
+ ref (permission .logical_id ),
289
289
'no dependency'
290
290
]
291
291
}
@@ -311,7 +311,7 @@ def _inject_notification_configuration(self, function, bucket):
311
311
lambda_event = copy .deepcopy (base_event_mapping )
312
312
lambda_event ['Event' ] = event_type
313
313
if 'Condition' in function .resource_attributes :
314
- lambda_event = make_conditional (lambda_event , function .resource_attributes ['Condition' ])
314
+ lambda_event = make_conditional (function .resource_attributes ['Condition' ], lambda_event )
315
315
event_mappings .append (lambda_event )
316
316
317
317
properties = bucket .get ('Properties' , None )
0 commit comments