Describe the bug
I have a piece of code that uses Fn.conditionOr with a list of conditions. When the list is longer than 10 elements, CDK is smart enough to break it up into chunks of 10. Otherwise, CloudFormation would complain that an Fn::Or cannot have more than 10 elements. The problem I'm running into is for a list of 11 elements. CDK generates two Fn::Or expressions: One with 10 elements and one with 1 element. When deployment this stack, CloudFormation complains that an Fn::Or must contain at least 2 elements.
Error message from CFN: Template error: every Fn::Or object requires a list of at least 2 and at most 10 boolean parameters.
Expected Behavior
Given a list of conditions of length 11 (let's say of type Fn::Equals) and this code snippet:
Fn.conditionOr(...conditions), CDK should break up the list in a way that's valid according to CloudFormation's rules. For example into length 9 and 2:
"Fn::Or": [
{
"Fn::Or": [
{
"Fn::Equals": [
"1",
"B"
]
},
{
"Fn::Equals": [
"2",
"B"
]
},
{
"Fn::Equals": [
"3",
"B"
]
},
{
"Fn::Equals": [
"4",
"B"
]
},
{
"Fn::Equals": [
"5",
"B"
]
},
{
"Fn::Equals": [
"6",
"B"
]
},
{
"Fn::Equals": [
"7",
"B"
]
},
{
"Fn::Equals": [
"8",
"B"
]
},
{
"Fn::Equals": [
"9",
"B"
]
}
]
},
{
"Fn::Or": [
{
"Fn::Equals": [
"10",
"B"
]
},
{
"Fn::Equals": [
"11",
"B"
]
}
]
}
]
Current Behavior
Given a list of conditions of length 11 (let's say of type Fn::Equals) and this code snippet:
Fn.conditionOr(...conditions), CDK generates a template snippet like this:
"Fn::Or": [
{
"Fn::Or": [
{
"Fn::Equals": [
"1",
"B"
]
},
{
"Fn::Equals": [
"2",
"B"
]
},
{
"Fn::Equals": [
"3",
"B"
]
},
{
"Fn::Equals": [
"4",
"B"
]
},
{
"Fn::Equals": [
"5",
"B"
]
},
{
"Fn::Equals": [
"6",
"B"
]
},
{
"Fn::Equals": [
"7",
"B"
]
},
{
"Fn::Equals": [
"8",
"B"
]
},
{
"Fn::Equals": [
"9",
"B"
]
},
{
"Fn::Equals": [
"10",
"B"
]
}
]
},
{
"Fn::Or": [
{
"Fn::Equals": [
"11",
"B"
]
}
]
}
]
Reproduction Steps
See example above
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.62.2
Framework Version
No response
Node.js Version
v16.20.0
OS
Ubuntu 20
Language
Typescript
Language Version
4.9.4
Other information
No response
Describe the bug
I have a piece of code that uses
Fn.conditionOrwith a list of conditions. When the list is longer than 10 elements, CDK is smart enough to break it up into chunks of 10. Otherwise, CloudFormation would complain that an Fn::Or cannot have more than 10 elements. The problem I'm running into is for a list of 11 elements. CDK generates two Fn::Or expressions: One with 10 elements and one with 1 element. When deployment this stack, CloudFormation complains that an Fn::Or must contain at least 2 elements.Error message from CFN:
Template error: every Fn::Or object requires a list of at least 2 and at most 10 boolean parameters.Expected Behavior
Given a list of
conditionsof length 11 (let's say of type Fn::Equals) and this code snippet:Fn.conditionOr(...conditions), CDK should break up the list in a way that's valid according to CloudFormation's rules. For example into length 9 and 2:Current Behavior
Given a list of
conditionsof length 11 (let's say of type Fn::Equals) and this code snippet:Fn.conditionOr(...conditions), CDK generates a template snippet like this:Reproduction Steps
See example above
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.62.2
Framework Version
No response
Node.js Version
v16.20.0
OS
Ubuntu 20
Language
Typescript
Language Version
4.9.4
Other information
No response