Stéphane GRILLON
Stéphane GRILLON

Reputation: 11882

AWS::CloudFormation - Fn::If requires a list argument with three elements

I have this error but I do not have Fn::If in this SAM template !

Upvotes: -1

Views: 30

Answers (1)

Stéphane GRILLON
Stéphane GRILLON

Reputation: 11882

Txt @Renato, in my SAM template, I dot not have Fn::If but I have !If

the last week, this worked (but not today ;)):

Globals:
  Function:
    DeploymentPreference:
      Alarms:
        - !If
          - IsProd
          - !Ref AliasErrorMetricGreaterThanZeroAlarm
          

but now, AWS need 3 param, so I add - Ref: "AWS::NoValue"

new AWS SAM template is:

Globals:
  Function:
    DeploymentPreference:
      Alarms:
        - !If
          - IsProd
          - !Ref AliasErrorMetricGreaterThanZeroAlarm
          - Ref: "AWS::NoValue"

Upvotes: 0

Related Questions