fix(cloudformation): expose the RDS resource-id GetAtt attributes (#3527)

AWS::RDS::DBCluster declares DBClusterResourceId readOnly and AWS::RDS::DBInstance
declares DbiResourceId, and RdsService already assigns both. Neither reached the
stack resource, so Fn::GetAtt on either resolved to the literal "LogicalId.Attr"
rather than the id, the silent failure mode Fn::GetAtt has when an attribute was
never mapped.

Invisible until now: the types were LEGACY_SWITCH, and CfnSchemaCoverageTest skips
those. Moving them to a provisioner is what surfaced it.

The other 17 attributes that surfaced with them stay recorded as gaps, because
Floci does not emulate what they describe: read replicas, multi-AZ secondaries,
point-in-time restore windows, RDS Custom automation. Endpoint and ReadEndpoint
are recorded too, for a different reason: the dotted Endpoint.Address,
Endpoint.Port and ReadEndpoint.Address are already set, and that is the form
AWS's GetAtt exposes for these types.

Both assertions fail against the previous commit, returning null.
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-09-12 22:19:42 -05:00
1 parent 5d0b0b44b1
commit b618fa9033
3 files changed
+16 -2

No files matched your search

@@ -250,6 +250,9 @@ public class RdsCfnProvisioner implements CfnResourceProvisioner {
if (instance.getDbInstanceArn() != null) {
r.getAttributes().put("DBInstanceArn", instance.getDbInstanceArn());
}
if (instance.getDbiResourceId() != null) {
r.getAttributes().put("DbiResourceId", instance.getDbiResourceId());
}
}
private void provisionDbCluster(StackResource r, JsonNode props, CloudFormationTemplateEngine engine,
@@ -322,6 +325,9 @@ public class RdsCfnProvisioner implements CfnResourceProvisioner {
if (cluster.getDbClusterArn() != null) {
r.getAttributes().put("DBClusterArn", cluster.getDbClusterArn());
}
if (cluster.getDbClusterResourceId() != null) {
r.getAttributes().put("DBClusterResourceId", cluster.getDbClusterResourceId());
}
}
private Double parseServerlessV2Capacity(JsonNode props, String field,