I created a Lambda function that is triggered by AWS’ Price List Api topic. I’m able to deploy the service just fine but I am not able to remove the service because I do not have permissions to list subscriptions (SNS:ListSubscriptionsByTopic ) to AWS’s topic.
functions:
fetchAwsCosts:
handler: handler.fetchAwsCosts
description: Fetch AWS Prices when message is published to this topic.
events:
- sns: arn:aws:sns:us-east-1:278350005181:price-list-api
timeout: 30
Here is the error:
CloudFormation - DELETE_FAILED - AWS::SNS::Subscription - FetchAwsCostsSnsSubscriptionPricelistapi
…
Serverless Error ---------------------------------------
An error occurred: FetchAwsCostsSnsSubscriptionPricelistapi - User:
arn:aws:iam::580501780015:user/ryan.bruun@xxxxxxxxx.com is not authorized to perform:
SNS:ListSubscriptionsByTopic on resource: arn:aws:sns:us-east-1:278350005181:price-list-api (Service:
AmazonSNS; Status Code: 403; Error Code: AuthorizationError; Request ID: d78903fe-8535-5c66-985b-
5054696f9249).
The only way to remove the stack is to go in to cloudformation and delete the stack and the sns topic separately.