Cross region SNS trigger
See original GitHub issueThis is a (Bug Report)
Description
When trying to deploy a lambda with an SNS trigger in a different region the cloudformation script fails.
- What went wrong?
Cloudformation fails to create SNS event subscription for lambda with error:
invalid parameter: TopicArn
- What did you expect should have happened?
Expected the lambda to deploy (via cloudformation) with a trigger on an SNS topic in a different region.
- What was the config you used?
service: testservice
provider:
name: aws
runtime: nodejs6.10
region: us-west-1
functions:
hello:
handler: handler.run
events:
- sns: arn:aws:sns:eu-west-1:xxxxxxxxxxx:stresstest
- What stacktrace or error message from your provider did you see?
Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (2.41 MB)...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - stresser-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - HelloLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - HelloLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - HelloLogGroup
CloudFormation - CREATE_COMPLETE - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - HelloLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - HelloLambdaFunction
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Function - HelloLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - HelloLambdaPermissionStresstestSNS
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - HelloLambdaVersionOVTh8yMAX1zsFvyQcL4UekM3pyWBiYTwE71y8M
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - HelloLambdaPermissionStresstestSNS
CloudFormation - CREATE_IN_PROGRESS - AWS::SNS::Subscription - HelloSnsSubscriptionStresstest
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - HelloLambdaVersionOVTh8yMAX1zsFvyQcL4UekM3pyWBiYTwE71y8M
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - HelloLambdaVersionOVTh8yMAX1zsFvyQcL4UekM3pyWBiYTwE71y8M
CloudFormation - CREATE_FAILED - AWS::SNS::Subscription - HelloSnsSubscriptionStresstest
CloudFormation - CREATE_FAILED - AWS::Lambda::Permission - HelloLambdaPermissionStresstestSNS
CloudFormation - UPDATE_ROLLBACK_IN_PROGRESS - AWS::CloudFormation::Stack - stresser-dev
CloudFormation - UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - stresser-dev
CloudFormation - DELETE_IN_PROGRESS - AWS::Lambda::Permission - HelloLambdaPermissionStresstestSNS
CloudFormation - DELETE_COMPLETE - AWS::SNS::Subscription - HelloSnsSubscriptionStresstest
CloudFormation - DELETE_COMPLETE - AWS::Lambda::Version - HelloLambdaVersionOVTh8yMAX1zsFvyQcL4UekM3pyWBiYTwE71y8M
CloudFormation - DELETE_COMPLETE - AWS::Lambda::Permission - HelloLambdaPermissionStresstestSNS
CloudFormation - DELETE_IN_PROGRESS - AWS::Lambda::Function - HelloLambdaFunction
CloudFormation - DELETE_COMPLETE - AWS::Lambda::Function - HelloLambdaFunction
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - HelloLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - HelloLogGroup
CloudFormation - DELETE_COMPLETE - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - UPDATE_ROLLBACK_COMPLETE - AWS::CloudFormation::Stack - stresser-dev
Similar or dependent issues:
Additional Data
Your Environment Information -----------------------------
OS: darwin
Node Version: 7.10.0
Serverless Version: 1.14.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:13
- Comments:29 (12 by maintainers)
Top Results From Across the Web
Sending Amazon SNS messages to an Amazon SQS queue ...
Amazon SNS supports the cross-region delivery of notifications to Amazon SQS queues and to AWS Lambda functions. When one of the Regions is...
Read more >AWS Lambda & SNS: Invoke Lambda cross-region
I have a Lambda function deployed to several regions. I would like to publish a message to SNS that will invoke these functions....
Read more >Sending Amazon SNS messages to an ... - 亚马逊云科技
Amazon SNS supports the cross-region delivery of notifications to Amazon SQS queues and to Amazon Lambda functions. When one of the Regions is...
Read more >Triggering a Lambda using SNS from a different Region in the ...
It took me a while to sort out, so I posted my exact steps at the end (won't repeat them here) but it...
Read more >AWS-Lambda and SNS : cross account - 2021 - BogoToBogo
We can see our lambda has been triggered by the SNS: ... AWS RDS : Cross-Region Read Replicas for MySQL and Snapshots for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is now supported in cloudformation, however, you have to add target region within cfn. Example: ` SNSSampleSubscription: Type: AWS::SNS::Subscription
In above example, lambda is in us-east-2, and it is subscribing to an sns in us-east-1. The “Region” allows you to do that.
I have created a Gist showing how to implement the custom resource with SLS:
https://gist.github.com/jscattergood/00a2ea6a80fe41a74c5c7efed1b238b4