fix(ssm): set the Arn attribute on AWS::SSM::Parameter (#3019)

The registry schema lists Arn as the type's only read-only property,
but the provisioner never set it, so Fn::GetAtt [Param, Arn] resolved
to the literal "Param.Arn" and CfnSchemaCoverageTest fails on main
once the schema corpus is present.

The ARN uses AWS's parameter/<name> form: a name without a leading
slash gets one inserted, a name with one is not doubled.
This commit is contained in:
Mario Toffia authored and GitHub committed 2026-09-04 01:09:19 -05:00
1 parent 9220c057b7
commit 3600038a3f
3 files changed
+23 -2

No files matched your search

@@ -1,6 +1,7 @@
package io.github.hectorvent.floci.services.cloudformation.provisioners;
import com.fasterxml.jackson.databind.JsonNode;
import io.github.hectorvent.floci.core.common.AwsArnUtils;
import io.github.hectorvent.floci.services.cloudformation.model.StackResource;
import io.github.hectorvent.floci.services.ssm.SsmService;
import jakarta.enterprise.context.ApplicationScoped;
@@ -41,6 +42,13 @@ public class SsmCfnProvisioner implements CfnResourceProvisioner {
r.getAttributes().put("Name", name);
r.getAttributes().put("Type", type);
r.getAttributes().put("Value", value);
r.getAttributes().put("Arn", parameterArn(name, ctx));
}
/** AWS's form is {@code parameter/<name>} whether or not the name starts with a slash. */
private static String parameterArn(String name, ProvisionContext ctx) {
String path = name.startsWith("/") ? name : "/" + name;
return AwsArnUtils.Arn.of("ssm", ctx.region(), ctx.accountId(), "parameter" + path).toString();
}
@Override