serverless-heaven / serverless-aws-alias

Alias support for Serverless 1.x
MIT License
189 stars 68 forks source link

[/Resources/TOPIC_NAME/DependsOn/0] 'null' values are not allowed in templates #177

Open lkolchin opened 5 years ago

lkolchin commented 5 years ago

Here is what I've got in the serverless.yaml

      # Dist list subscription for prod alerts
      AlertTopicSubscription:
        Type: AWS::SNS::Subscription
        Condition: CreateResourcesProdStage
        Properties:
          Endpoint: ${self:custom.alarms_emails.prod_dist_list1}
          Protocol: email
          TopicArn: ${self:provider.AlertTopic}

Getting an error during deployment even if condition is false:

Serverless Error ---------------------------------------

[/Resources/AlertTopicSubscription/DependsOn/0] 'null' values are not allowed in templates

Because - Plugin generated this Erroneous resource in compiled-cloudformation-template-alias.json:

  AlertTopicSubscription:
    Type: AWS::SNS::Subscription
    Condition: CreateResourcesProdStage
    Properties:
      Endpoint: {}
      Protocol: email
      TopicArn: arn:aws:sns:ap-southeast-2:2222222222:market-base-infra-topics-sandbox-alerts
    DependsOn:
      - null
      - null

Bug to fix?