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

@@ -166,7 +166,20 @@ class LeafCfnProvisionerTest {
verify(ssm).putParameter("/app/db", "secret", "String", null, true, REGION);
assertEquals("/app/db", r.getPhysicalId());
assertEquals(Map.of("Name", "/app/db", "Type", "String", "Value", "secret"), r.getAttributes());
assertEquals(Map.of("Name", "/app/db", "Type", "String", "Value", "secret",
"Arn", "arn:aws:ssm:us-east-1:000000000000:parameter/app/db"), r.getAttributes());
}
@Test
void arnOfANameWithoutALeadingSlashStillHasTheParameterPrefix() {
// AWS ARNs are always arn:...:parameter/<name>; a name without a leading slash gets the
// slash inserted, a name with one is not doubled.
StackResource r = resource("Param", "AWS::SSM::Parameter");
provisioner.provision(r, props("""
{"Name": "db-host", "Value": "localhost"}
"""), ctx);
assertEquals("arn:aws:ssm:us-east-1:000000000000:parameter/db-host", r.getAttributes().get("Arn"));
}
@Test