mirror of
https://github.com/floci-io/floci.git
synced 2026-12-05 11:07:59 -05:00
fix(cloudformation): preserve nested dynamic reference opt-out (#6574)
* fix(cloudformation): preserve nested dynamic reference opt-out Keep nested intrinsics on the RDS credential path outside the general dynamic-reference stage. Reuse the existing suspension counter and restore it after every exit. Signed-off-by: Andre Kurait <AndreKurait@gmail.com> * test(cloudformation): preserve joined-reference test documentation Move the nested opt-out test above the joined-string Javadoc so the comment documents its original test. Preserve both test bodies unchanged. Signed-off-by: Andre Kurait <AndreKurait@gmail.com> --------- Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
1 parent
f1816dbb44
commit
b5532028e1
3 files changed
+50
-13
No files matched your search
+9
-9
@@ -80,8 +80,8 @@ public class CloudFormationTemplateEngine {
|
||||
private final AttributeValueResolver attributeValueResolver;
|
||||
private final List<String> unresolvedIntrinsics = new ArrayList<>();
|
||||
/**
|
||||
* Above zero while {@code Fn::GetStackOutput}'s arguments resolve: CloudFormation hands them on
|
||||
* with their dynamic references unresolved.
|
||||
* Above zero while an intrinsic-only property or {@code Fn::GetStackOutput}'s arguments resolve,
|
||||
* including nested intrinsic calls.
|
||||
*/
|
||||
private int dynamicReferencesSuspended;
|
||||
|
||||
@@ -234,7 +234,12 @@ public class CloudFormationTemplateEngine {
|
||||
* only that property is allowed.
|
||||
*/
|
||||
public String resolveWithoutDynamicReferences(JsonNode node) {
|
||||
return resolveIntrinsic(node);
|
||||
dynamicReferencesSuspended++;
|
||||
try {
|
||||
return resolveIntrinsic(node);
|
||||
} finally {
|
||||
dynamicReferencesSuspended--;
|
||||
}
|
||||
}
|
||||
|
||||
private String resolveIntrinsic(JsonNode node) {
|
||||
@@ -1041,12 +1046,7 @@ public class CloudFormationTemplateEngine {
|
||||
if (value == null || value.isNull()) {
|
||||
return "";
|
||||
}
|
||||
dynamicReferencesSuspended++;
|
||||
try {
|
||||
return resolveIntrinsic(value);
|
||||
} finally {
|
||||
dynamicReferencesSuspended--;
|
||||
}
|
||||
return resolveWithoutDynamicReferences(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user