Open JGSweets opened 3 months ago
Other
No response
Currently, one cannot pass a condition from a top level module to a custom module for usage in a module's lower level condition. Below I present the condition for which this occurs:
Top Level file:
AWSTemplateFormatVersion: "2010-09-09" Parameters: Var1: Type: String Default: '' Var2: Type: String Default: '' Conditions: BothVarsFilled: !And - !Not - !Equals - !Ref Var1 - '' - !Not - !Equals - !Ref Var2 - '' Resources: MyModule: Type: "CUSTOM::Test::Test::MODULE" Properties: AreBothVarsFilled: !If [BothVarsFilled, true, false]
CUSTOM::Test::Test::MODULE:
CUSTOM::Test::Test::MODULE
AreBothVarsFilled: Type: String AllowedValues: - true - false Description: Boolean parameter validating whether both vars are filled. Conditions: BothVarsFilledCond: !Equals - !Ref AreBothVarsFilled - true Resources: NewResource: Type: ... Condition: BothVarsFilledCond Properties: ...
In this case, currently one receives the following error message when deploying a stack:
CloudFormation failed to preprocess the stack: Template error: Fn::If cannot be preprocessed
This occurs because the module condition is utilizing the condition from the top level as a parameter.
Likely the same issue experienced by: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/1257
Name of the resource
Other
Resource name
No response
Description
Currently, one cannot pass a condition from a top level module to a custom module for usage in a module's lower level condition. Below I present the condition for which this occurs:
Top Level file:
CUSTOM::Test::Test::MODULE
:In this case, currently one receives the following error message when deploying a stack:
This occurs because the module condition is utilizing the condition from the top level as a parameter.
Other Details
Likely the same issue experienced by: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/1257