diff --git a/cform/ecs.yaml b/cform/ecs.yaml index ac39a6c..de6751b 100644 --- a/cform/ecs.yaml +++ b/cform/ecs.yaml @@ -397,7 +397,7 @@ Resources: - ecs:ListTasks - ecs:DescribeTasks - sns:Publish - - sns:ListSubscriptions + - sns:ListSubscriptionsByTopic Resource: "*" AssumeRolePolicyDocument: Version: "2012-10-17" diff --git a/code/index.py b/code/index.py index 7efbf31..bda6e1a 100644 --- a/code/index.py +++ b/code/index.py @@ -158,7 +158,9 @@ def lambda_handler(event, context): # If tasks are still running... if tasksRunning == 1: - response = snsClient.list_subscriptions() + response = snsClient.list_subscriptions_by_topic( + TopicArn=TopicArn + ) for key in response['Subscriptions']: logger.info("Endpoint %s AND TopicArn %s and protocol %s ",key['Endpoint'], key['TopicArn'], key['Protocol']) diff --git a/code/index.zip b/code/index.zip index 72a1075..b15a657 100644 Binary files a/code/index.zip and b/code/index.zip differ