SNS event configuration ignored

aws
lambda

#1

I tried to write two functions, which should subscribe to different sns topics,

My config looks as following:

VehicleShared:
    handler: src/functions/sns/VehicleShared.handler
    events:
        - sns:
              arn:
                  Fn::Join:
                      - ""
                      - - "arn:aws:sns:"
                        - Ref: "AWS::Region"
                        - ":"
                        - Ref: "AWS::AccountId"
                        - ":vehicle-shared-dev"
              topicName: vehicle-shared-dev
VehicleUnshared:
    handler: src/functions/sns/VehicleUnshared.handler
    event:
        - sns:
              arn:
                  Fn::Join:
                      - ""
                      - - "arn:aws:sns:"
                        - Ref: "AWS::Region"
                        - ":"
                        - Ref: "AWS::AccountId"
                        - ":vehicle-unshared-dev"
              topicName: vehicle-unshared-dev

After deploying the function VehicleShared is subscribed to the vehicle-shared-dev event, as expected.
But the stange thing is, that the subscription for the VehicleUnshared Function was not created.

Has anyone experienced similar problems?


#2

In the YAML you have pasted the function VehicleUnshared, event is missing the s on the end.

VehicleUnshared:
    handler: src/functions/sns/VehicleUnshared.handler
    events: