fix(cloudformation): resolve IAM assume role policy intrinsics (#2630)

This commit is contained in:
Abarnaa Sree N authored and GitHub committed 2026-08-30 14:40:31 -05:00
1 parent 2e5935d764
commit 6a1d86e43f
2 files changed
+98 -8

No files matched your search

@@ -58,9 +58,14 @@ public class IamRoleCfnProvisioner implements CfnResourceProvisioner {
throw new AwsException("ValidationError",
"Updating RoleName requires resource replacement, which is not supported.", 400);
}
String assumeDoc = props != null && props.has("AssumeRolePolicyDocument")
? props.get("AssumeRolePolicyDocument").toString()
: "{\"Version\":\"2012-10-17\",\"Statement\":[]}";
String assumeDoc = props == null
? null
: ctx.engine().resolveJsonAttribute(props.path("AssumeRolePolicyDocument"));
if (assumeDoc == null) {
assumeDoc = "{\"Version\":\"2012-10-17\",\"Statement\":[]}";
}
String path = ctx.resolveOptional(props, "Path");
if (path == null) {
path = "/";