# Lambda: SNS events subscriptions only partially registered

**URL:** https://forum.serverless.com/t/lambda-sns-events-subscriptions-only-partially-registered/1968
**Category:** Serverless Framework
**Tags:** aws
**Created:** [May 30, 2017, 12:10pm UTC](https://forum.serverless.com/t/lambda-sns-events-subscriptions-only-partially-registered/1968 "2017-05-30T12:10:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![beInDev](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/beindev/32/690_2.png) [@beInDev](https://forum.serverless.com/u/beInDev)
#### Post date: [May 30, 2017, 12:10pm UTC](https://forum.serverless.com/t/lambda-sns-events-subscriptions-only-partially-registered/1968/1 "2017-05-30T12:10:27Z")

</div>

Hello,

I find myself asking about my problem here today because I’ve had an issue for quite a while.  
I have a service with a handler function that is subscribed to 22 pre-existing SNS topics (by their ARN) from another stack in the yaml configuration file.

```auto
custom
     baseEventName: { Fn::Join: [':', ["arn:aws:sns",Ref: "AWS::Region", Ref: "AWS::AccountId", "event-${opt:stage, self:provider.stage}"]] }
functions:
    onIncomingMessage:
        handler: index.onIncomingMessage
        events:
        - sns:
            arn: { Fn::Join: ['-', ["${self:custom.baseEventName}", "onBusinessUpdated"]] }
            topicName: onBusinessUpdated
        - sns:
            arn: { Fn::Join: ['-', ["${self:custom.baseEventName}", "onBusinessAccountCompleted"]] }
            topicName: onBusinessAccountCompleted
....
```

When I deploy the service, CloudFormation shows that everything went fine, I do have the 22 events subscriptions created as resources in the stack but when I check the lambda triggers list, I only see 18 instead of 22.

So I was wondering if this issue was known (although I didn’t find anything like that) or was I just doing something that wasn’t supposed to be?

I can still add the subscriptions manually but it would be extremly annoying when adding new events and redeploying…

---

<div class="post-metadata">

### Author: ![obie](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/obie/32/3034_2.png) [@obie](https://forum.serverless.com/u/obie)
#### Post date: [February 11, 2019, 6:06pm UTC](https://forum.serverless.com/t/lambda-sns-events-subscriptions-only-partially-registered/1968/2 "2019-02-11T18:06:02Z")

</div>

I’m having a very similar issue. Did you ever figure out what was going on here?

---

<div class="post-metadata">

### Author: ![beInDev](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/beindev/32/690_2.png) [@beInDev](https://forum.serverless.com/u/beInDev)
#### Post date: [February 11, 2019, 6:55pm UTC](https://forum.serverless.com/t/lambda-sns-events-subscriptions-only-partially-registered/1968/3 "2019-02-11T18:55:39Z")

</div>

Sadly I haven’t, we dropped using serverless along the way to switch to terraform.

If you want a bit more details, there was an issue thread I created on the Serverless repo, maybe something in it would help you more

> <https://github.com/serverless/serverless/issues/3719>
>
> \# This is a Bug Report
> 
> \## Description
> 
> For bug reports:
> \* What went wrong?…
> When I deploy a certain service, not all pre-existing SNS events subscriptions are registered in the lambda triggers. (18 out of 22)
> \* What did you expect should have happened?
> That all the events are properly subscribed too
> \* What was the config you used?
> \`\`\`YAML
> custom:
> baseEventName: { Fn::Join: \[':', \["arn:aws:sns",Ref: "AWS::Region", Ref: "AWS::AccountId", "event-${opt:stage, self:provider.stage}"\]\] }
> functions:
> onIncomingMessage:
> handler: index.onIncomingMessage
> events:
> - sns:
> arn: { Fn::Join: \['-', \["${self:custom.baseEventName}", "onBusinessUpdated"\]\] }
> topicName: onBusinessUpdated
> - sns:
> arn: { Fn::Join: \['-', \["${self:custom.baseEventName}", "onBusinessAccountCompleted"\]\] }
> topicName: onBusinessAccountCompleted
> .... (20 more like that)
> \`\`\`
> \* What stacktrace or error message from your provider did you see?
> N/A
> 
> According to CloudFormation, everything was created succesfully
> 
> \## Additional Data
> 
> \* \*\*\*Serverless Framework Version you're using\*\*\*: 1.13.2 (but happens with 1.14.0 too)
> \* \*\*\*Operating System\*\*\*: Linux Mint
> \* \*\*\*Stack Trace\*\*\*: N/A
> \* \*\*\*Provider Error messages\*\*\*: N/A

Good luck 🙂
