Skip to content

Commit

Permalink
update StatementId to replace / with -
Browse files Browse the repository at this point in the history
  • Loading branch information
guyrenny authored Apr 25, 2024
1 parent 5540ce5 commit ea39dc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,7 @@ Resources:
if not LambdaPremissionPreFix:
response = self.aws_lambda.remove_permission(
FunctionName=lambda_arn,
StatementId=f"allow-trigger-from-{log_group}"
StatementId=f'allow-trigger-from-{log_group.replace("/", "-")}'
)
if self.event['RequestType'] in ['Create', 'Update']:
if LambdaPremissionPreFix and LambdaPremissionPreFix != [""]:
Expand All @@ -1731,7 +1731,7 @@ Resources:
if not response.get("subscriptionFilters") or response.get("subscriptionFilters")[0].get("destinationArn") != lambda_arn:
response = self.aws_lambda.add_permission(
FunctionName=lambda_arn,
StatementId=f'allow-trigger-from-{log_group}',
StatementId=f'allow-trigger-from-{log_group.replace("/", "-")}',
Action='lambda:InvokeFunction',
Principal='logs.amazonaws.com',
SourceArn=f'arn:aws:logs:{region}:{account_id}:log-group:{log_group}:*',
Expand Down Expand Up @@ -1852,4 +1852,4 @@ Resources:
case _:
raise ValueError(f"invalid or unsupported custom resource command: {command}")
return
return

0 comments on commit ea39dc3

Please sign in to comment.