Home > Mobile >  Conditional KinesisStreamSpecification in CloudFormation script
Conditional KinesisStreamSpecification in CloudFormation script

Time:05-07

I am new to CloudFoundation scripts and trying to set the conditional attribute for AWS DDB table using the yaml files.

Tried with below but getting error during the stack formation - Property StreamArn cannot be empty.

Seems its not allowing AWS::NoValue in this case.

Can we set the 'KinesisStreamSpecification' property itself on the condition?

      KinesisStreamSpecification:
          StreamArn: !If
          - ShouldAttachKinesis
          - !Sub "arn:aws:kinesis:SomeValue"
          - !Ref "AWS::NoValue"

CodePudding user response:

Your If should be one level up:

      KinesisStreamSpecification:
        !If
          - ShouldAttachKinesis
          - StreamArn: !Sub "arn:aws:kinesis:SomeValue"
          - !Ref "AWS::NoValue"
  • Related