Files
floci/src/main/java/io/github
David Lopes 98464b4433 fix(rds): resolve tags by ARN resource type, not only DB instances (#1649)
* fix(rds): resolve tags by ARN resource type, not only DB instances

ListTagsForResource, AddTagsToResource and RemoveTagsFromResource
unconditionally resolved every ResourceName to a DB instance, so any
non-instance ARN (e.g. a DB subnet group) returned 404 DBInstanceNotFound.
This broke tools such as the Crossplane Upbound AWS provider, which calls
ListTagsForResource on every observe of a DB subnet group and never sees
it become ready.

Parse the ARN's resource-type segment and dispatch to the matching store
(db, cluster, subgrp): return the resource's tags, the resource-specific
NotFound fault when it is missing, and InvalidParameterValue for
unsupported resource types. Add tag storage to DbCluster and DbSubnetGroup
mirroring DbInstance. A bare (non-ARN) resource name still resolves to a
DB instance for backwards compatibility.

* fix(rds): return InvalidParameterValue for malformed or non-RDS tag ARNs

Address PR review: only fall back to a DB-instance lookup for bare,
non-ARN resource names. Strings that start with arn: are now parsed
strictly and must be RDS ARNs; malformed ARNs and ARNs for other
services return 400 InvalidParameterValue instead of a misleading
DBInstanceNotFound/DBClusterNotFoundFault.

* fix(rds): preserve subnet group tags across modifyDbSubnetGroup

Address PR review: buildSubnetGroup constructs a fresh DbSubnetGroup with
an empty tag map, so modifying a subnet group's subnets dropped any tags
added via AddTagsToResource. Carry the existing group's tags onto the
rebuilt object before persisting, matching AWS ModifyDBSubnetGroup.

* fix(rds): reject type-less RDS ARNs in tag ops and clarify unsupported-type message

Review feedback from #1649:
- An RDS ARN whose resource part is not <type>:<id> now returns 400
  InvalidParameterValue (matching real AWS) instead of falling back to a
  DB-instance lookup; bare non-ARN names keep resolving as DB instances.
- The unsupported-resource-type message now states the Floci scope
  limitation instead of implying those types are untaggable on AWS.
2026-07-06 21:00:22 -05:00
..