feat(rds,docdb): tag DocumentDB clusters and parameter groups (#2408)

* fix(rds): tag DB and DB cluster parameter groups

The tag resolver handled db, cluster, subgrp, db-proxy and og, so tagging a
parameter group answered that Floci does not implement the type — a live account
tags both, and the terraform provider reads a group's tags as part of its read.
DocumentDB's cluster parameter groups are these records too, so the same read
fails for aws_docdb_cluster_parameter_group.

Neither model carried tags, and neither carried the ARN a caller tags by: the
create response omitted it, leaving nothing to address the group with. Both are
stored and reported now, and tags given at create are kept, as a live account
keeps them.

* feat(docdb): tag clusters and instances

aws_docdb_cluster reads a cluster's tags as part of every read, so a cluster
that created fine failed its apply on DBClusterNotFoundFault — created, but not
readable.

DocumentDB signs with the rds credential scope, and on that scope it is told
apart by Engine or a cluster/instance identifier. The tag actions carry neither,
only the ARN of the resource they address, so they reached the RDS handler,
which does not hold DocumentDB's records. The router reads that ARN now, and an
ARN naming something DocumentDB does not have still goes to RDS.

Clusters and instances store tags, keep the ones given at create, and answer the
three tag actions. Behaviour follows a live account: an existing key is
overwritten, removing a key that is not present is not an error, and an ARN in
another region or account is rejected with the one message AWS gives for both —
storage is keyed by identifier alone, so without that check an ARN naming
another region would be answered with this caller's cluster.

A tag update is a read-modify-write, so it takes the record's monitor and the
other writers take the same one; otherwise tagging a cluster while it is being
deleted stores it again. Paths that hold both take the instance's monitor before
the cluster's.

Filters on ListTagsForResource are accepted without validation: a live account
rejects an unrecognised name, but Floci carries no list of the ones it accepts,
and the tags of one named resource are the same answer either way.

* fix(rds,docdb): store an empty value for a tag given without one

A tag whose Key arrived without a Value was stored with a null, and the read
hands the tags back as an immutable copy, which rejects nulls — so one such tag
made every subsequent read of that resource fail with an internal error, not
just the tag that caused it. A live account stores an empty value and reads it
back.

Both handlers parse tags the same way and both had it.

* fix(rds,docdb): match the whole ARN when routing tags, and give legacy groups one

Two things reported on review.

Routing read the trailing name of the ResourceName ARN and looked it up in
DocumentDB storage, but RDS and DocumentDB share one ARN space: an RDS resource
whose name a DocumentDB record happens to share was answered — and mutated —
out of the wrong store, and an RDS parameter group or option group could be
resolved as a cluster. The whole stored ARN is matched now, which settles
region, account, type and name at once, as the db-cluster-id filter already
does.

And only creation assigned a parameter group's ARN, so a group persisted by an
earlier version read back without one, leaving describe with no ARN to report
and the caller nothing to tag by. The read that backfills a missing region
backfills the ARN too.

The service keeps rejecting an ARN from another region or account: the router
no longer sends it one, but the check guards its own contract, and it is
covered directly rather than through the endpoint.

* fix(rds,docdb): keep one identifier space across the RDS family

Matching the whole ARN still left one ambiguity: an RDS cluster and a
DocumentDB cluster of the same name in the same account and region produce the
same ARN, and a tag call naming it could only reach one of them.

A live account settles it — creating an Aurora cluster named like an existing
DocumentDB one is refused with DBClusterAlreadyExistsFault, because the RDS
family shares one identifier space. Floci already refused that direction, since
a create naming an identifier DocumentDB holds is routed to DocumentDB, which
answers AlreadyExists; the other direction was open, so a docdb create could
take a name RDS already had.

A create naming an identifier RDS holds now goes to RDS whatever engine it
names, so it answers AlreadyExists too and the two stores cannot both hold one
identifier — which is what makes an ARN unambiguous.

* fix(rds,docdb): report a persisted identifier held by both services

Creates can no longer put one identifier in both stores, but state written
before that can, and a restart loads it. For such a record the identifier
checks in the router already send every action to DocumentDB — describe, modify
and delete included — and have long before tags existed, so tags answer from
there too: one identifier keeps one answer, rather than a tag call reaching a
record no describe can show.

The collision is logged once per ARN, since the RDS record behind it cannot be
reached on this scope at all and only deleting one of the two records fixes it.

* fix(docdb): build cluster and instance ARNs from the caller's region

The ARN was built from the configured default region, so a caller signing for
anywhere else got back an ARN naming somewhere they were not — and since a tag
call is checked against the region it is made from, that caller could not tag
the cluster the create had just answered with.

It also reopened the identifier collision from the other side: the create-time
check looked for an RDS record in the request region while the ARN landed in
the default one, so signing the create for another region got past the check and
produced two records under one ARN. DocumentDB keys records by bare identifier,
so the check now covers every region — narrower than AWS, which allows one name
per region, but Floci cannot hold both and answer either correctly.

The check also asked about the wrong identifier for instances: CreateDBInstance
names its parent cluster, and that cluster existing in RDS is the normal case,
not a clash. Only the identifier being created is checked, and the clash is
answered with AlreadyExists directly rather than by handing the create to a
service that rejects the engine first.

* fix(rds): scope the create-time identifier check to the request's region

Widening it to every region broke what RDS actually does: names are scoped by
region, so the same instance name in two regions is two resources, and
RdsControlPlaneTest.sdkScopesTheSameDbInstanceNameBySignedRegion pins exactly
that. The second create answered DBInstanceAlreadyExists.

The cross-region case that widening was meant to cover is closed by the ARNs
instead: each carries the region it was created in, so two records of one name
in different regions never share an ARN and no tag call has to choose between
them. What must not exist is one identifier in both services in one region, and
that is what the check now asks about.

* fix(docdb): decide ownership of an identifier per region

The routing checks asked whether DocumentDB holds an identifier at all, and its
records are keyed by identifier alone, so a name DocumentDB held in one region
was taken away from RDS in every other one: the create was refused as already
existing, and a describe, modify or delete answered from the wrong region's
record.

The region now comes from the one place a record carries it — the ARN — so
DocumentDB claims an identifier only in the region it was created in. Records
written before ARNs carried the caller's region read as the configured default,
which is the region they were in fact created under.

This was true before tags existed; it becomes reachable in a way worth fixing
now that a create in another region records that region rather than the default.

* fix(docdb): check the identifier on every route into DocumentDB

The create-time check lived in the rds credential scope's branch, but
DocumentDB is reachable under its own scope too, and that one dispatches
straight to its handler — which knows only its own store. A create signed that
way could take an identifier RDS already held in the region, which is the state
the ARN matching relies on being impossible.

The check is one method now, called from both routes.

Neptune shares the same identifier space and its scope is not checked either;
that is untouched here, since this PR's invariant is about the ARN a tag call
resolves and Neptune holds no tags.

* fix(docdb): resolve a tag ARN to the record it names, not to the identifier

resolveTagTarget checked the ARN's region against the caller's and then loaded
the record by identifier, and records are keyed by identifier alone — so an ARN
whose region matched the request but named a record stored in another region
resolved to that other record, and tagged it.

Reachable on the docdb credential scope, which dispatches to this service
directly rather than through the routing that matches the whole ARN. The stored
ARN is now compared with the one asked for, and anything else is not found.
This commit is contained in:
Michal Schreiber authored and GitHub committed 2026-08-19 20:23:32 -04:00
1 parent 498021087f
commit 7b83bd5283
18 files changed
+1693 -141

No files matched your search

@@ -1,6 +1,7 @@
package io.github.hectorvent.floci.services.docdb;
import io.github.hectorvent.floci.config.EmulatorConfig;
import io.github.hectorvent.floci.core.common.AwsException;
import io.github.hectorvent.floci.core.common.RegionResolver;
import io.github.hectorvent.floci.core.storage.AccountAwareStorageBackend;
import io.github.hectorvent.floci.core.storage.StorageFactory;
@@ -13,6 +14,7 @@ import org.mockito.Mockito;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
@@ -156,4 +158,29 @@ class DocDbServiceTest {
noDaemonService.deleteDbCluster("no-docker-cluster");
verify(noDaemonContainerManager, never()).stop(any());
}
@Test
void tagsAreAnsweredOnlyForAnArnInThisRegionAndAccount() {
// The router reaches this service only for an ARN it already matched, so these checks
// guard the service's own contract: storage is keyed by identifier alone, and answering
// by name would hand this caller's cluster to an ARN naming somewhere else. The message
// is the one a live account gives, which is the same for both cases.
docDbService.createDbCluster("scoped-cluster", null, "admin", "secret", false);
String arn = docDbService.getDbCluster("scoped-cluster").getDbClusterArn();
docDbService.addTagsToResource(arn, java.util.Map.of("env", "test"));
assertEquals(java.util.Map.of("env", "test"), docDbService.listTagsForResource(arn));
for (String foreign : new String[]{
"arn:aws:rds:eu-west-1:000000000000:cluster:scoped-cluster",
"arn:aws:rds:us-east-1:111122223333:cluster:scoped-cluster"}) {
AwsException rejected = assertThrows(AwsException.class,
() -> docDbService.listTagsForResource(foreign));
assertEquals("InvalidParameterValue", rejected.getErrorCode());
assertTrue(rejected.getMessage().contains("does not match an RDS resource in this region"));
}
AwsException notAnArn = assertThrows(AwsException.class,
() -> docDbService.listTagsForResource("scoped-cluster"));
assertTrue(notAnArn.getMessage().contains("Invalid resource name"));
}
}
@@ -0,0 +1,129 @@
package io.github.hectorvent.floci.services.docdb;
import io.github.hectorvent.floci.core.common.AwsException;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Tagging a cluster while it is being deleted must not put it back.
*
* <p>A tag update is a read-modify-write. Without a monitor shared with delete, the read can see a
* live cluster, the delete can remove it, and the write then stores the record again — a cluster
* that no describe created and no delete can remove.
*/
@QuarkusTest
@TestProfile(DocDbTagConcurrencyTest.NoContainersProfile.class)
class DocDbTagConcurrencyTest {
/** The race is in storage, not in the container: starting one per attempt only adds seconds. */
public static class NoContainersProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("floci.services.docdb.mock", "true");
}
}
@Inject
DocDbService service;
@Test
void taggingDuringADeleteDoesNotReviveTheCluster() throws Exception {
for (int attempt = 0; attempt < 25; attempt++) {
String id = "race-cluster-" + attempt;
service.createDbCluster(id, "5.0.0", "admin", "secret99password", false);
String arn = service.getDbCluster(id).getDbClusterArn();
CountDownLatch start = new CountDownLatch(1);
AtomicReference<Throwable> unexpected = new AtomicReference<>();
Thread tagger = new Thread(() -> {
await(start);
try {
service.addTagsToResource(arn, Map.of("env", "race"));
} catch (AwsException expected) {
// Losing to the delete is a legitimate outcome; being answered is not.
if (!"DBClusterNotFoundFault".equals(expected.getErrorCode())) {
unexpected.set(expected);
}
} catch (Throwable t) {
unexpected.set(t);
}
});
Thread deleter = new Thread(() -> {
await(start);
try {
service.deleteDbCluster(id);
} catch (Throwable t) {
unexpected.set(t);
}
});
tagger.start();
deleter.start();
start.countDown();
tagger.join(TimeUnit.SECONDS.toMillis(10));
deleter.join(TimeUnit.SECONDS.toMillis(10));
assertFalse(tagger.isAlive(), "tagger did not finish — deadlock between the monitors");
assertFalse(deleter.isAlive(), "deleter did not finish — deadlock between the monitors");
assertNull(unexpected.get(), () -> "unexpected failure: " + unexpected.get());
assertFalse(service.hasCluster(id),
"cluster " + id + " came back after being deleted (attempt " + attempt + ")");
}
}
@Test
void anInstanceAndItsClusterCanBeTaggedAtTheSameTime() throws Exception {
// The two paths take the monitors in one order everywhere; taking them in opposite
// orders would hang here rather than fail an assertion.
String clusterId = "lock-order-cluster";
String instanceId = "lock-order-instance";
service.createDbCluster(clusterId, "5.0.0", "admin", "secret99password", false);
service.createDbInstance(instanceId, clusterId, "db.r5.large", "5.0.0", false);
String clusterArn = service.getDbCluster(clusterId).getDbClusterArn();
String instanceArn = service.getDbInstance(instanceId).getDbInstanceArn();
CountDownLatch start = new CountDownLatch(1);
Thread one = new Thread(() -> {
await(start);
service.addTagsToResource(clusterArn, Map.of("a", "1"));
});
Thread two = new Thread(() -> {
await(start);
service.addTagsToResource(instanceArn, Map.of("b", "2"));
});
one.start();
two.start();
start.countDown();
one.join(TimeUnit.SECONDS.toMillis(10));
two.join(TimeUnit.SECONDS.toMillis(10));
assertFalse(one.isAlive() || two.isAlive(), "a tag update never finished");
assertTrue(service.listTagsForResource(clusterArn).containsKey("a"));
assertTrue(service.listTagsForResource(instanceArn).containsKey("b"));
service.deleteDbInstance(instanceId);
service.deleteDbCluster(clusterId);
}
private static void await(CountDownLatch latch) {
try {
latch.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException(e);
}
}
}
@@ -0,0 +1,283 @@
package io.github.hectorvent.floci.services.docdb;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static io.restassured.RestAssured.given;
import static io.restassured.http.ContentType.URLENC;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
/**
* Tags on DocumentDB clusters and instances.
*
* <p>The tag actions carry no engine or identifier, only the ARN of the resource they address, so
* on the {@code rds} credential scope DocumentDB signs with they reach the RDS handler unless the
* router reads that ARN. Behaviour follows a live account: tags given at create are readable back,
* an existing key is overwritten, removing a key that is not there is not an error, and a key
* given without a value reads back as an empty value.
*/
@QuarkusTest
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class DocDbTagIntegrationTest {
private static final String CLUSTER = "tag-test-cluster";
private static final String INSTANCE = "tag-test-instance";
private static final String CLUSTER_ARN =
"arn:aws:rds:us-east-1:000000000000:cluster:" + CLUSTER;
private static final String INSTANCE_ARN =
"arn:aws:rds:us-east-1:000000000000:db:" + INSTANCE;
/** What the DocumentDB SDK signs with — the path that used to reach RDS and 404. */
private static final String AUTH =
"AWS4-HMAC-SHA256 Credential=test/20260615/us-east-1/rds/aws4_request, "
+ "SignedHeaders=content-type;host, Signature=test";
private static io.restassured.specification.RequestSpecification query(String action) {
return given().header("Authorization", AUTH)
.contentType(URLENC)
.formParam("Action", action)
.formParam("Version", "2014-10-31");
}
@Test
@Order(1)
void tagsGivenAtCreateAreReadableBack() {
query("CreateDBCluster")
.formParam("DBClusterIdentifier", CLUSTER)
.formParam("Engine", "docdb")
.formParam("MasterUsername", "docdbadmin")
.formParam("MasterUserPassword", "secret99password")
.formParam("Tags.Tag.1.Key", "env")
.formParam("Tags.Tag.1.Value", "demo")
.formParam("Tags.Tag.2.Key", "owner")
.formParam("Tags.Tag.2.Value", "me")
.when().post("/")
.then().statusCode(200);
// Order is arbitrary on a live account, so only membership is asserted.
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Key>env</Key>"))
.body(containsString("<Value>demo</Value>"))
.body(containsString("<Key>owner</Key>"))
.body(containsString("<Value>me</Value>"));
}
@Test
@Order(2)
void addOverwritesAnExistingKeyAndAddsNewOnes() {
query("AddTagsToResource")
.formParam("ResourceName", CLUSTER_ARN)
.formParam("Tags.Tag.1.Key", "env")
.formParam("Tags.Tag.1.Value", "changed")
.formParam("Tags.Tag.2.Key", "zzz")
.formParam("Tags.Tag.2.Value", "last")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Value>changed</Value>"))
.body(not(containsString("<Value>demo</Value>")))
.body(containsString("<Key>zzz</Key>"));
}
@Test
@Order(3)
void removingAKeyThatIsNotThereIsNotAnError() {
query("RemoveTagsFromResource")
.formParam("ResourceName", CLUSTER_ARN)
.formParam("TagKeys.member.1", "owner")
.formParam("TagKeys.member.2", "absent-key")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(not(containsString("<Key>owner</Key>")))
.body(containsString("<Key>env</Key>"));
}
@Test
@Order(4)
void aKeyWithNoValueReadsBackAsAnEmptyValue() {
// AWS stores an empty value for it. Carrying a null instead breaks the read for every
// tag on the resource, not just this one.
query("AddTagsToResource")
.formParam("ResourceName", CLUSTER_ARN)
.formParam("Tags.Tag.1.Key", "novalue")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Key>novalue</Key><Value></Value>"));
}
@Test
@Order(5)
void anInstanceCarriesItsOwnTags() {
query("CreateDBInstance")
.formParam("DBInstanceIdentifier", INSTANCE)
.formParam("DBClusterIdentifier", CLUSTER)
.formParam("Engine", "docdb")
.when().post("/")
.then().statusCode(200);
query("AddTagsToResource")
.formParam("ResourceName", INSTANCE_ARN)
.formParam("Tags.Tag.1.Key", "role")
.formParam("Tags.Tag.1.Value", "primary")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", INSTANCE_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Key>role</Key>"))
// The cluster's tags are not the instance's.
.body(not(containsString("<Key>env</Key>")));
}
@Test
@Order(6)
void anArnInAnotherRegionOrAccountIsNotThisCluster() {
// Routing matches the whole stored ARN, so neither of these is a DocumentDB record and
// RDS answers them — the point being that this caller's cluster is never what comes back
// for an ARN naming another region or account.
for (String foreign : new String[]{
"arn:aws:rds:eu-west-1:000000000000:cluster:" + CLUSTER,
"arn:aws:rds:us-east-1:111122223333:cluster:" + CLUSTER}) {
query("ListTagsForResource")
.formParam("ResourceName", foreign)
.when().post("/")
.then()
.statusCode(400)
.body(containsString("InvalidParameterValue"))
.body(not(containsString("<Key>env</Key>")));
}
}
@Test
@Order(6)
void anArnForAClusterThatDoesNotExistIsNotFound() {
query("ListTagsForResource")
.formParam("ResourceName", "arn:aws:rds:us-east-1:000000000000:cluster:no-such-cluster")
.when().post("/")
.then()
// Not a DocumentDB record, so this one stays with RDS, which owns the ARN space.
.statusCode(404)
.body(containsString("DBClusterNotFoundFault"));
}
@Test
@Order(6)
void anRdsResourceOfTheSameNameKeepsItsOwnTags() {
// RDS and DocumentDB share one ARN space. A parameter group named like this cluster is a
// different resource, and routing on the trailing name alone would answer it, or mutate
// it, out of DocumentDB's store.
query("CreateDBParameterGroup")
.formParam("DBParameterGroupName", CLUSTER)
.formParam("DBParameterGroupFamily", "postgres15")
.formParam("Description", "same name, different service")
.when().post("/")
.then().statusCode(200);
query("AddTagsToResource")
.formParam("ResourceName", "arn:aws:rds:us-east-1:000000000000:pg:" + CLUSTER)
.formParam("Tags.Tag.1.Key", "owner")
.formParam("Tags.Tag.1.Value", "rds")
.when().post("/")
.then().statusCode(200);
// The parameter group has only its own tag...
query("ListTagsForResource")
.formParam("ResourceName", "arn:aws:rds:us-east-1:000000000000:pg:" + CLUSTER)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Value>rds</Value>"))
.body(not(containsString("<Key>env</Key>")));
// ...and the cluster is untouched by it.
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Key>env</Key>"))
.body(not(containsString("<Value>rds</Value>")));
query("DeleteDBParameterGroup")
.formParam("DBParameterGroupName", CLUSTER)
.when().post("/").then().statusCode(200);
}
@Test
@Order(7)
void tagsSurviveAModifyOfTheCluster() {
query("ModifyDBCluster")
.formParam("DBClusterIdentifier", CLUSTER)
.formParam("EngineVersion", "5.0.0")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Key>env</Key>"));
}
@Test
@Order(8)
void aDeletedClusterHasNoTagsToRead() {
query("DeleteDBInstance")
.formParam("DBInstanceIdentifier", INSTANCE)
.when().post("/").then().statusCode(200);
query("DeleteDBCluster")
.formParam("DBClusterIdentifier", CLUSTER)
.formParam("SkipFinalSnapshot", "true")
.when().post("/").then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_ARN)
.when().post("/")
.then()
.statusCode(404)
.body(containsString("DBClusterNotFoundFault"));
// And tagging it does not bring it back.
query("AddTagsToResource")
.formParam("ResourceName", CLUSTER_ARN)
.formParam("Tags.Tag.1.Key", "revived")
.formParam("Tags.Tag.1.Value", "no")
.when().post("/")
.then().statusCode(404);
query("DescribeDBClusters")
.formParam("DBClusterIdentifier", CLUSTER)
.when().post("/")
.then().statusCode(404);
}
}
@@ -0,0 +1,381 @@
package io.github.hectorvent.floci.services.docdb;
import io.github.hectorvent.floci.services.rds.RdsService;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import java.util.Map;
import static io.restassured.RestAssured.given;
import static io.restassured.http.ContentType.URLENC;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* One identifier space covers the RDS family.
*
* <p>A live account refuses to create an Aurora cluster named like an existing DocumentDB one with
* {@code DBClusterAlreadyExistsFault}, and the reverse has to be refused too: two clusters of that
* name in different stores would share one ARN, and no tag call could say which was meant.
*/
@QuarkusTest
@TestProfile(SharedClusterIdentifierIntegrationTest.NoContainersProfile.class)
class SharedClusterIdentifierIntegrationTest {
/** Neither engine's container is what this is about, and starting one costs the test 30s. */
public static class NoContainersProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("floci.services.rds.mock", "true",
"floci.services.docdb.mock", "true");
}
}
@Inject
DocDbService docDbService;
@Inject
RdsService rdsService;
private static final String ID = "shared-identifier";
private static final String ARN = "arn:aws:rds:us-east-1:000000000000:cluster:" + ID;
private static final String AUTH =
"AWS4-HMAC-SHA256 Credential=test/20260615/us-east-1/rds/aws4_request, "
+ "SignedHeaders=content-type;host, Signature=test";
private static io.restassured.specification.RequestSpecification query(String action) {
return queryIn("us-east-1", action);
}
private static io.restassured.specification.RequestSpecification queryIn(String region, String action) {
return given().header("Authorization",
"AWS4-HMAC-SHA256 Credential=test/20260615/" + region + "/rds/aws4_request, "
+ "SignedHeaders=content-type;host, Signature=test")
.contentType(URLENC)
.formParam("Action", action)
.formParam("Version", "2014-10-31");
}
@Test
void docDbCannotTakeAnIdentifierRdsAlreadyHolds() {
query("CreateDBCluster")
.formParam("DBClusterIdentifier", ID)
.formParam("Engine", "aurora-postgresql")
.formParam("MasterUsername", "admin")
.formParam("MasterUserPassword", "secret99password")
.when().post("/")
.then().statusCode(200);
query("CreateDBCluster")
.formParam("DBClusterIdentifier", ID)
.formParam("Engine", "docdb")
.formParam("MasterUsername", "docdbadmin")
.formParam("MasterUserPassword", "secret99password")
.when().post("/")
.then()
.statusCode(400)
.body(containsString("AlreadyExists"));
// The RDS cluster owns the ARN, and tagging reaches it rather than a DocumentDB record.
query("AddTagsToResource")
.formParam("ResourceName", ARN)
.formParam("Tags.Tag.1.Key", "owner")
.formParam("Tags.Tag.1.Value", "rds")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Value>rds</Value>"));
query("DeleteDBCluster")
.formParam("DBClusterIdentifier", ID)
.formParam("SkipFinalSnapshot", "true")
.when().post("/").then().statusCode(200);
}
@Test
void aPersistedCollisionAnswersFromOneStoreForEveryAction() {
// State written before creates shared one identifier space can still hold the name twice.
// Both records are seeded through the services, as a restart would load them, since the
// endpoint now refuses to create the second one.
String id = "persisted-collision";
String arn = "arn:aws:rds:us-east-1:000000000000:cluster:" + id;
rdsService.createDbCluster(id, "aurora-postgresql", null, "admin", "secret99password",
null, false, null);
docDbService.createDbCluster(id, "5.0.0", "docdbadmin", "secret99password", false);
// Describe already answers from DocumentDB for such a record, and has since long before
// tags existed. Tagging has to agree with it: one identifier, one answer.
query("DescribeDBClusters")
.formParam("DBClusterIdentifier", id)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("docdb"));
query("AddTagsToResource")
.formParam("ResourceName", arn)
.formParam("Tags.Tag.1.Key", "answered-by")
.formParam("Tags.Tag.1.Value", "docdb")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", arn)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Value>docdb</Value>"));
// The write went to the record that answers for the identifier, not to the other one.
assertEquals(java.util.Map.of("answered-by", "docdb"),
docDbService.listTagsForResource(arn));
assertTrue(rdsService.listTagsForResource(arn, "us-east-1").isEmpty());
docDbService.deleteDbCluster(id);
rdsService.deleteDbCluster(id, "us-east-1");
}
@Test
void anotherRegionIsAnotherResource() {
// RDS scopes these names by region, so the same name elsewhere is a different resource —
// the SDK compatibility suite pins that for instances. Since each ARN carries the region
// it was created in, the two never share one ARN and no tag call has to choose.
String id = "cross-region-identifier";
rdsService.createDbCluster(id, "aurora-postgresql", null, "admin", "secret99password",
null, false, null);
String docDbArn = queryIn("eu-west-1", "CreateDBCluster")
.formParam("DBClusterIdentifier", id)
.formParam("Engine", "docdb")
.formParam("MasterUsername", "docdbadmin")
.formParam("MasterUserPassword", "secret99password")
.when().post("/")
.then().statusCode(200)
.extract().path("CreateDBClusterResponse.CreateDBClusterResult.DBCluster.DBClusterArn");
assertEquals("arn:aws:rds:eu-west-1:000000000000:cluster:" + id, docDbArn);
assertEquals("arn:aws:rds:us-east-1:000000000000:cluster:" + id,
rdsService.getDbCluster(id, "us-east-1").getDbClusterArn());
// Each ARN answers from its own service, so tagging one leaves the other alone.
queryIn("eu-west-1", "AddTagsToResource")
.formParam("ResourceName", docDbArn)
.formParam("Tags.Tag.1.Key", "owner")
.formParam("Tags.Tag.1.Value", "docdb")
.when().post("/")
.then().statusCode(200);
// Read back over the endpoint: the service checks the ARN against the caller's region, and
// a direct call from the test thread has no request to take one from.
queryIn("eu-west-1", "ListTagsForResource")
.formParam("ResourceName", docDbArn)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Value>docdb</Value>"));
assertTrue(rdsService.listTagsForResource(
"arn:aws:rds:us-east-1:000000000000:cluster:" + id, "us-east-1").isEmpty());
docDbService.deleteDbCluster(id);
rdsService.deleteDbCluster(id, "us-east-1");
}
@Test
void aClusterCreatedOutsideTheDefaultRegionIsTaggableFromThere() {
// The ARN a create answers with is the one the caller tags by, and a tag call is checked
// against the region it is made from — an ARN naming the configured default region would
// be one its own creator could not use.
String id = "eu-west-cluster";
String arn = queryIn("eu-west-1", "CreateDBCluster")
.formParam("DBClusterIdentifier", id)
.formParam("Engine", "docdb")
.formParam("MasterUsername", "docdbadmin")
.formParam("MasterUserPassword", "secret99password")
.when().post("/")
.then().statusCode(200)
.extract().path("CreateDBClusterResponse.CreateDBClusterResult.DBCluster.DBClusterArn");
assertTrue(arn.contains(":eu-west-1:"), "ARN should name the caller's region: " + arn);
queryIn("eu-west-1", "AddTagsToResource")
.formParam("ResourceName", arn)
.formParam("Tags.Tag.1.Key", "env")
.formParam("Tags.Tag.1.Value", "eu")
.when().post("/")
.then().statusCode(200);
queryIn("eu-west-1", "ListTagsForResource")
.formParam("ResourceName", arn)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Value>eu</Value>"));
queryIn("eu-west-1", "DeleteDBCluster")
.formParam("DBClusterIdentifier", id)
.formParam("SkipFinalSnapshot", "true")
.when().post("/").then().statusCode(200);
}
@Test
void anRdsRequestIsNotAnsweredByADocumentDbClusterInAnotherRegion() {
// DocumentDB records are keyed by identifier alone, so the region has to be read from the
// record. Otherwise a name DocumentDB holds in one region is taken away from RDS in every
// other region: the create is refused as existing, and describes answer the wrong record.
String id = "region-routing-clash";
queryIn("eu-west-1", "CreateDBCluster")
.formParam("DBClusterIdentifier", id)
.formParam("Engine", "docdb")
.formParam("MasterUsername", "docdbadmin")
.formParam("MasterUserPassword", "secret99password")
.when().post("/")
.then().statusCode(200);
// Same name, different region, ordinary RDS engine: RDS has to answer this.
queryIn("us-east-1", "CreateDBCluster")
.formParam("DBClusterIdentifier", id)
.formParam("Engine", "aurora-postgresql")
.formParam("MasterUsername", "admin")
.formParam("MasterUserPassword", "secret99password")
.when().post("/")
.then()
.statusCode(200)
// Floci reports the aurora-postgresql request as its postgres engine; what matters
// here is that RDS answered at all rather than DocumentDB refusing it as existing.
.body(containsString("<Engine>postgres</Engine>"));
// And each region's describe answers from the service that owns the record there.
queryIn("us-east-1", "DescribeDBClusters")
.formParam("DBClusterIdentifier", id)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Engine>postgres</Engine>"))
.body(not(containsString("docdb")));
queryIn("eu-west-1", "DescribeDBClusters")
.formParam("DBClusterIdentifier", id)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("docdb"));
queryIn("eu-west-1", "DeleteDBCluster")
.formParam("DBClusterIdentifier", id)
.formParam("SkipFinalSnapshot", "true")
.when().post("/").then().statusCode(200);
rdsService.deleteDbCluster(id, "us-east-1");
}
@Test
void theDocDbScopeIsCheckedTheSameWayAsTheRdsScope() {
// DocumentDB is reachable under either credential scope. A create signed for the docdb
// scope dispatches straight to its handler, which only knows its own store — so without
// the same check there, this is the way to put two records under one ARN.
String id = "docdb-scope-clash";
rdsService.createDbCluster(id, "aurora-postgresql", null, "admin", "secret99password",
null, false, null);
given().header("Authorization",
"AWS4-HMAC-SHA256 Credential=test/20260615/us-east-1/docdb/aws4_request, "
+ "SignedHeaders=content-type;host, Signature=test")
.contentType(URLENC)
.formParam("Action", "CreateDBCluster")
.formParam("Version", "2014-10-31")
.formParam("DBClusterIdentifier", id)
.formParam("Engine", "docdb")
.formParam("MasterUsername", "docdbadmin")
.formParam("MasterUserPassword", "secret99password")
.when().post("/")
.then()
.statusCode(400)
.body(containsString("DBClusterAlreadyExistsFault"));
// The RDS record is still the only one under that ARN, and still RDS's.
query("DescribeDBClusters")
.formParam("DBClusterIdentifier", id)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Engine>postgres</Engine>"));
rdsService.deleteDbCluster(id, "us-east-1");
}
@Test
void theDocDbScopeCannotTagAnotherRegionsRecordThroughAMatchingArn() {
// On the docdb scope the request goes straight to the service, skipping the routing that
// matches the whole ARN. An ARN whose region matches the caller but names a record stored
// in another region must not resolve: the identifier alone is not the resource.
String id = "arn-identity-clash";
String docdbAuth = "AWS4-HMAC-SHA256 Credential=test/20260615/%s/docdb/aws4_request, "
+ "SignedHeaders=content-type;host, Signature=test";
given().header("Authorization", docdbAuth.formatted("us-east-1"))
.contentType(URLENC)
.formParam("Action", "CreateDBCluster")
.formParam("Version", "2014-10-31")
.formParam("DBClusterIdentifier", id)
.formParam("Engine", "docdb")
.formParam("MasterUsername", "docdbadmin")
.formParam("MasterUserPassword", "secret99password")
.formParam("Tags.Tag.1.Key", "region")
.formParam("Tags.Tag.1.Value", "us-east-1")
.when().post("/")
.then().statusCode(200);
// Same identifier, eu-west-1 ARN, signed for eu-west-1: the region check passes, and only
// comparing the stored ARN stops this reaching the us-east-1 record.
given().header("Authorization", docdbAuth.formatted("eu-west-1"))
.contentType(URLENC)
.formParam("Action", "ListTagsForResource")
.formParam("Version", "2014-10-31")
.formParam("ResourceName", "arn:aws:rds:eu-west-1:000000000000:cluster:" + id)
.when().post("/")
.then()
.statusCode(404)
.body(containsString("DBClusterNotFoundFault"));
given().header("Authorization", docdbAuth.formatted("eu-west-1"))
.contentType(URLENC)
.formParam("Action", "AddTagsToResource")
.formParam("Version", "2014-10-31")
.formParam("ResourceName", "arn:aws:rds:eu-west-1:000000000000:cluster:" + id)
.formParam("Tags.Tag.1.Key", "region")
.formParam("Tags.Tag.1.Value", "eu-west-1")
.when().post("/")
.then().statusCode(404);
// The us-east-1 record still carries only its own tag.
given().header("Authorization", docdbAuth.formatted("us-east-1"))
.contentType(URLENC)
.formParam("Action", "ListTagsForResource")
.formParam("Version", "2014-10-31")
.formParam("ResourceName", "arn:aws:rds:us-east-1:000000000000:cluster:" + id)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Value>us-east-1</Value>"))
.body(not(containsString("<Value>eu-west-1</Value>")));
given().header("Authorization", docdbAuth.formatted("us-east-1"))
.contentType(URLENC)
.formParam("Action", "DeleteDBCluster")
.formParam("Version", "2014-10-31")
.formParam("DBClusterIdentifier", id)
.formParam("SkipFinalSnapshot", "true")
.when().post("/").then().statusCode(200);
}
}
@@ -0,0 +1,58 @@
package io.github.hectorvent.floci.services.docdb;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.hectorvent.floci.services.docdb.model.DocDbCluster;
import io.github.hectorvent.floci.services.docdb.model.DocDbInstance;
import io.github.hectorvent.floci.services.rds.model.DbClusterParameterGroup;
import io.github.hectorvent.floci.services.rds.model.DbParameterGroup;
import org.junit.jupiter.api.Test;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Records written before tags were stored have to keep working after an upgrade.
*
* <p>Floci persists these, so the first read after an upgrade deserializes JSON with no
* {@code tags} entry — and an explicit null is what Jackson writes back for a null field. Either
* way a caller listing tags must get an empty list, not a failure.
*/
class TaggedRecordUpgradeTest {
private static final ObjectMapper MAPPER = new ObjectMapper();
@Test
void aClusterPersistedWithoutTagsReadsAsUntagged() throws Exception {
DocDbCluster cluster = MAPPER.readValue(
"{\"dbClusterIdentifier\":\"legacy\",\"status\":\"available\"}", DocDbCluster.class);
assertNotNull(cluster.getTags());
assertTrue(cluster.getTags().isEmpty());
cluster.getTags().put("env", "added-after-upgrade");
assertEquals(Map.of("env", "added-after-upgrade"), cluster.getTags());
}
@Test
void anExplicitNullIsToleratedByEveryNewlyTaggedRecord() throws Exception {
assertTrue(MAPPER.readValue("{\"tags\":null}", DocDbCluster.class).getTags().isEmpty());
assertTrue(MAPPER.readValue("{\"tags\":null}", DocDbInstance.class).getTags().isEmpty());
assertTrue(MAPPER.readValue("{\"tags\":null}", DbParameterGroup.class).getTags().isEmpty());
assertTrue(MAPPER.readValue("{\"tags\":null}", DbClusterParameterGroup.class).getTags().isEmpty());
}
@Test
void tagsSurviveARoundTripThroughStorage() throws Exception {
DocDbInstance instance = new DocDbInstance();
instance.setDbInstanceIdentifier("round-trip");
instance.setTags(Map.of("env", "prod"));
DocDbInstance restored =
MAPPER.readValue(MAPPER.writeValueAsString(instance), DocDbInstance.class);
assertEquals(Map.of("env", "prod"), restored.getTags());
}
}
@@ -0,0 +1,147 @@
package io.github.hectorvent.floci.services.rds;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static io.restassured.RestAssured.given;
import static io.restassured.http.ContentType.URLENC;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
/**
* Tags on DB parameter groups and DB cluster parameter groups.
*
* <p>Both types are taggable on a live account, and both are read by the terraform provider as
* part of the group's own read — including for DocumentDB, whose cluster parameter groups are
* these records. The ARN is what a caller tags by, so the create response has to carry it.
*/
@QuarkusTest
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class RdsParameterGroupTagIntegrationTest {
private static final String PG = "tag-test-pg";
private static final String CLUSTER_PG = "tag-test-cluster-pg";
private static final String PG_ARN = "arn:aws:rds:us-east-1:000000000000:pg:" + PG;
private static final String CLUSTER_PG_ARN =
"arn:aws:rds:us-east-1:000000000000:cluster-pg:" + CLUSTER_PG;
private static final String AUTH =
"AWS4-HMAC-SHA256 Credential=test/20260615/us-east-1/rds/aws4_request, "
+ "SignedHeaders=content-type;host, Signature=test";
private static io.restassured.specification.RequestSpecification query(String action) {
return given().header("Authorization", AUTH)
.contentType(URLENC)
.formParam("Action", action)
.formParam("Version", "2014-10-31");
}
@Test
@Order(1)
void createReportsTheArnAndKeepsTheTagsItWasGiven() {
query("CreateDBParameterGroup")
.formParam("DBParameterGroupName", PG)
.formParam("DBParameterGroupFamily", "postgres15")
.formParam("Description", "tag test")
.formParam("Tags.Tag.1.Key", "team")
.formParam("Tags.Tag.1.Value", "data")
.when().post("/")
.then()
.statusCode(200)
// Without the ARN in the response a caller has nothing to tag by.
.body(containsString("<DBParameterGroupArn>" + PG_ARN + "</DBParameterGroupArn>"));
query("ListTagsForResource")
.formParam("ResourceName", PG_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Key>team</Key>"))
.body(containsString("<Value>data</Value>"));
}
@Test
@Order(1)
void aClusterParameterGroupIsTaggableTheSameWay() {
query("CreateDBClusterParameterGroup")
.formParam("DBClusterParameterGroupName", CLUSTER_PG)
.formParam("DBParameterGroupFamily", "docdb5.0")
.formParam("Description", "tag test")
.formParam("Tags.Tag.1.Key", "env")
.formParam("Tags.Tag.1.Value", "test")
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<DBClusterParameterGroupArn>" + CLUSTER_PG_ARN
+ "</DBClusterParameterGroupArn>"));
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_PG_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Key>env</Key>"))
.body(containsString("<Value>test</Value>"));
}
@Test
@Order(2)
void tagsCanBeAddedAndRemovedAfterwards() {
query("AddTagsToResource")
.formParam("ResourceName", CLUSTER_PG_ARN)
.formParam("Tags.Tag.1.Key", "env")
.formParam("Tags.Tag.1.Value", "changed")
.formParam("Tags.Tag.2.Key", "novalue")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_PG_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(containsString("<Value>changed</Value>"))
// A key given without a value reads back empty, as it does on a live account.
.body(containsString("<Key>novalue</Key><Value></Value>"));
query("RemoveTagsFromResource")
.formParam("ResourceName", CLUSTER_PG_ARN)
.formParam("TagKeys.member.1", "novalue")
.when().post("/")
.then().statusCode(200);
query("ListTagsForResource")
.formParam("ResourceName", CLUSTER_PG_ARN)
.when().post("/")
.then()
.statusCode(200)
.body(not(containsString("<Key>novalue</Key>")))
.body(containsString("<Key>env</Key>"));
}
@Test
@Order(3)
void aGroupThatDoesNotExistIsReportedAsMissing() {
query("ListTagsForResource")
.formParam("ResourceName", "arn:aws:rds:us-east-1:000000000000:cluster-pg:no-such-pg")
.when().post("/")
.then()
.statusCode(404)
.body(containsString("NotFound"));
}
@Test
@Order(4)
void cleanUp() {
query("DeleteDBParameterGroup")
.formParam("DBParameterGroupName", PG)
.when().post("/").then().statusCode(200);
query("DeleteDBClusterParameterGroup")
.formParam("DBClusterParameterGroupName", CLUSTER_PG)
.when().post("/").then().statusCode(200);
}
}
@@ -658,12 +658,17 @@ class RdsServiceTest {
@Test
void tagOperationsRejectUnsupportedResourceArn() {
AwsException exception = assertThrows(AwsException.class, () ->
// Parameter groups are tagged now, so an absent one is a missing resource rather than a
// missing feature. A type Floci still does not model keeps the limitation message.
AwsException absentGroup = assertThrows(AwsException.class, () ->
rdsService.listTagsForResource("arn:aws:rds:us-east-1:123456789012:pg:some-parameter-group"));
assertEquals("DBParameterGroupNotFound", absentGroup.getErrorCode());
assertEquals("InvalidParameterValue", exception.getErrorCode());
AwsException unsupportedType = assertThrows(AwsException.class, () ->
rdsService.listTagsForResource("arn:aws:rds:us-east-1:123456789012:snapshot:some-snapshot"));
assertEquals("InvalidParameterValue", unsupportedType.getErrorCode());
// The type is valid on real AWS; the message must present this as a Floci limitation.
assertTrue(exception.getMessage().contains("not yet implemented by Floci"));
assertTrue(unsupportedType.getMessage().contains("not yet implemented by Floci"));
}
@Test
@@ -1113,6 +1118,40 @@ class RdsServiceTest {
"regional-cpg", "us-west-2").getDescription());
}
@Test
void aParameterGroupPersistedWithoutAnArnGetsOneOnFirstRead() {
// Only creation assigned the ARN, so a group written by an earlier version would never
// get one — and the ARN is what a caller tags by, so the group could not be tagged at all.
String accountId = "123456789012";
InMemoryStorage<String, DbParameterGroup> rawParameterGroups = new InMemoryStorage<>();
InMemoryStorage<String, DbClusterParameterGroup> rawClusterParameterGroups =
new InMemoryStorage<>();
rawParameterGroups.put("legacy-pg", new DbParameterGroup(
"legacy-pg", "postgres16", "legacy"));
rawClusterParameterGroups.put("legacy-cpg", new DbClusterParameterGroup(
"legacy-cpg", "aurora-postgresql16", "legacy"));
RdsService service = new RdsService(
containerManager, proxyManager, ec2Service,
new RegionResolver("us-east-1", accountId), config,
new InMemoryStorage<>(), new InMemoryStorage<>(),
new AccountAwareStorageBackend<>(rawParameterGroups, null, accountId),
new AccountAwareStorageBackend<>(rawClusterParameterGroups, null, accountId),
new InMemoryStorage<>());
assertEquals("arn:aws:rds:us-east-1:" + accountId + ":pg:legacy-pg",
service.getDbParameterGroup("legacy-pg", "us-east-1").getDbParameterGroupArn());
assertEquals("arn:aws:rds:us-east-1:" + accountId + ":cluster-pg:legacy-cpg",
service.getDbClusterParameterGroup("legacy-cpg", "us-east-1")
.getDbClusterParameterGroupArn());
// And with an ARN it can be tagged, which is the point of backfilling it.
service.addTagsToResource(
"arn:aws:rds:us-east-1:" + accountId + ":cluster-pg:legacy-cpg",
Map.of("env", "upgraded"), "us-east-1");
assertEquals(Map.of("env", "upgraded"), service.listTagsForResource(
"arn:aws:rds:us-east-1:" + accountId + ":cluster-pg:legacy-cpg", "us-east-1"));
}
@Test
void rawLegacyParameterGroupsCannotBeClaimedByANonDefaultAccount() {
String defaultAccount = "123456789012";