mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(rds): enforce lifecycle resource scopes and tags (#8401)
IAM enforcement now reads RDS requests from the generated request-resources table: all 168 RDS operations are checked on the resources they name, from the Service Reference and pinned botocore, so a policy scoped to a DB parameter group, proxy, snapshot or other RDS resource applies. Stored tags of RDS and DocumentDB resources come from the existing tag lookups for aws:ResourceTag conditions, read only, in the ARN's own account. Closes #8396
This commit is contained in:
1 parent
ec948dcb11
commit
2cbdef4b23
17 files changed
+1395
-69
No files matched your search
@@ -1295,3 +1295,23 @@ PGSSLROOTCERT=./data/tls/floci-root-ca.crt psql "host=localhost port=7001 user=a
|
||||
mysql -h 127.0.0.1 -P 7002 -u root -psecret123 \
|
||||
--ssl-mode=VERIFY_IDENTITY --ssl-ca=./data/tls/floci-root-ca.crt
|
||||
```
|
||||
|
||||
### IAM lifecycle resources and tags
|
||||
|
||||
With IAM enforcement enabled, RDS request-resource mappings cover the complete
|
||||
namespace generated from AWS's Service Authorization Reference and pinned
|
||||
botocore models. Parameter groups, subnet groups, DB instances and DB clusters
|
||||
use their named ARNs. Stored proxy and endpoint identities are resolved from
|
||||
request names, and target group lookups include the owning proxy. ARN-valued
|
||||
members, including `RemoveFromGlobalCluster`'s `DbClusterIdentifier`, are checked
|
||||
as ARNs. Unfiltered describe requests continue to require a wildcard grant.
|
||||
|
||||
For modeled taggable RDS resources (including endpoints and proxies) and
|
||||
DocumentDB clusters, instances and snapshots sharing the RDS ARN namespace,
|
||||
supported `aws:ResourceTag` and RDS resource-specific tag conditions read stored
|
||||
tags from the exact target ARN's account, Region and partition. IAM and tagging
|
||||
share resource lookup dispatch. IAM reads neither create defaults nor migrate
|
||||
legacy records; named lookups use direct account-scoped keys, and generated
|
||||
proxy identities only search their owning account. Create-time request tags
|
||||
remain separate from existing-resource tags. Resource types without modeled
|
||||
storage retain the generated wildcard fallback when no stored identity exists.
|
||||
@@ -407,7 +407,9 @@ final class RequestResourceMembers {
|
||||
}
|
||||
type.getValue().forEach(key -> {
|
||||
String prefix = key.asText("");
|
||||
if (!prefix.matches("[a-z0-9-]+:(?i:ResourceTag)/") || keys.contains(prefix)) {
|
||||
if ((!prefix.matches("[a-z0-9-]+:(?i:ResourceTag)/")
|
||||
&& !prefix.equals(namespace.getKey() + ":" + type.getKey() + "-tag/"))
|
||||
|| keys.contains(prefix)) {
|
||||
throw new IllegalStateException(RESOURCE_NAME + " has malformed resource tag keys");
|
||||
}
|
||||
keys.add(prefix);
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.floci.aws.core.common.AwsArnUtils;
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.core.common.BackupWindows;
|
||||
import io.floci.aws.core.common.RegionResolver;
|
||||
import io.floci.aws.core.storage.AccountAwareStorageBackend;
|
||||
import io.floci.aws.core.storage.StorageBackend;
|
||||
import io.floci.aws.core.storage.StorageFactory;
|
||||
import io.floci.aws.services.docdb.container.DocDbContainerHandle;
|
||||
@@ -1082,6 +1083,54 @@ public class DocDbService {
|
||||
private record TagTarget(String lockKey, Map<String, String> tags,
|
||||
Consumer<Map<String, String>> save) {}
|
||||
|
||||
public Optional<String> findStoredSnapshotArn(String name, String region) {
|
||||
String arn = AwsArnUtils.isArnFor(name, "rds") ? name
|
||||
: regionResolver.buildArn("rds", region, "cluster-snapshot:" + name);
|
||||
if (!AwsArnUtils.isArnFor(arn, "rds")) {
|
||||
return Optional.empty();
|
||||
}
|
||||
AwsArnUtils.Arn parsed = AwsArnUtils.parse(arn);
|
||||
if (!parsed.accountId().equals(regionResolver.getAccountId()) || !parsed.region().equals(region)
|
||||
|| !parsed.partition().equals(regionResolver.partitionForRegion(region))
|
||||
|| !parsed.resource().startsWith("cluster-snapshot:")) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return readTagResource(snapshots, arn, parsed.resource().substring("cluster-snapshot:".length()),
|
||||
DocDbClusterSnapshot::getDbClusterSnapshotArn).map(DocDbClusterSnapshot::getDbClusterSnapshotArn);
|
||||
}
|
||||
|
||||
/** Exact stored tags for IAM, without legacy-record migration or resource creation. */
|
||||
public Optional<Map<String, String>> storedResourceTags(String resourceArn) {
|
||||
if (!AwsArnUtils.isArnFor(resourceArn, "rds")) {
|
||||
return Optional.empty();
|
||||
}
|
||||
AwsArnUtils.Arn arn = AwsArnUtils.parse(resourceArn);
|
||||
if (!regionResolver.partitionForRegion(arn.region()).equals(arn.partition())
|
||||
|| arn.resource().indexOf(':') < 0) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.ofNullable(resolveTagTarget(resourceArn, true))
|
||||
.map(target -> new LinkedHashMap<>(target.tags()));
|
||||
}
|
||||
|
||||
private <T> Optional<T> readTagResource(StorageBackend<String, T> store, String resourceArn,
|
||||
String id, Function<T, String> identity) {
|
||||
AwsArnUtils.Arn arn = AwsArnUtils.parse(resourceArn);
|
||||
for (String candidate : List.of(key(arn.region(), id), id)) {
|
||||
Optional<T> found;
|
||||
if (store instanceof AccountAwareStorageBackend<T> aware) {
|
||||
found = aware.getForAccount(arn.accountId(), candidate)
|
||||
.or(() -> aware.getLegacyForAccount(arn.accountId(), candidate));
|
||||
} else {
|
||||
found = store.get(candidate);
|
||||
}
|
||||
if (found.isPresent()) {
|
||||
return found.filter(value -> resourceArn.equals(identity.apply(value)));
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
public Map<String, String> listTagsForResource(String resourceName) {
|
||||
return Map.copyOf(resolveTagTarget(resourceName).tags());
|
||||
}
|
||||
@@ -1121,6 +1170,10 @@ public class DocDbService {
|
||||
* ARN naming another region would otherwise resolve this caller's cluster.
|
||||
*/
|
||||
private TagTarget resolveTagTarget(String resourceName) {
|
||||
return resolveTagTarget(resourceName, false);
|
||||
}
|
||||
|
||||
private TagTarget resolveTagTarget(String resourceName, boolean storedOnly) {
|
||||
if (resourceName == null || resourceName.isBlank()) {
|
||||
throw new AwsException("InvalidParameterValue", "ResourceName is required.", 400);
|
||||
}
|
||||
@@ -1131,8 +1184,9 @@ public class DocDbService {
|
||||
throw new AwsException("InvalidParameterValue", "Invalid resource name: " + resourceName, 400);
|
||||
}
|
||||
if (!"rds".equals(arn.service())
|
||||
|| !regionResolver.getRegion().equals(arn.region())
|
||||
|| !Objects.equals(regionResolver.getAccountId(), arn.accountId())) {
|
||||
|| !regionResolver.partitionForRegion(arn.region()).equals(arn.partition())
|
||||
|| !storedOnly && (!regionResolver.getRegion().equals(arn.region())
|
||||
|| !Objects.equals(regionResolver.getAccountId(), arn.accountId()))) {
|
||||
// One message for both, which is what a live account answers.
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"The specified resource name does not match an RDS resource in this region.", 400);
|
||||
@@ -1153,7 +1207,11 @@ public class DocDbService {
|
||||
// rather than through the routing that matches the whole ARN.
|
||||
return switch (type) {
|
||||
case "cluster" -> {
|
||||
DocDbCluster cluster = getDbCluster(id);
|
||||
DocDbCluster cluster = readTagResource(clusters, resourceName, id, DocDbCluster::getDbClusterArn)
|
||||
.orElseGet(() -> storedOnly ? null : getDbCluster(id));
|
||||
if (cluster == null) {
|
||||
yield null;
|
||||
}
|
||||
requireArnNamesRecord(resourceName, cluster.getDbClusterArn(),
|
||||
"DBClusterNotFoundFault", "DocDB cluster " + id + " not found.");
|
||||
yield new TagTarget("cluster:" + key(id), cluster.getTags(), updated -> {
|
||||
@@ -1162,7 +1220,11 @@ public class DocDbService {
|
||||
});
|
||||
}
|
||||
case "db" -> {
|
||||
DocDbInstance instance = getDbInstance(id);
|
||||
DocDbInstance instance = readTagResource(instances, resourceName, id, DocDbInstance::getDbInstanceArn)
|
||||
.orElseGet(() -> storedOnly ? null : getDbInstance(id));
|
||||
if (instance == null) {
|
||||
yield null;
|
||||
}
|
||||
requireArnNamesRecord(resourceName, instance.getDbInstanceArn(),
|
||||
"DBInstanceNotFound", "DocDB instance " + id + " not found.");
|
||||
yield new TagTarget("instance:" + key(id), instance.getTags(), updated -> {
|
||||
@@ -1170,8 +1232,24 @@ public class DocDbService {
|
||||
instances.put(key(id), instance);
|
||||
});
|
||||
}
|
||||
default -> throw new AwsException("InvalidParameterValue",
|
||||
"Tagging for resource type '" + type + "' is not yet implemented by Floci: " + resourceName, 400);
|
||||
case "cluster-snapshot" -> {
|
||||
if (!storedOnly) {
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"Tagging for resource type '" + type + "' is not yet implemented by Floci: " + resourceName, 400);
|
||||
}
|
||||
yield readTagResource(snapshots, resourceName, id, DocDbClusterSnapshot::getDbClusterSnapshotArn)
|
||||
.map(snapshot -> new TagTarget("snapshot:" + key(arn.region(), id), snapshot.getTags(), updated -> {
|
||||
snapshot.setTags(updated);
|
||||
snapshots.put(key(arn.region(), id), snapshot);
|
||||
})).orElse(null);
|
||||
}
|
||||
default -> {
|
||||
if (storedOnly) {
|
||||
yield null;
|
||||
}
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"Tagging for resource type '" + type + "' is not yet implemented by Floci: " + resourceName, 400);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -94,6 +94,7 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -3090,6 +3091,106 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/** Stored tags are read by exact ARN, without resource creation or legacy-record migration. */
|
||||
public Map<String, String> storedTags(String resourceArn) {
|
||||
if (!AwsArnUtils.isArnFor(resourceArn, "rds")) {
|
||||
return Map.of();
|
||||
}
|
||||
AwsArnUtils.Arn arn = AwsArnUtils.parse(resourceArn);
|
||||
if (!regionResolver.partitionForRegion(arn.region()).equals(arn.partition())
|
||||
|| arn.resource().indexOf(':') < 0) {
|
||||
return Map.of();
|
||||
}
|
||||
TagHandle handle = resolveTagHandle(resourceArn, arn.region(), true);
|
||||
return handle == null ? Map.of() : new LinkedHashMap<>(handle.tags());
|
||||
}
|
||||
|
||||
/** Finds generated identities by the names supplied in the generated request-resource table. */
|
||||
public Optional<String> findStoredArn(String type, List<String> names, String region) {
|
||||
if (names.isEmpty() || names.stream().anyMatch(name -> name == null || name.isBlank())) {
|
||||
return Optional.empty();
|
||||
}
|
||||
String account = currentAccountId();
|
||||
String effectiveRegion = effectiveRegion(region);
|
||||
String selector = names.getFirst();
|
||||
String snapshotName = AwsArnUtils.isArnFor(selector, "rds")
|
||||
? AwsArnUtils.parse(selector).resource().substring(AwsArnUtils.parse(selector).resource().indexOf(':') + 1)
|
||||
: selector;
|
||||
Optional<String> found = switch (type) {
|
||||
case "proxy" -> names.size() == 1
|
||||
? readScopedResource(proxies, account, effectiveRegion, names.getFirst()).map(DbProxy::getDbProxyArn)
|
||||
: Optional.empty();
|
||||
case "proxy-endpoint" -> names.size() == 1
|
||||
? readScopedResource(proxyEndpoints, account, effectiveRegion, names.getFirst())
|
||||
.map(DbProxyEndpoint::getDbProxyEndpointArn) : Optional.empty();
|
||||
case "target-group" -> names.size() == 1 || names.size() == 2
|
||||
? readScopedResource(proxyTargetGroups, account, effectiveRegion, names.getFirst())
|
||||
.filter(group -> (names.size() == 1 ? "default" : names.get(1)).equals(group.getTargetGroupName()))
|
||||
.map(DbProxyTargetGroup::getTargetGroupArn) : Optional.empty();
|
||||
case "snapshot" -> names.size() == 1
|
||||
? readScopedResource(clusterSnapshots, account, effectiveRegion, snapshotName)
|
||||
.map(DbClusterSnapshot::getDbClusterSnapshotArn)
|
||||
.or(() -> readScopedResource(snapshots, account, effectiveRegion, snapshotName)
|
||||
.map(DbSnapshot::getDbSnapshotArn))
|
||||
.filter(value -> !AwsArnUtils.looksLikeArn(selector) || selector.equals(value))
|
||||
: Optional.empty();
|
||||
default -> Optional.empty();
|
||||
};
|
||||
return found.filter(value -> AwsArnUtils.isArnFor(value, "rds"))
|
||||
.filter(value -> {
|
||||
AwsArnUtils.Arn arn = AwsArnUtils.parse(value);
|
||||
return account.equals(arn.accountId()) && effectiveRegion.equals(arn.region())
|
||||
&& regionResolver.partitionForRegion(effectiveRegion).equals(arn.partition());
|
||||
});
|
||||
}
|
||||
|
||||
private <T> Optional<T> readScopedResource(StorageBackend<String, T> store, String account,
|
||||
String region, String name) {
|
||||
return readResourceKeys(store, account, List.of(dbResourceKey(region, name), name));
|
||||
}
|
||||
|
||||
private <T> Optional<T> readResourceKeys(StorageBackend<String, T> store, String account, List<String> keys) {
|
||||
for (String key : keys) {
|
||||
Optional<T> found = store instanceof AccountAwareStorageBackend<T> aware
|
||||
? aware.getForAccount(account, key).or(() -> aware.getLegacyForAccount(account, key))
|
||||
: store.get(key);
|
||||
if (found.isPresent()) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
private <T> Optional<T> readTagResource(StorageBackend<String, T> store, String resourceArn,
|
||||
String name, Function<T, String> identity) {
|
||||
AwsArnUtils.Arn arn = AwsArnUtils.parse(resourceArn);
|
||||
return readScopedResource(store, arn.accountId(), arn.region(), name)
|
||||
.filter(value -> resourceArn.equals(identity.apply(value)));
|
||||
}
|
||||
|
||||
private <T> Optional<T> readTagResource(StorageBackend<String, T> store, String resourceArn,
|
||||
String name, Function<T, String> identity, String key) {
|
||||
return readResourceKeys(store, AwsArnUtils.parse(resourceArn).accountId(), List.of(key, name))
|
||||
.filter(value -> resourceArn.equals(identity.apply(value)));
|
||||
}
|
||||
|
||||
private <T> Optional<T> readTagResourceByArn(StorageBackend<String, T> store, String resourceArn,
|
||||
Function<T, String> name, Function<T, String> identity) {
|
||||
AwsArnUtils.Arn arn = AwsArnUtils.parse(resourceArn);
|
||||
Predicate<String> inRegion = key -> key.startsWith(arn.region() + "::") || !key.contains("::");
|
||||
List<T> candidates;
|
||||
if (store instanceof AccountAwareStorageBackend<T> aware) {
|
||||
String prefix = arn.accountId() + "/";
|
||||
candidates = aware.scanRaw(key -> key.startsWith(prefix) && inRegion.test(key.substring(prefix.length()))
|
||||
|| arn.accountId().equals(defaultAccountId()) && !key.contains("/") && inRegion.test(key));
|
||||
} else {
|
||||
candidates = store.scan(inRegion);
|
||||
}
|
||||
return candidates.stream().filter(value -> resourceArn.equals(identity.apply(value)))
|
||||
.map(value -> readTagResource(store, resourceArn, name.apply(value), identity))
|
||||
.flatMap(Optional::stream).findFirst();
|
||||
}
|
||||
|
||||
public Map<String, String> listTagsForResource(String resourceName) {
|
||||
return listTagsForResource(resourceName, resourceRegionOrDefault(resourceName));
|
||||
}
|
||||
@@ -3133,11 +3234,15 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
* A bare resource name (no ARN) is treated as a DB instance identifier for backwards compatibility.
|
||||
*/
|
||||
private TagHandle resolveTagHandle(String resourceName, String region) {
|
||||
return resolveTagHandle(resourceName, region, false);
|
||||
}
|
||||
|
||||
private TagHandle resolveTagHandle(String resourceName, String region, boolean storedOnly) {
|
||||
if (resourceName == null || resourceName.isBlank()) {
|
||||
throw new AwsException("InvalidParameterValue", "ResourceName is required.", 400);
|
||||
}
|
||||
|
||||
String effectiveRegion = effectiveRegion(region);
|
||||
String effectiveRegion = storedOnly ? region : effectiveRegion(region);
|
||||
String type = "db";
|
||||
String id = resourceName;
|
||||
if (AwsArnUtils.looksLikeArn(resourceName)) {
|
||||
@@ -3157,7 +3262,7 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"ResourceName is not in region " + effectiveRegion + ": " + resourceName, 400);
|
||||
}
|
||||
if (!Objects.equals(regionResolver.getAccountId(), arn.accountId())) {
|
||||
if (!storedOnly && !Objects.equals(regionResolver.getAccountId(), arn.accountId())) {
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"ResourceName is not in the current account: " + resourceName, 400);
|
||||
}
|
||||
@@ -3173,9 +3278,15 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
// A bare (non-ARN) resource name is treated as a DB instance identifier for backwards compatibility.
|
||||
|
||||
String resourceId = id;
|
||||
String targetArn = AwsArnUtils.isArn(resourceName) ? resourceName
|
||||
: regionResolver.buildArn("rds", effectiveRegion, type + ":" + resourceId);
|
||||
return switch (type) {
|
||||
case "db" -> {
|
||||
DbInstance instance = getDbInstance(resourceId, effectiveRegion);
|
||||
DbInstance instance = readTagResource(instances, targetArn, resourceId, DbInstance::getDbInstanceArn)
|
||||
.orElseGet(() -> storedOnly ? null : getDbInstance(resourceId, effectiveRegion));
|
||||
if (instance == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(instance.getTags(), updated -> {
|
||||
instance.setTags(updated);
|
||||
putInstanceForScope(currentAccountId(), effectiveRegion,
|
||||
@@ -3183,7 +3294,11 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
});
|
||||
}
|
||||
case "cluster" -> {
|
||||
DbCluster cluster = getDbCluster(resourceId, effectiveRegion);
|
||||
DbCluster cluster = readTagResource(clusters, targetArn, resourceId, DbCluster::getDbClusterArn)
|
||||
.orElseGet(() -> storedOnly ? null : getDbCluster(resourceId, effectiveRegion));
|
||||
if (cluster == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(cluster.getTags(), updated -> {
|
||||
cluster.setTags(updated);
|
||||
putClusterForScope(currentAccountId(), effectiveRegion,
|
||||
@@ -3191,7 +3306,11 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
});
|
||||
}
|
||||
case "subgrp" -> {
|
||||
DbSubnetGroup group = getDbSubnetGroup(resourceId, effectiveRegion);
|
||||
DbSubnetGroup group = readTagResource(subnetGroups, targetArn, resourceId, DbSubnetGroup::getDbSubnetGroupArn)
|
||||
.orElseGet(() -> storedOnly ? null : getDbSubnetGroup(resourceId, effectiveRegion));
|
||||
if (group == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(group.getTags(), updated -> {
|
||||
group.setTags(updated);
|
||||
putSubnetGroupForScope(
|
||||
@@ -3199,24 +3318,39 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
});
|
||||
}
|
||||
case "cluster-snapshot" -> {
|
||||
DbClusterSnapshot snapshot = requireClusterSnapshot(currentAccountId(), effectiveRegion, resourceId);
|
||||
DbClusterSnapshot snapshot = readTagResource(clusterSnapshots, targetArn, resourceId,
|
||||
DbClusterSnapshot::getDbClusterSnapshotArn)
|
||||
.orElseGet(() -> storedOnly ? null
|
||||
: requireClusterSnapshot(currentAccountId(), effectiveRegion, resourceId));
|
||||
if (snapshot == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(snapshot.getTags(), updated -> {
|
||||
snapshot.setTags(updated);
|
||||
putClusterSnapshotForScope(currentAccountId(), effectiveRegion, resourceId, snapshot);
|
||||
});
|
||||
}
|
||||
case "snapshot" -> {
|
||||
DbSnapshot snapshot = Optional.ofNullable(
|
||||
DbSnapshot snapshot = readTagResource(snapshots, targetArn, resourceId, DbSnapshot::getDbSnapshotArn)
|
||||
.orElseGet(() -> storedOnly ? null : Optional.ofNullable(
|
||||
findSnapshotForScope(currentAccountId(), effectiveRegion, resourceId))
|
||||
.orElseThrow(() -> new AwsException("DBSnapshotNotFound",
|
||||
"DBSnapshot " + resourceId + " not found.", 404));
|
||||
"DBSnapshot " + resourceId + " not found.", 404)));
|
||||
if (snapshot == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(snapshot.getTags(), updated -> {
|
||||
snapshot.setTags(updated);
|
||||
putSnapshotForScope(currentAccountId(), effectiveRegion, resourceId, snapshot);
|
||||
});
|
||||
}
|
||||
case "cluster-endpoint" -> {
|
||||
DbClusterEndpoint endpoint = requireClusterEndpoint(effectiveRegion, resourceId);
|
||||
DbClusterEndpoint endpoint = readTagResource(clusterEndpoints, targetArn, resourceId,
|
||||
DbClusterEndpoint::getDbClusterEndpointArn, clusterEndpointKey(effectiveRegion, resourceId))
|
||||
.orElseGet(() -> storedOnly ? null : requireClusterEndpoint(effectiveRegion, resourceId));
|
||||
if (endpoint == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(endpoint.getTags(), updated -> {
|
||||
endpoint.setTags(updated);
|
||||
clusterEndpoints.put(clusterEndpointKey(effectiveRegion,
|
||||
@@ -3224,43 +3358,55 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
});
|
||||
}
|
||||
case "es" -> {
|
||||
EventSubscription subscription = eventSubscriptions
|
||||
EventSubscription subscription = readTagResource(eventSubscriptions, targetArn, resourceId,
|
||||
EventSubscription::getEventSubscriptionArn, eventSubscriptionKey(effectiveRegion, resourceId))
|
||||
.orElseGet(() -> storedOnly ? null : eventSubscriptions
|
||||
.get(eventSubscriptionKey(effectiveRegion, resourceId))
|
||||
.orElseThrow(() -> new AwsException("SubscriptionNotFound",
|
||||
"Subscription " + resourceId + " not found.", 404));
|
||||
"Subscription " + resourceId + " not found.", 404)));
|
||||
if (subscription == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(subscription.getTags(), updated -> {
|
||||
subscription.setTags(updated);
|
||||
eventSubscriptions.put(eventSubscriptionKey(effectiveRegion, resourceId), subscription);
|
||||
});
|
||||
}
|
||||
case "deployment" -> {
|
||||
BlueGreenDeployment deployment = requireBlueGreenDeployment(effectiveRegion, resourceId);
|
||||
BlueGreenDeployment deployment = readTagResource(blueGreenDeployments, targetArn, resourceId,
|
||||
BlueGreenDeployment::getBlueGreenDeploymentArn, blueGreenDeploymentKey(effectiveRegion, resourceId))
|
||||
.orElseGet(() -> storedOnly ? null : requireBlueGreenDeployment(effectiveRegion, resourceId));
|
||||
if (deployment == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(deployment.getTags(), updated -> {
|
||||
deployment.setTags(updated);
|
||||
blueGreenDeployments.put(blueGreenDeploymentKey(effectiveRegion, resourceId), deployment);
|
||||
});
|
||||
}
|
||||
case "db-proxy-endpoint" -> {
|
||||
DbProxyEndpoint endpoint = proxyEndpoints.scan(k -> k.startsWith(effectiveRegion + "::")).stream()
|
||||
.filter(candidate -> resourceName.equals(candidate.getDbProxyEndpointArn()))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> proxyEndpointNotFound(resourceId));
|
||||
DbProxyEndpoint endpoint = readTagResourceByArn(proxyEndpoints, targetArn,
|
||||
DbProxyEndpoint::getDbProxyEndpointName, DbProxyEndpoint::getDbProxyEndpointArn).orElse(null);
|
||||
if (endpoint == null) {
|
||||
if (storedOnly) {
|
||||
yield null;
|
||||
}
|
||||
throw proxyEndpointNotFound(resourceId);
|
||||
}
|
||||
yield new TagHandle(endpoint.getTags(), updated -> {
|
||||
endpoint.setTags(updated);
|
||||
proxyEndpoints.put(proxyEndpointKey(effectiveRegion, endpoint.getDbProxyEndpointName()), endpoint);
|
||||
});
|
||||
}
|
||||
case "db-proxy" -> {
|
||||
DbProxy proxy = proxies.scan(k -> true).stream()
|
||||
.filter(candidate -> effectiveRegion.equals(regionFromArn(candidate.getDbProxyArn())))
|
||||
.filter(candidate -> resourceName.equals(candidate.getDbProxyArn()))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new AwsException("DBProxyNotFoundFault",
|
||||
"DB proxy " + resourceId + " not found.", 404));
|
||||
proxy = findDbProxy(proxy.getDbProxyName(), effectiveRegion)
|
||||
.filter(candidate -> resourceName.equals(candidate.getDbProxyArn()))
|
||||
.orElseThrow(() -> new AwsException("DBProxyNotFoundFault",
|
||||
"DB proxy " + resourceId + " not found.", 404));
|
||||
DbProxy proxy = readTagResourceByArn(proxies, targetArn,
|
||||
DbProxy::getDbProxyName, DbProxy::getDbProxyArn).orElse(null);
|
||||
if (proxy == null) {
|
||||
if (storedOnly) {
|
||||
yield null;
|
||||
}
|
||||
throw new AwsException("DBProxyNotFoundFault", "DB proxy " + resourceId + " not found.", 404);
|
||||
}
|
||||
DbProxy resolvedProxy = proxy;
|
||||
yield new TagHandle(proxy.getTags(), updated -> {
|
||||
DbProxy updatedProxy = copyDbProxy(resolvedProxy);
|
||||
@@ -3269,43 +3415,53 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
});
|
||||
}
|
||||
case "pg" -> {
|
||||
DbParameterGroup group = getDbParameterGroup(resourceId, effectiveRegion);
|
||||
DbParameterGroup group = readTagResource(parameterGroups, targetArn, resourceId,
|
||||
DbParameterGroup::getDbParameterGroupArn)
|
||||
.orElseGet(() -> storedOnly ? null : getDbParameterGroup(resourceId, effectiveRegion));
|
||||
if (group == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(group.getTags(), updated -> {
|
||||
group.setTags(updated);
|
||||
putParameterGroupForRegion(resourceId, effectiveRegion, group);
|
||||
});
|
||||
}
|
||||
case "cluster-pg" -> {
|
||||
DbClusterParameterGroup group =
|
||||
getDbClusterParameterGroup(resourceId, effectiveRegion);
|
||||
DbClusterParameterGroup group = readTagResource(clusterParameterGroups, targetArn, resourceId,
|
||||
DbClusterParameterGroup::getDbClusterParameterGroupArn)
|
||||
.orElseGet(() -> storedOnly ? null : getDbClusterParameterGroup(resourceId, effectiveRegion));
|
||||
if (group == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(group.getTags(), updated -> {
|
||||
group.setTags(updated);
|
||||
putClusterParameterGroupForRegion(resourceId, effectiveRegion, group);
|
||||
});
|
||||
}
|
||||
case "og" -> {
|
||||
if (managedOptionGroup(resourceId) != null) {
|
||||
if (!storedOnly && managedOptionGroup(resourceId) != null) {
|
||||
throw new AwsException("InvalidOptionGroupStateFault",
|
||||
"The default option group " + resourceId + " cannot be tagged.", 400);
|
||||
}
|
||||
OptionGroup group = getOptionGroup(resourceId, effectiveRegion);
|
||||
OptionGroup group = readTagResource(optionGroups, targetArn, resourceId, OptionGroup::getOptionGroupArn)
|
||||
.orElseGet(() -> storedOnly ? null : getOptionGroup(resourceId, effectiveRegion));
|
||||
if (group == null) {
|
||||
yield null;
|
||||
}
|
||||
yield new TagHandle(group.getTags(), updated -> {
|
||||
group.setTags(updated);
|
||||
putOptionGroupForRegion(resourceId, effectiveRegion, group);
|
||||
});
|
||||
}
|
||||
case "target-group" -> {
|
||||
DbProxyTargetGroup targetGroup = proxyTargetGroups.scan(k -> true).stream()
|
||||
.filter(candidate -> effectiveRegion.equals(
|
||||
regionFromArn(candidate.getTargetGroupArn())))
|
||||
.filter(candidate -> resourceName.equals(candidate.getTargetGroupArn()))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new AwsException("DBProxyTargetGroupNotFoundFault",
|
||||
"DB proxy target group " + resourceId + " not found.", 404));
|
||||
targetGroup = findProxyTargetGroup(targetGroup.getDbProxyName(), effectiveRegion)
|
||||
.filter(candidate -> resourceName.equals(candidate.getTargetGroupArn()))
|
||||
.orElseThrow(() -> new AwsException("DBProxyTargetGroupNotFoundFault",
|
||||
"DB proxy target group " + resourceId + " not found.", 404));
|
||||
DbProxyTargetGroup targetGroup = readTagResourceByArn(proxyTargetGroups, targetArn,
|
||||
DbProxyTargetGroup::getDbProxyName, DbProxyTargetGroup::getTargetGroupArn).orElse(null);
|
||||
if (targetGroup == null) {
|
||||
if (storedOnly) {
|
||||
yield null;
|
||||
}
|
||||
throw new AwsException("DBProxyTargetGroupNotFoundFault", "DB proxy target group " + resourceId + " not found.", 404);
|
||||
}
|
||||
DbProxyTargetGroup resolvedTargetGroup = targetGroup;
|
||||
yield new TagHandle(targetGroup.getTags(), updated -> {
|
||||
DbProxyTargetGroup updatedTargetGroup = copyProxyTargetGroup(resolvedTargetGroup);
|
||||
@@ -3318,8 +3474,13 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
// Valid RDS resource types Floci does not model yet (snapshot, ri, es, secgrp, ...):
|
||||
// taggable on real AWS, so the message states the Floci limitation rather than AWS
|
||||
// semantics.
|
||||
default -> throw new AwsException("InvalidParameterValue",
|
||||
"Tagging for resource type '" + type + "' is not yet implemented by Floci: " + resourceName, 400);
|
||||
default -> {
|
||||
if (storedOnly) {
|
||||
yield null;
|
||||
}
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"Tagging for resource type '" + type + "' is not yet implemented by Floci: " + resourceName, 400);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package io.floci.aws.services.rds;
|
||||
|
||||
import io.floci.aws.core.common.StoredResourceArns;
|
||||
import io.floci.aws.services.docdb.DocDbService;
|
||||
import io.floci.aws.services.rds.export.RdsExportTaskService;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/** The RDS ARN namespace is shared by RDS and DocumentDB. */
|
||||
@ApplicationScoped
|
||||
public class RdsStoredResourceArns implements StoredResourceArns {
|
||||
private final RdsService rds;
|
||||
private final DocDbService documentDb;
|
||||
private final RdsExportTaskService exports;
|
||||
|
||||
@Inject
|
||||
public RdsStoredResourceArns(RdsService rds, DocDbService documentDb, RdsExportTaskService exports) {
|
||||
this.rds = rds;
|
||||
this.documentDb = documentDb;
|
||||
this.exports = exports;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String namespace() {
|
||||
return "rds";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<String> find(String type, List<String> names, String region) {
|
||||
if ("snapshot".equals(type) && names.size() == 1) {
|
||||
return documentDb.findStoredSnapshotArn(names.getFirst(), region)
|
||||
.or(() -> rds.findStoredArn(type, names, region));
|
||||
}
|
||||
return rds.findStoredArn(type, names, region);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> through(String member, String value, String region) {
|
||||
return "ExportTaskIdentifier".equals(member)
|
||||
? exports.storedSourceArn(value, region).stream().toList() : List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> storedTags(String arn) {
|
||||
// Match Query dispatch precedence, including an owner's empty tag set after untagging.
|
||||
return documentDb.storedResourceTags(arn)
|
||||
.orElseGet(() -> rds.storedTags(arn));
|
||||
}
|
||||
}
|
||||
@@ -332,6 +332,17 @@ public class RdsExportTaskService implements Resettable {
|
||||
}
|
||||
}
|
||||
|
||||
/** The source a stored export names, without migration, worker scheduling or status changes. */
|
||||
public Optional<String> storedSourceArn(String taskId, String region) {
|
||||
String account = regionResolver.getAccountId();
|
||||
String effectiveRegion = effectiveRegion(region);
|
||||
String key = key(effectiveRegion, taskId);
|
||||
Optional<ExportTask> task = tasks instanceof AccountAwareStorageBackend<ExportTask> aware
|
||||
? aware.getForAccount(account, key).or(() -> aware.getLegacyForAccount(account, key)) : tasks.get(key);
|
||||
return task.filter(value -> account.equals(value.getAccountId()) && effectiveRegion.equals(value.getRegion()))
|
||||
.map(ExportTask::getSourceArn);
|
||||
}
|
||||
|
||||
private ExportTask requireTask(String region, String taskId) {
|
||||
return tasks.get(key(region, taskId))
|
||||
.orElseThrow(() -> new AwsException("ExportTaskNotFound",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-16", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "inspector2": ["inspector2"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "ram": ["ram"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "route53": ["route53"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "inspector2": ["inspector2"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "ram": ["ram"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "route53": ["route53"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
|
||||
"handBuilt": ["apigateway", "bedrock", "dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "logs", "pipes", "resource-groups", "s3", "sns", "sqs", "sts"],
|
||||
"notCovered": {"airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "aps": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, which other services (ECS capacity providers) read back; the mint is fixed first", "aws-marketplace": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "backup": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "batch": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rules do not fill a name from, so nearly every operation's resource would be left open", "cloudwatch": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "comprehend": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "config": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dlm": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2-instance-connect": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticache": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment/<application>/<name>`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST rLine truncated
|
||||
"notCovered": {"airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "aps": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, which other services (ECS capacity providers) read back; the mint is fixed first", "aws-marketplace": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "backup": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "batch": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rules do not fill a name from, so nearly every operation's resource would be left open", "cloudwatch": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "comprehend": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "config": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dlm": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2-instance-connect": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticache": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment/<application>/<name>`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST rLine truncated
|
||||
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "appfabric", "appflow", "application-signals", "application-signals-mcp", "appmesh", "appmesh-preview", "apprunner", "appstream", "apptest", "arc-region-switch", "arc-zonal-shift", "artifact", "assurance", "auditmanager", "aws-external-anthropic", "b2bi", "backup-gateway", "backup-search", "bedrock-mantle", "bedrock-websearch", "billing", "billingconductor", "braket", "bugbust", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "clouddirectory", "cloudsearch", "cloudshell", "cloudtrail-data", "codecatalyst", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "codewhisperer", "cognito-sync", "connect-campaigns", "consoleapp", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "devops-guru", "directconnect", "docdb-elastic", "drs", "ds", "ds-data", "ebs", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "end-user-messaging", "entityresolution", "evs", "finspace", "finspace-api", "fms", "forecast", "frauddetector", "freertos", "fsx", "gamelift", "gameliftstreams", "geo", "geo-maps", "geo-places", "geo-routes", "glacier", "grafana", "greengrass", "groundstation", "health", "health-agent", "healthlake", "honeycode", "identity-sync", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotanalytics", "iotdeviceadvisor", "iotfleethub", "iotfleetwise", "iotjobsdata", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "iq", "iq-permission", "ivs", "ivschat", "kafka-cluster", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "lookoutmetrics", "lookoutvision", "m2", "machinelearning", "managedblockchain", "mapcredits", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgh", "mgn", "migrationhub-orchestrator", "mobiletargeting", "monitron", "mpa", "neptune-db", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "nimble", "notifications", "notifications-contacts", "nova-act", "observabilityadmin", "odb", "omics", "one", "opensearch", "opsworks", "osis", "outposts", "panorama", "partnercentral", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "rbin", "rds-db", "refactor-spaces", "repostspace", "resiliencehub", "robomaker", "rolesanywhere", "route53-recovery-cluster", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3-object-lambda", "s3-outposts", "s3express", "s3files", "sagemaker-geospatial", "sagemaker-mlflow", "savingsplans", "schemas", "scn", "sdb", "security-ir", "securityagent", "securitylake", "serverlessrepo", "shield", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "ssmmessages", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "tnb", "transform", "transform-custom", "trustedadvisor", "ts", "vendor-insights", "voiceid", "vpc-lattice", "vpc-lattice-svcs", "vpce", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workdocs", "worklink", "workmail", "workmailmessageflow", "workspaces", "workspaces-instances", "workspaces-web"],
|
||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudformation": {"changeset": "arn:${Partition}:cloudformation:${Region}:${Account}:changeSet/${ChangeSetName}/${Id}", "generatedtemplate": "arn:${Partition}:cloudformation:${Region}:${Account}:generatedTemplate/${Id}", "resourcescan": "arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}", "stack": "arn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id}", "stackset": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset/${StackSetName}:${Id}", "stackset-target": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset-target/${StackSetTarget}", "type": "arn:${Partition}:cloudformation:${Region}:${Account}:type/resource/${Type}", "typeHook": "arn:${Partition}:cloudformation:${Region}:${Account}:type/hook/${Type}"}, "cloudfront": {"anycast-ip-list": "arn:${Partition}:cloudfront::${Account}:anycast-ip-list/${Id}", "cache-policy": "arn:${Partition}:cloudfront::${Account}:cache-policy/${Id}", "connection-function": "arn:${Partition}:cloudfront::${Account}:connection-function/${Id}", "connection-group": "arn:${Partition}:cloudfront::${Account}:connection-group/${Id}", "continuous-deployment-policy": "arn:${Partition}:cloudfront::${Account}:continuous-deployment-policy/${Id}", "distribution": "arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}", "distribution-tenant": "arn:${Partition}:cloudfront::${Account}:distribution-tenant/${Id}", "field-level-encryption-config": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-config/${Id}", "field-level-encryption-profile": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-profile/${Id}", "function": "arn:${Partition}:cloudfront::${Account}:function/${Name}", "key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${Name}", "origin-access-control": "arn:${Partition}:cloudfront::${Account}:origin-access-control/${Id}", "origin-access-identity": "arn:${Partition}:cloudfront::${Account}:origin-access-identity/${Id}", "origin-request-policy": "arn:${Partition}:cloudfront::${Account}:origin-request-policy/${Id}", "realtime-log-config": "arn:${Partition}:cloudfront::${Account}:realtime-log-config/${Name}", "response-headers-policy": "arn:$Line truncated
|
||||
"resourceTagKeys": {"access-analyzer": {"Analyzer": ["aws:ResourceTag/"]}, "acm": {"acme-domain-validation": ["aws:ResourceTag/"], "acme-endpoint": ["aws:ResourceTag/"], "acme-external-account-binding": ["aws:ResourceTag/"], "certificate": ["aws:ResourceTag/"]}, "application-autoscaling": {"ScalableTarget": ["aws:ResourceTag/"]}, "athena": {"capacity-reservation": ["aws:ResourceTag/"], "datacatalog": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"], "system-table": ["aws:ResourceTag/"], "workgroup": ["aws:ResourceTag/"]}, "bcm-data-exports": {"billingview": ["aws:ResourceTag/"], "export": ["aws:ResourceTag/"]}, "bcm-pricing-calculator": {"bill-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "budgets": {"budget": ["aws:ResourceTag/"], "budgetAction": ["aws:ResourceTag/"]}, "ce": {"anomalymonitor": ["aws:ResourceTag/"], "anomalysubscription": ["aws:ResourceTag/"], "billingview": ["aws:ResourceTag/"], "costcategory": ["aws:ResourceTag/"]}, "cloudformation": {"changeset": ["aws:ResourceTag/"], "stack": ["aws:ResourceTag/"], "stackset": ["aws:ResourceTag/"]}, "cloudfront": {"anycast-ip-list": ["aws:ResourceTag/"], "connection-function": ["aws:ResourceTag/"], "connection-group": ["aws:ResourceTag/"], "distribution": ["aws:ResourceTag/"], "distribution-tenant": ["aws:ResourceTag/"], "function": ["aws:ResourceTag/"], "key-value-store": ["aws:ResourceTag/"], "streaming-distribution": ["aws:ResourceTag/"], "trust-store": ["aws:ResourceTag/"], "vpcorigin": ["aws:ResourceTag/"]}, "cloudtrail": {"channel": ["aws:ResourceTag/"], "dashboard": ["aws:ResourceTag/"], "eventdatastore": ["aws:ResourceTag/"], "trail": ["aws:ResourceTag/"]}, "codebuild": {"project": ["aws:ResourceTag/"], "report-group": ["aws:ResourceTag/"]}, "codepipeline": {"action": ["aws:ResourceTag/"], "actiontype": ["aws:ResourceTag/"], "pipeline": ["aws:ResourceTag/"], "stage": ["aws:ResourceTag/"], "webhook": ["aws:ResourceTag/"]}, "cognito-identity": {"identitypool": ["aws:ResourceTag/"]}, "cognito-idp": {"userpool": ["aws:ResourceTag/"]}, "controltower": {"EnabledBaseline": ["aws:ResourceTag/"], "EnabledControl": ["aws:ResourceTag/"], "LandingZone": ["aws:ResourceTag/"]}, "datasync": {"agent": ["aws:ResourceTag/"], "discoveryjob": ["aws:ResourceTag/"], "location": ["aws:ResourceTag/"], "storagesystem": ["aws:ResourceTag/"], "task": ["aws:ResourceTag/"], "taskexecution": ["aws:ResourceTag/"]}, "dynamodb": {"index": ["aws:ResourceTag/"], "stream": ["aws:ResourceTag/"], "table": ["aws:ResourceTag/"]}, "ec2": {"application-status-check": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-block": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-manager-data-export": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-cancellation-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-modification-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "carrier-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "client-vpn-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "coip-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "customer-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "declarative-policies-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dedicated-host": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dhcp-options": ["aws:ResourceTag/", "ec2:ResourceTag/"], "egress-only-internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-gpu": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-ip": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-instance-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fpga-image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "host-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image-usage-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-snapshot-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-connect-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-event-window": ["aws:ResourceTag/", "ec2:ResourceTag/"], "internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-external-resource-verification-token": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-internet-registry-association": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-policy": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool-allocation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-resolver": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-resolver-target": ["aws:ResourceTag/", "ec2:Line truncated
|
||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudformation": {"changeset": "arn:${Partition}:cloudformation:${Region}:${Account}:changeSet/${ChangeSetName}/${Id}", "generatedtemplate": "arn:${Partition}:cloudformation:${Region}:${Account}:generatedTemplate/${Id}", "resourcescan": "arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}", "stack": "arn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id}", "stackset": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset/${StackSetName}:${Id}", "stackset-target": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset-target/${StackSetTarget}", "type": "arn:${Partition}:cloudformation:${Region}:${Account}:type/resource/${Type}", "typeHook": "arn:${Partition}:cloudformation:${Region}:${Account}:type/hook/${Type}"}, "cloudfront": {"anycast-ip-list": "arn:${Partition}:cloudfront::${Account}:anycast-ip-list/${Id}", "cache-policy": "arn:${Partition}:cloudfront::${Account}:cache-policy/${Id}", "connection-function": "arn:${Partition}:cloudfront::${Account}:connection-function/${Id}", "connection-group": "arn:${Partition}:cloudfront::${Account}:connection-group/${Id}", "continuous-deployment-policy": "arn:${Partition}:cloudfront::${Account}:continuous-deployment-policy/${Id}", "distribution": "arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}", "distribution-tenant": "arn:${Partition}:cloudfront::${Account}:distribution-tenant/${Id}", "field-level-encryption-config": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-config/${Id}", "field-level-encryption-profile": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-profile/${Id}", "function": "arn:${Partition}:cloudfront::${Account}:function/${Name}", "key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${Name}", "origin-access-control": "arn:${Partition}:cloudfront::${Account}:origin-access-control/${Id}", "origin-access-identity": "arn:${Partition}:cloudfront::${Account}:origin-access-identity/${Id}", "origin-request-policy": "arn:${Partition}:cloudfront::${Account}:origin-request-policy/${Id}", "realtime-log-config": "arn:${Partition}:cloudfront::${Account}:realtime-log-config/${Name}", "response-headers-policy": "arn:$Line truncated
|
||||
"resourceTagKeys": {"access-analyzer": {"Analyzer": ["aws:ResourceTag/"]}, "acm": {"acme-domain-validation": ["aws:ResourceTag/"], "acme-endpoint": ["aws:ResourceTag/"], "acme-external-account-binding": ["aws:ResourceTag/"], "certificate": ["aws:ResourceTag/"]}, "application-autoscaling": {"ScalableTarget": ["aws:ResourceTag/"]}, "athena": {"capacity-reservation": ["aws:ResourceTag/"], "datacatalog": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"], "system-table": ["aws:ResourceTag/"], "workgroup": ["aws:ResourceTag/"]}, "bcm-data-exports": {"billingview": ["aws:ResourceTag/"], "export": ["aws:ResourceTag/"]}, "bcm-pricing-calculator": {"bill-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "budgets": {"budget": ["aws:ResourceTag/"], "budgetAction": ["aws:ResourceTag/"]}, "ce": {"anomalymonitor": ["aws:ResourceTag/"], "anomalysubscription": ["aws:ResourceTag/"], "billingview": ["aws:ResourceTag/"], "costcategory": ["aws:ResourceTag/"]}, "cloudformation": {"changeset": ["aws:ResourceTag/"], "stack": ["aws:ResourceTag/"], "stackset": ["aws:ResourceTag/"]}, "cloudfront": {"anycast-ip-list": ["aws:ResourceTag/"], "connection-function": ["aws:ResourceTag/"], "connection-group": ["aws:ResourceTag/"], "distribution": ["aws:ResourceTag/"], "distribution-tenant": ["aws:ResourceTag/"], "function": ["aws:ResourceTag/"], "key-value-store": ["aws:ResourceTag/"], "streaming-distribution": ["aws:ResourceTag/"], "trust-store": ["aws:ResourceTag/"], "vpcorigin": ["aws:ResourceTag/"]}, "cloudtrail": {"channel": ["aws:ResourceTag/"], "dashboard": ["aws:ResourceTag/"], "eventdatastore": ["aws:ResourceTag/"], "trail": ["aws:ResourceTag/"]}, "codebuild": {"project": ["aws:ResourceTag/"], "report-group": ["aws:ResourceTag/"]}, "codepipeline": {"action": ["aws:ResourceTag/"], "actiontype": ["aws:ResourceTag/"], "pipeline": ["aws:ResourceTag/"], "stage": ["aws:ResourceTag/"], "webhook": ["aws:ResourceTag/"]}, "cognito-identity": {"identitypool": ["aws:ResourceTag/"]}, "cognito-idp": {"userpool": ["aws:ResourceTag/"]}, "controltower": {"EnabledBaseline": ["aws:ResourceTag/"], "EnabledControl": ["aws:ResourceTag/"], "LandingZone": ["aws:ResourceTag/"]}, "datasync": {"agent": ["aws:ResourceTag/"], "discoveryjob": ["aws:ResourceTag/"], "location": ["aws:ResourceTag/"], "storagesystem": ["aws:ResourceTag/"], "task": ["aws:ResourceTag/"], "taskexecution": ["aws:ResourceTag/"]}, "dynamodb": {"index": ["aws:ResourceTag/"], "stream": ["aws:ResourceTag/"], "table": ["aws:ResourceTag/"]}, "ec2": {"application-status-check": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-block": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-manager-data-export": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-cancellation-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-modification-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "carrier-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "client-vpn-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "coip-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "customer-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "declarative-policies-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dedicated-host": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dhcp-options": ["aws:ResourceTag/", "ec2:ResourceTag/"], "egress-only-internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-gpu": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-ip": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-instance-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fpga-image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "host-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image-usage-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-snapshot-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-connect-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-event-window": ["aws:ResourceTag/", "ec2:ResourceTag/"], "internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-external-resource-verification-token": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-internet-registry-association": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-policy": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool-allocation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-resolver": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-resolver-target": ["aws:ResourceTag/", "ec2:Line truncated
|
||||
"resourceKeys": {"ec2": {"capacity-reservation": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:CapacityReservationFleet": {"member": "CapacityReservationFleetId", "arn": "capacity-reservation-fleet"}, "ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:EndDateType": {"member": "EndDateType"}, "ec2:EphemeralStorage": {"member": "EphemeralStorage"}, "ec2:InstanceMatchCriteria": {"member": "InstanceMatchCriteria"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:Tenancy": {"member": "Tenancy"}}, "carrier-gateway": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "dhcp-options": {"ec2:DhcpOptionsID": {"member": "DhcpOptionsId"}}, "fpga-image": {"ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}}, "image": {"ec2:ImageID": {"member": "ImageId"}, "ec2:ImageType": {"member": "ImageType"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "instance": {"ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:InstanceID": {"member": "InstanceId"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "internet-gateway": {"ec2:InternetGatewayID": {"member": "InternetGatewayId"}}, "launch-template": {"ec2:LaunchTemplate": {"member": "LaunchTemplateId", "arn": "launch-template"}}, "network-acl": {"ec2:NetworkAclID": {"member": "NetworkAclId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "network-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:NetworkInterfaceID": {"member": "NetworkInterfaceId"}, "ec2:Subnet": {"member": "SubnetId", "arn": "subnet"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "reserved-instances": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:InstanceType": {"member": "InstanceType"}}, "route-table": {"ec2:RouteTableID": {"member": "RouteTableId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "secondary-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}}, "security-group": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "snapshot": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:SnapshotID": {"member": "SnapshotId"}, "ec2:VolumeSize": {"member": "VolumeSize"}}, "subnet": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:SubnetID": {"member": "SubnetId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "transit-gateway": {"ec2:transitGatewayId": {"member": "TransitGatewayId"}}, "transit-gateway-attachment": {"ec2:transitGatewayAttachmentId": {"member": "TransitGatewayAttachmentId"}}, "transit-gateway-connect-peer": {"ec2:transitGatewayConnectPeerId": {"member": "TransitGatewayConnectPeerId"}}, "transit-gateway-metering-policy": {"ec2:transitGatewayMeteringPolicyId": {"member": "TransitGatewayMeteringPolicyId"}}, "transit-gateway-multicast-domain": {"ec2:transitGatewayMulticastDomainId": {"member": "TransitGatewayMulticastDomainId"}}, "transit-gateway-policy-table": {"ec2:transitGatewayPolicyTableId": {"member": "TransitGatewayPolicyTableId"}}, "transit-gateway-route-table": {"ec2:transitGatewayRouteTableId": {"member": "TransitGatewayRouteTableId"}}, "transit-gateway-route-table-announcement": {"ec2:transitGatewayRouteTableAnnouncementId": {"member": "TransitGatewayRouteTableAnnouncementId"}}, "volume": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:KmsKeyId": {"member": "KmsKeyId"}, "ec2:VolumeID": {"member": "VolumeId"}, "ec2:VolumeInitializationRate": {"member": "VolumeInitializationRate"}, "ec2:VolumeType": {"member": "VolumeType"}}, "vpc": {"ec2:VpcID": {"member": "VpcId"}}, "vpc-peering-connection": {"ec2:VpcPeeringConnectionID": {"member": "VpcPeeringConnectionId"}}}},
|
||||
"unqualified": {"ssm": ["parameter"], "states": ["statemachine"]},
|
||||
"mintedIds": {"events": ["api-destination", "connection"]},
|
||||
@@ -3643,6 +3643,174 @@
|
||||
"ram:UntagResource": {"action": "ram:UntagResource", "types": ["customer-managed-permission", "resource-share"], "resources": [{"types": ["customer-managed-permission", "resource-share"], "arn": "resourceArn"}, {"types": ["customer-managed-permission", "resource-share"], "arn": "resourceShareArn"}, {"type": "resource-share", "fill": {}, "when": {"resourceShareArn": [null]}, "default": true}]},
|
||||
"ram:UpdatePermission": {"action": "ram:UpdatePermission", "types": ["customer-managed-permission"], "resources": []},
|
||||
"ram:UpdateResourceShare": {"action": "ram:UpdateResourceShare", "types": ["resource-share"], "resources": [{"types": ["resource-share"], "arn": "resourceShareArn"}]},
|
||||
"rds:AddRoleToDBCluster": {"action": "rds:AddRoleToDBCluster", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "RoleArn"}, {"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:AddRoleToDBInstance": {"action": "rds:AddRoleToDBInstance", "types": ["db"], "resources": [{"types": ["db"], "arn": "RoleArn"}, {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:AddSourceIdentifierToSubscription": {"action": "rds:AddSourceIdentifierToSubscription", "types": ["es"], "resources": [{"type": "es", "fill": {"SubscriptionName": "SubscriptionName"}}]},
|
||||
"rds:AddTagsToResource": {"action": "rds:AddTagsToResource", "types": ["auto-backup", "cev", "cluster", "cluster-auto-backup", "cluster-endpoint", "cluster-pg", "cluster-snapshot", "db", "db-capacity-reservation", "deployment", "es", "global-cluster", "integration", "og", "pg", "proxy", "proxy-endpoint", "ri", "secgrp", "shardgrp", "snapshot", "snapshot-tenant-database", "subgrp", "target-group", "tenant-database"], "resources": [{"types": ["auto-backup", "cev", "cluster", "cluster-auto-backup", "cluster-endpoint", "cluster-pg", "cluster-snapshot", "db", "db-capacity-reservation", "deployment", "es", "global-cluster", "integration", "og", "pg", "proxy", "proxy-endpoint", "ri", "secgrp", "shardgrp", "snapshot", "snapshot-tenant-database", "subgrp", "target-group", "tenant-database"], "arn": "ResourceName"}]},
|
||||
"rds:ApplyPendingMaintenanceAction": {"action": "rds:ApplyPendingMaintenanceAction", "types": ["cluster", "db"], "resources": []},
|
||||
"rds:AuthorizeDBSecurityGroupIngress": {"action": "rds:AuthorizeDBSecurityGroupIngress", "types": ["secgrp"], "resources": [{"type": "secgrp", "fill": {"SecurityGroupName": "DBSecurityGroupName"}}]},
|
||||
"rds:BacktrackDBCluster": {"action": "rds:BacktrackDBCluster", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:CancelDBCapacityReservation": {"action": "rds:CancelDBCapacityReservation", "types": ["db-capacity-reservation"], "resources": [{"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}]},
|
||||
"rds:CancelExportTask": {"action": "rds:CancelExportTask", "types": [], "resources": []},
|
||||
"rds:CopyDBClusterParameterGroup": {"action": "rds:CopyDBClusterParameterGroup", "types": ["cluster-pg"], "resources": [{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "SourceDBClusterParameterGroupIdentifier"}}]},
|
||||
"rds:CopyDBClusterSnapshot": {"action": "rds:CopyDBClusterSnapshot", "types": ["cluster-snapshot"], "resources": [{"type": "cluster-snapshot", "fill": {"ClusterSnapshotName": "SourceDBClusterSnapshotIdentifier"}}]},
|
||||
"rds:CopyDBParameterGroup": {"action": "rds:CopyDBParameterGroup", "types": ["pg"], "resources": [{"type": "pg", "fill": {"ParameterGroupName": "SourceDBParameterGroupIdentifier"}}]},
|
||||
"rds:CopyDBSnapshot": {"action": "rds:CopyDBSnapshot", "types": ["snapshot"], "resources": [{"type": "snapshot", "fill": {"SnapshotName": "SourceDBSnapshotIdentifier"}}]},
|
||||
"rds:CopyOptionGroup": {"action": "rds:CopyOptionGroup", "types": ["og"], "resources": [{"type": "og", "fill": {"OptionGroupName": "SourceOptionGroupIdentifier"}}]},
|
||||
"rds:CreateBlueGreenDeployment": {"action": "rds:CreateBlueGreenDeployment", "types": ["cluster", "cluster-pg", "db", "deployment", "pg"], "resources": [{"types": ["cluster", "cluster-pg", "db", "deployment", "pg"], "arn": "TargetResourceConfigurations[].SourceArn"}, {"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "TargetDBClusterParameterGroupName"}}, {"type": "deployment", "fill": {}, "made": true}, {"type": "pg", "fill": {"ParameterGroupName": "TargetDBParameterGroupName"}}]},
|
||||
"rds:CreateCustomDBEngineVersion": {"action": "rds:CreateCustomDBEngineVersion", "types": ["cev"], "resources": [{"types": ["cev"], "arn": "SourceCustomDbEngineVersionIdentifier"}, {"type": "cev", "fill": {"CustomDbEngineVersionId": "EngineVersion", "Engine": "Engine", "EngineVersion": "SourceCustomDbEngineVersionIdentifier"}, "unless": {"SourceCustomDbEngineVersionIdentifier": [null]}}]},
|
||||
"rds:CreateDBCapacityReservation": {"action": "rds:CreateDBCapacityReservation", "types": ["db-capacity-reservation"], "resources": [{"type": "db-capacity-reservation", "fill": {}, "find": ["DBCapacityReservationName"]}]},
|
||||
"rds:CreateDBCluster": {"action": "rds:CreateDBCluster", "types": ["cluster", "cluster-pg", "db", "global-cluster", "og", "subgrp"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}, "made": true}, {"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}, {"type": "global-cluster", "fill": {"GlobalCluster": "GlobalClusterIdentifier"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"types": ["cluster", "cluster-pg", "db", "global-cluster", "og", "subgrp"], "arn": "AssociatedRoles[].RoleArn"}, {"types": ["cluster", "cluster-pg", "db", "global-cluster", "og", "subgrp"], "arn": "MonitoringRoleArn"}]},
|
||||
"rds:CreateDBClusterEndpoint": {"action": "rds:CreateDBClusterEndpoint", "types": ["cluster", "cluster-endpoint"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "cluster-endpoint", "fill": {"DbClusterEndpoint": "DBClusterEndpointIdentifier"}, "made": true}]},
|
||||
"rds:CreateDBClusterParameterGroup": {"action": "rds:CreateDBClusterParameterGroup", "types": ["cluster-pg"], "resources": [{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}]},
|
||||
"rds:CreateDBClusterSnapshot": {"action": "rds:CreateDBClusterSnapshot", "types": ["cluster", "cluster-snapshot"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "cluster-snapshot", "fill": {"ClusterSnapshotName": "DBClusterSnapshotIdentifier"}, "made": true}]},
|
||||
"rds:CreateDBInstance": {"action": "rds:CreateDBInstance", "types": ["cluster", "db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}, "made": true}, {"types": ["cluster", "db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "arn": "MonitoringRoleArn"}, {"types": ["cluster", "db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "arn": "TdeCredentialArn"}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}, {"type": "secgrp", "fill": {"SecurityGroupName": "DBSecurityGroups[]"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}, {"types": ["cluster", "db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "arn": "DomainAuthSecretArn"}, {"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}]},
|
||||
"rds:CreateDBInstanceReadReplica": {"action": "rds:CreateDBInstanceReadReplica", "types": ["cluster", "db", "db-capacity-reservation", "og", "pg", "subgrp"], "resources": [{"types": ["cluster", "db", "db-capacity-reservation", "og", "pg", "subgrp"], "arn": "DomainAuthSecretArn"}, {"types": ["cluster", "db", "db-capacity-reservation", "og", "pg", "subgrp"], "arn": "MonitoringRoleArn"}, {"type": "cluster", "fill": {"DbClusterInstanceName": "SourceDBClusterIdentifier"}}, {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:CreateDBParameterGroup": {"action": "rds:CreateDBParameterGroup", "types": ["pg"], "resources": [{"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}]},
|
||||
"rds:CreateDBProxy": {"action": "rds:CreateDBProxy", "types": [], "resources": [], "makes": [{"type": "proxy", "fill": {}}]},
|
||||
"rds:CreateDBProxyEndpoint": {"action": "rds:CreateDBProxyEndpoint", "types": ["proxy", "proxy-endpoint"], "resources": [{"type": "proxy", "fill": {}, "find": ["DBProxyName"]}, {"type": "proxy-endpoint", "fill": {}, "find": ["DBProxyEndpointName"], "made": true}]},
|
||||
"rds:CreateDBSecurityGroup": {"action": "rds:CreateDBSecurityGroup", "types": ["secgrp"], "resources": [{"type": "secgrp", "fill": {"SecurityGroupName": "DBSecurityGroupName"}}]},
|
||||
"rds:CreateDBShardGroup": {"action": "rds:CreateDBShardGroup", "types": ["cluster", "shardgrp"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "shardgrp", "fill": {}, "made": true}]},
|
||||
"rds:CreateDBSnapshot": {"action": "rds:CreateDBSnapshot", "types": ["db", "snapshot"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}, "made": true}]},
|
||||
"rds:CreateDBSubnetGroup": {"action": "rds:CreateDBSubnetGroup", "types": ["subgrp"], "resources": [{"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:CreateEventSubscription": {"action": "rds:CreateEventSubscription", "types": ["es"], "resources": [{"types": ["es"], "arn": "SnsTopicArn"}, {"type": "es", "fill": {"SubscriptionName": "SubscriptionName"}}]},
|
||||
"rds:CreateGlobalCluster": {"action": "rds:CreateGlobalCluster", "types": ["cluster", "global-cluster"], "resources": []},
|
||||
"rds:CreateIntegration": {"action": "rds:CreateIntegration", "types": ["cluster", "db", "integration"], "resources": [{"types": ["cluster", "db", "integration"], "arn": "SourceArn"}, {"types": ["cluster", "db", "integration"], "arn": "TargetArn"}, {"type": "integration", "fill": {}, "find": ["IntegrationName"], "made": true}]},
|
||||
"rds:CreateOptionGroup": {"action": "rds:CreateOptionGroup", "types": ["og"], "resources": [{"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}]},
|
||||
"rds:CreateTenantDatabase": {"action": "rds:CreateTenantDatabase", "types": ["db", "tenant-database"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"type": "tenant-database", "fill": {}, "made": true}]},
|
||||
"rds:DeleteBlueGreenDeployment": {"action": "rds:DeleteBlueGreenDeployment", "types": ["deployment"], "resources": [{"type": "deployment", "fill": {"BlueGreenDeploymentIdentifier": "BlueGreenDeploymentIdentifier"}}]},
|
||||
"rds:DeleteCustomDBEngineVersion": {"action": "rds:DeleteCustomDBEngineVersion", "types": ["cev"], "resources": [{"type": "cev", "fill": {"CustomDbEngineVersionId": "EngineVersion", "Engine": "Engine"}}]},
|
||||
"rds:DeleteDBCluster": {"action": "rds:DeleteDBCluster", "types": ["cluster", "cluster-snapshot"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:DeleteDBClusterAutomatedBackup": {"action": "rds:DeleteDBClusterAutomatedBackup", "types": ["cluster-auto-backup"], "resources": []},
|
||||
"rds:DeleteDBClusterEndpoint": {"action": "rds:DeleteDBClusterEndpoint", "types": ["cluster-endpoint"], "resources": [{"type": "cluster-endpoint", "fill": {"DbClusterEndpoint": "DBClusterEndpointIdentifier"}}]},
|
||||
"rds:DeleteDBClusterParameterGroup": {"action": "rds:DeleteDBClusterParameterGroup", "types": ["cluster-pg"], "resources": [{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}]},
|
||||
"rds:DeleteDBClusterSnapshot": {"action": "rds:DeleteDBClusterSnapshot", "types": ["cluster-snapshot"], "resources": [{"type": "cluster-snapshot", "fill": {"ClusterSnapshotName": "DBClusterSnapshotIdentifier"}}]},
|
||||
"rds:DeleteDBInstance": {"action": "rds:DeleteDBInstance", "types": ["db"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:DeleteDBInstanceAutomatedBackup": {"action": "rds:DeleteDBInstanceAutomatedBackup", "types": ["auto-backup"], "resources": [{"types": ["auto-backup"], "arn": "DBInstanceAutomatedBackupsArn"}]},
|
||||
"rds:DeleteDBParameterGroup": {"action": "rds:DeleteDBParameterGroup", "types": ["pg"], "resources": [{"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}]},
|
||||
"rds:DeleteDBProxy": {"action": "rds:DeleteDBProxy", "types": ["proxy"], "resources": [{"type": "proxy", "fill": {}, "find": ["DBProxyName"]}]},
|
||||
"rds:DeleteDBProxyEndpoint": {"action": "rds:DeleteDBProxyEndpoint", "types": ["proxy-endpoint"], "resources": [{"type": "proxy-endpoint", "fill": {}, "find": ["DBProxyEndpointName"]}]},
|
||||
"rds:DeleteDBSecurityGroup": {"action": "rds:DeleteDBSecurityGroup", "types": ["secgrp"], "resources": [{"type": "secgrp", "fill": {"SecurityGroupName": "DBSecurityGroupName"}}]},
|
||||
"rds:DeleteDBShardGroup": {"action": "rds:DeleteDBShardGroup", "types": ["shardgrp"], "resources": []},
|
||||
"rds:DeleteDBSnapshot": {"action": "rds:DeleteDBSnapshot", "types": ["snapshot"], "resources": [{"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}}]},
|
||||
"rds:DeleteDBSubnetGroup": {"action": "rds:DeleteDBSubnetGroup", "types": ["subgrp"], "resources": [{"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:DeleteEventSubscription": {"action": "rds:DeleteEventSubscription", "types": ["es"], "resources": [{"type": "es", "fill": {"SubscriptionName": "SubscriptionName"}}]},
|
||||
"rds:DeleteGlobalCluster": {"action": "rds:DeleteGlobalCluster", "types": ["global-cluster"], "resources": [{"type": "global-cluster", "fill": {"GlobalCluster": "GlobalClusterIdentifier"}}]},
|
||||
"rds:DeleteIntegration": {"action": "rds:DeleteIntegration", "types": ["integration"], "resources": [{"type": "integration", "fill": {"IntegrationIdentifier": "IntegrationIdentifier"}}]},
|
||||
"rds:DeleteOptionGroup": {"action": "rds:DeleteOptionGroup", "types": ["og"], "resources": [{"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}]},
|
||||
"rds:DeleteTenantDatabase": {"action": "rds:DeleteTenantDatabase", "types": ["db", "tenant-database"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:DeregisterDBProxyTargets": {"action": "rds:DeregisterDBProxyTargets", "types": ["cluster", "db", "proxy", "target-group"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifiers[]"}}, {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifiers[]"}}, {"type": "proxy", "fill": {}, "find": ["DBProxyName"]}, {"type": "target-group", "fill": {}, "find": ["DBProxyName", "TargetGroupName"], "unless": {"TargetGroupName": [null]}}, {"type": "target-group", "fill": {}, "find": ["DBProxyName"], "when": {"TargetGroupName": [null]}}]},
|
||||
"rds:DescribeAccountAttributes": {"action": "rds:DescribeAccountAttributes", "types": [], "resources": []},
|
||||
"rds:DescribeBlueGreenDeployments": {"action": "rds:DescribeBlueGreenDeployments", "types": ["deployment"], "resources": [{"type": "deployment", "fill": {"BlueGreenDeploymentIdentifier": "BlueGreenDeploymentIdentifier"}}]},
|
||||
"rds:DescribeCertificates": {"action": "rds:DescribeCertificates", "types": [], "resources": []},
|
||||
"rds:DescribeDBCapacityReservations": {"action": "rds:DescribeDBCapacityReservations", "types": ["db-capacity-reservation"], "resources": [{"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}]},
|
||||
"rds:DescribeDBClusterAutomatedBackups": {"action": "rds:DescribeDBClusterAutomatedBackups", "types": ["cluster", "cluster-auto-backup"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:DescribeDBClusterBacktracks": {"action": "rds:DescribeDBClusterBacktracks", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:DescribeDBClusterEndpoints": {"action": "rds:DescribeDBClusterEndpoints", "types": ["cluster", "cluster-endpoint"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "cluster-endpoint", "fill": {"DbClusterEndpoint": "DBClusterEndpointIdentifier"}}]},
|
||||
"rds:DescribeDBClusterParameterGroups": {"action": "rds:DescribeDBClusterParameterGroups", "types": ["cluster-pg"], "resources": [{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}]},
|
||||
"rds:DescribeDBClusterParameters": {"action": "rds:DescribeDBClusterParameters", "types": ["cluster-pg"], "resources": [{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}]},
|
||||
"rds:DescribeDBClusterSnapshotAttributes": {"action": "rds:DescribeDBClusterSnapshotAttributes", "types": ["cluster-snapshot"], "resources": [{"type": "cluster-snapshot", "fill": {"ClusterSnapshotName": "DBClusterSnapshotIdentifier"}}]},
|
||||
"rds:DescribeDBClusterSnapshots": {"action": "rds:DescribeDBClusterSnapshots", "types": ["cluster", "cluster-snapshot"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "cluster-snapshot", "fill": {"ClusterSnapshotName": "DBClusterSnapshotIdentifier"}}]},
|
||||
"rds:DescribeDBClusters": {"action": "rds:DescribeDBClusters", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:DescribeDBEngineVersions": {"action": "rds:DescribeDBEngineVersions", "types": [], "resources": []},
|
||||
"rds:DescribeDBInstanceAutomatedBackups": {"action": "rds:DescribeDBInstanceAutomatedBackups", "types": ["auto-backup", "db"], "resources": [{"types": ["auto-backup", "db"], "arn": "DBInstanceAutomatedBackupsArn"}, {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:DescribeDBInstances": {"action": "rds:DescribeDBInstances", "types": ["db"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:DescribeDBLogFiles": {"action": "rds:DescribeDBLogFiles", "types": ["db"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:DescribeDBMajorEngineVersions": {"action": "rds:DescribeDBMajorEngineVersions", "types": [], "resources": []},
|
||||
"rds:DescribeDBParameterGroups": {"action": "rds:DescribeDBParameterGroups", "types": ["pg"], "resources": [{"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}]},
|
||||
"rds:DescribeDBParameters": {"action": "rds:DescribeDBParameters", "types": ["pg"], "resources": [{"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}]},
|
||||
"rds:DescribeDBProxies": {"action": "rds:DescribeDBProxies", "types": ["proxy"], "resources": [{"type": "proxy", "fill": {}, "find": ["DBProxyName"]}]},
|
||||
"rds:DescribeDBProxyEndpoints": {"action": "rds:DescribeDBProxyEndpoints", "types": ["proxy", "proxy-endpoint"], "resources": [{"type": "proxy", "fill": {}, "find": ["DBProxyName"]}, {"type": "proxy-endpoint", "fill": {}, "find": ["DBProxyEndpointName"]}]},
|
||||
"rds:DescribeDBProxyTargetGroups": {"action": "rds:DescribeDBProxyTargetGroups", "types": ["proxy"], "resources": [{"type": "proxy", "fill": {}, "find": ["DBProxyName"]}]},
|
||||
"rds:DescribeDBProxyTargets": {"action": "rds:DescribeDBProxyTargets", "types": ["proxy", "target-group"], "resources": [{"type": "proxy", "fill": {}, "find": ["DBProxyName"]}, {"type": "target-group", "fill": {}, "find": ["DBProxyName", "TargetGroupName"], "unless": {"TargetGroupName": [null]}}, {"type": "target-group", "fill": {}, "find": ["DBProxyName"], "when": {"TargetGroupName": [null]}}]},
|
||||
"rds:DescribeDBRecommendations": {"action": "rds:DescribeDBRecommendations", "types": [], "resources": []},
|
||||
"rds:DescribeDBSecurityGroups": {"action": "rds:DescribeDBSecurityGroups", "types": ["secgrp"], "resources": [{"type": "secgrp", "fill": {"SecurityGroupName": "DBSecurityGroupName"}}]},
|
||||
"rds:DescribeDBShardGroups": {"action": "rds:DescribeDBShardGroups", "types": ["shardgrp"], "resources": []},
|
||||
"rds:DescribeDBSnapshotAttributes": {"action": "rds:DescribeDBSnapshotAttributes", "types": ["snapshot"], "resources": [{"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}}]},
|
||||
"rds:DescribeDBSnapshotTenantDatabases": {"action": "rds:DescribeDBSnapshotTenantDatabases", "types": ["db", "snapshot", "snapshot-tenant-database"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}}]},
|
||||
"rds:DescribeDBSnapshots": {"action": "rds:DescribeDBSnapshots", "types": ["db", "snapshot"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}}]},
|
||||
"rds:DescribeDBSubnetGroups": {"action": "rds:DescribeDBSubnetGroups", "types": ["subgrp"], "resources": [{"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:DescribeEngineDefaultClusterParameters": {"action": "rds:DescribeEngineDefaultClusterParameters", "types": [], "resources": []},
|
||||
"rds:DescribeEngineDefaultParameters": {"action": "rds:DescribeEngineDefaultParameters", "types": [], "resources": []},
|
||||
"rds:DescribeEventCategories": {"action": "rds:DescribeEventCategories", "types": [], "resources": []},
|
||||
"rds:DescribeEventSubscriptions": {"action": "rds:DescribeEventSubscriptions", "types": ["es"], "resources": [{"type": "es", "fill": {"SubscriptionName": "SubscriptionName"}}]},
|
||||
"rds:DescribeEvents": {"action": "rds:DescribeEvents", "types": [], "resources": []},
|
||||
"rds:DescribeExportTasks": {"action": "rds:DescribeExportTasks", "types": ["cluster", "cluster-snapshot", "snapshot"], "resources": [{"types": ["cluster", "cluster-snapshot", "snapshot"], "arn": "SourceArn"}, {"types": ["snapshot"], "through": "ExportTaskIdentifier"}]},
|
||||
"rds:DescribeGlobalClusters": {"action": "rds:DescribeGlobalClusters", "types": ["global-cluster"], "resources": [{"type": "global-cluster", "fill": {"GlobalCluster": "GlobalClusterIdentifier"}}]},
|
||||
"rds:DescribeIntegrations": {"action": "rds:DescribeIntegrations", "types": ["integration"], "resources": [{"type": "integration", "fill": {"IntegrationIdentifier": "IntegrationIdentifier"}}]},
|
||||
"rds:DescribeOptionGroupOptions": {"action": "rds:DescribeOptionGroupOptions", "types": [], "resources": []},
|
||||
"rds:DescribeOptionGroups": {"action": "rds:DescribeOptionGroups", "types": ["og"], "resources": [{"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}]},
|
||||
"rds:DescribeOrderableDBInstanceOptions": {"action": "rds:DescribeOrderableDBInstanceOptions", "types": [], "resources": []},
|
||||
"rds:DescribePendingMaintenanceActions": {"action": "rds:DescribePendingMaintenanceActions", "types": ["cluster", "db"], "resources": []},
|
||||
"rds:DescribeReservedDBInstances": {"action": "rds:DescribeReservedDBInstances", "types": ["ri"], "resources": []},
|
||||
"rds:DescribeReservedDBInstancesOfferings": {"action": "rds:DescribeReservedDBInstancesOfferings", "types": [], "resources": []},
|
||||
"rds:DescribeServerlessV2PlatformVersions": {"action": "rds:DescribeServerlessV2PlatformVersions", "types": [], "resources": []},
|
||||
"rds:DescribeSourceRegions": {"action": "rds:DescribeSourceRegions", "types": [], "resources": []},
|
||||
"rds:DescribeTenantDatabases": {"action": "rds:DescribeTenantDatabases", "types": ["db", "tenant-database"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:DescribeValidDBInstanceModifications": {"action": "rds:DescribeValidDBInstanceModifications", "types": ["db"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:DisableHttpEndpoint": {"action": "rds:DisableHttpEndpoint", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "ResourceArn"}]},
|
||||
"rds:DownloadDBLogFilePortion": {"action": "rds:DownloadDBLogFilePortion", "types": ["db"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:EnableHttpEndpoint": {"action": "rds:EnableHttpEndpoint", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "ResourceArn"}]},
|
||||
"rds:FailoverDBCluster": {"action": "rds:FailoverDBCluster", "types": ["cluster", "db"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "db", "fill": {"DbInstanceName": "TargetDBInstanceIdentifier"}}]},
|
||||
"rds:FailoverGlobalCluster": {"action": "rds:FailoverGlobalCluster", "types": ["cluster", "global-cluster"], "resources": []},
|
||||
"rds:ListTagsForResource": {"action": "rds:ListTagsForResource", "types": ["auto-backup", "cev", "cluster", "cluster-auto-backup", "cluster-endpoint", "cluster-pg", "cluster-snapshot", "db", "db-capacity-reservation", "es", "global-cluster", "integration", "og", "pg", "proxy", "proxy-endpoint", "ri", "secgrp", "shardgrp", "snapshot", "snapshot-tenant-database", "subgrp", "target-group", "tenant-database"], "resources": [{"types": ["auto-backup", "cev", "cluster", "cluster-auto-backup", "cluster-endpoint", "cluster-pg", "cluster-snapshot", "db", "db-capacity-reservation", "es", "global-cluster", "integration", "og", "pg", "proxy", "proxy-endpoint", "ri", "secgrp", "shardgrp", "snapshot", "snapshot-tenant-database", "subgrp", "target-group", "tenant-database"], "arn": "ResourceName"}]},
|
||||
"rds:ModifyActivityStream": {"action": "rds:ModifyActivityStream", "types": ["db"], "resources": [{"types": ["db"], "arn": "ResourceArn"}]},
|
||||
"rds:ModifyCertificates": {"action": "rds:ModifyCertificates", "types": [], "resources": []},
|
||||
"rds:ModifyCurrentDBClusterCapacity": {"action": "rds:ModifyCurrentDBClusterCapacity", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:ModifyCustomDBEngineVersion": {"action": "rds:ModifyCustomDBEngineVersion", "types": ["cev"], "resources": [{"type": "cev", "fill": {"CustomDbEngineVersionId": "EngineVersion", "Engine": "Engine"}}]},
|
||||
"rds:ModifyDBCapacityReservation": {"action": "rds:ModifyDBCapacityReservation", "types": ["db-capacity-reservation"], "resources": [{"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}]},
|
||||
"rds:ModifyDBCluster": {"action": "rds:ModifyDBCluster", "types": ["cluster", "cluster-pg", "og", "pg"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "pg", "fill": {"ParameterGroupName": "DBInstanceParameterGroupName"}}, {"types": ["cluster", "cluster-pg", "og", "pg"], "arn": "MonitoringRoleArn"}]},
|
||||
"rds:ModifyDBClusterEndpoint": {"action": "rds:ModifyDBClusterEndpoint", "types": ["cluster-endpoint"], "resources": [{"type": "cluster-endpoint", "fill": {"DbClusterEndpoint": "DBClusterEndpointIdentifier"}}]},
|
||||
"rds:ModifyDBClusterParameterGroup": {"action": "rds:ModifyDBClusterParameterGroup", "types": ["cluster-pg"], "resources": [{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}]},
|
||||
"rds:ModifyDBClusterSnapshotAttribute": {"action": "rds:ModifyDBClusterSnapshotAttribute", "types": ["cluster-snapshot"], "resources": [{"type": "cluster-snapshot", "fill": {"ClusterSnapshotName": "DBClusterSnapshotIdentifier"}}]},
|
||||
"rds:ModifyDBInstance": {"action": "rds:ModifyDBInstance", "types": ["db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"types": ["db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "arn": "MonitoringRoleArn"}, {"types": ["db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "arn": "TdeCredentialArn"}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}, {"type": "secgrp", "fill": {"SecurityGroupName": "DBSecurityGroups[]"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}, {"types": ["db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "arn": "DomainAuthSecretArn"}, {"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}]},
|
||||
"rds:ModifyDBParameterGroup": {"action": "rds:ModifyDBParameterGroup", "types": ["pg"], "resources": [{"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}]},
|
||||
"rds:ModifyDBProxy": {"action": "rds:ModifyDBProxy", "types": ["proxy"], "resources": [{"types": ["proxy"], "arn": "Auth[].SecretArn"}, {"types": ["proxy"], "arn": "RoleArn"}, {"type": "proxy", "fill": {}, "find": ["DBProxyName"]}]},
|
||||
"rds:ModifyDBProxyEndpoint": {"action": "rds:ModifyDBProxyEndpoint", "types": ["proxy-endpoint"], "resources": []},
|
||||
"rds:ModifyDBProxyTargetGroup": {"action": "rds:ModifyDBProxyTargetGroup", "types": ["target-group"], "resources": [{"type": "target-group", "fill": {}, "find": ["DBProxyName", "TargetGroupName"]}]},
|
||||
"rds:ModifyDBRecommendation": {"action": "rds:ModifyDBRecommendation", "types": [], "resources": []},
|
||||
"rds:ModifyDBShardGroup": {"action": "rds:ModifyDBShardGroup", "types": ["shardgrp"], "resources": []},
|
||||
"rds:ModifyDBSnapshot": {"action": "rds:ModifyDBSnapshot", "types": ["og", "snapshot"], "resources": [{"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}}]},
|
||||
"rds:ModifyDBSnapshotAttribute": {"action": "rds:ModifyDBSnapshotAttribute", "types": ["snapshot"], "resources": [{"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}}]},
|
||||
"rds:ModifyDBSubnetGroup": {"action": "rds:ModifyDBSubnetGroup", "types": ["subgrp"], "resources": [{"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:ModifyEventSubscription": {"action": "rds:ModifyEventSubscription", "types": ["es"], "resources": [{"types": ["es"], "arn": "SnsTopicArn"}, {"type": "es", "fill": {"SubscriptionName": "SubscriptionName"}}]},
|
||||
"rds:ModifyGlobalCluster": {"action": "rds:ModifyGlobalCluster", "types": ["global-cluster"], "resources": [{"type": "global-cluster", "fill": {"GlobalCluster": "GlobalClusterIdentifier"}}]},
|
||||
"rds:ModifyIntegration": {"action": "rds:ModifyIntegration", "types": ["integration"], "resources": [{"type": "integration", "fill": {"IntegrationIdentifier": "IntegrationIdentifier"}}]},
|
||||
"rds:ModifyOptionGroup": {"action": "rds:ModifyOptionGroup", "types": ["og"], "resources": [{"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}]},
|
||||
"rds:ModifyTenantDatabase": {"action": "rds:ModifyTenantDatabase", "types": ["db", "tenant-database"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:PromoteReadReplica": {"action": "rds:PromoteReadReplica", "types": ["db"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:PromoteReadReplicaDBCluster": {"action": "rds:PromoteReadReplicaDBCluster", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:PurchaseReservedDBInstancesOffering": {"action": "rds:PurchaseReservedDBInstancesOffering", "types": ["ri"], "resources": []},
|
||||
"rds:RebootDBCluster": {"action": "rds:RebootDBCluster", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:RebootDBInstance": {"action": "rds:RebootDBInstance", "types": ["db"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:RebootDBShardGroup": {"action": "rds:RebootDBShardGroup", "types": ["shardgrp"], "resources": []},
|
||||
"rds:RegisterDBProxyTargets": {"action": "rds:RegisterDBProxyTargets", "types": ["db", "target-group"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifiers[]"}}, {"type": "target-group", "fill": {}, "find": ["DBProxyName", "TargetGroupName"], "unless": {"TargetGroupName": [null]}}, {"type": "target-group", "fill": {}, "find": ["DBProxyName"], "when": {"TargetGroupName": [null]}}]},
|
||||
"rds:RemoveFromGlobalCluster": {"action": "rds:RemoveFromGlobalCluster", "types": ["cluster", "global-cluster"], "resources": [{"types": ["cluster", "global-cluster"], "arn": "DbClusterIdentifier"}, {"type": "global-cluster", "fill": {"GlobalCluster": "GlobalClusterIdentifier"}}]},
|
||||
"rds:RemoveRoleFromDBCluster": {"action": "rds:RemoveRoleFromDBCluster", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "RoleArn"}, {"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:RemoveRoleFromDBInstance": {"action": "rds:RemoveRoleFromDBInstance", "types": ["db"], "resources": [{"types": ["db"], "arn": "RoleArn"}, {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"rds:RemoveSourceIdentifierFromSubscription": {"action": "rds:RemoveSourceIdentifierFromSubscription", "types": ["es"], "resources": [{"type": "es", "fill": {"SubscriptionName": "SubscriptionName"}}]},
|
||||
"rds:RemoveTagsFromResource": {"action": "rds:RemoveTagsFromResource", "types": ["auto-backup", "cev", "cluster", "cluster-auto-backup", "cluster-endpoint", "cluster-pg", "cluster-snapshot", "db", "db-capacity-reservation", "deployment", "es", "global-cluster", "integration", "og", "pg", "proxy", "proxy-endpoint", "ri", "secgrp", "shardgrp", "snapshot", "snapshot-tenant-database", "subgrp", "target-group", "tenant-database"], "resources": [{"types": ["auto-backup", "cev", "cluster", "cluster-auto-backup", "cluster-endpoint", "cluster-pg", "cluster-snapshot", "db", "db-capacity-reservation", "deployment", "es", "global-cluster", "integration", "og", "pg", "proxy", "proxy-endpoint", "ri", "secgrp", "shardgrp", "snapshot", "snapshot-tenant-database", "subgrp", "target-group", "tenant-database"], "arn": "ResourceName"}]},
|
||||
"rds:ResetDBClusterParameterGroup": {"action": "rds:ResetDBClusterParameterGroup", "types": ["cluster-pg"], "resources": [{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}]},
|
||||
"rds:ResetDBParameterGroup": {"action": "rds:ResetDBParameterGroup", "types": ["pg"], "resources": [{"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}]},
|
||||
"rds:RestoreDBClusterFromS3": {"action": "rds:RestoreDBClusterFromS3", "types": ["cluster", "cluster-pg", "og", "subgrp"], "resources": [{"types": ["cluster", "cluster-pg", "og", "subgrp"], "arn": "AssociatedRoles[].RoleArn"}, {"types": ["cluster", "cluster-pg", "og", "subgrp"], "arn": "S3IngestionRoleArn"}, {"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:RestoreDBClusterFromSnapshot": {"action": "rds:RestoreDBClusterFromSnapshot", "types": ["cluster", "cluster-pg", "cluster-snapshot", "og", "snapshot", "subgrp"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}, {"type": "snapshot", "fill": {}, "find": ["SnapshotIdentifier"]}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"types": ["cluster", "cluster-pg", "cluster-snapshot", "og", "snapshot", "subgrp"], "arn": "AssociatedRoles[].RoleArn"}, {"types": ["cluster", "cluster-pg", "cluster-snapshot", "og", "snapshot", "subgrp"], "arn": "MonitoringRoleArn"}]},
|
||||
"rds:RestoreDBClusterToPointInTime": {"action": "rds:RestoreDBClusterToPointInTime", "types": ["cluster", "cluster-auto-backup", "cluster-pg", "og", "subgrp"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}, {"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"types": ["cluster", "cluster-auto-backup", "cluster-pg", "og", "subgrp"], "arn": "AssociatedRoles[].RoleArn"}, {"types": ["cluster", "cluster-auto-backup", "cluster-pg", "og", "subgrp"], "arn": "MonitoringRoleArn"}]},
|
||||
"rds:RestoreDBInstanceFromDBSnapshot": {"action": "rds:RestoreDBInstanceFromDBSnapshot", "types": ["cluster-snapshot", "db", "db-capacity-reservation", "og", "pg", "snapshot", "subgrp"], "resources": [{"types": ["cluster-snapshot", "db", "db-capacity-reservation", "og", "pg", "snapshot", "subgrp"], "arn": "DomainAuthSecretArn"}, {"types": ["cluster-snapshot", "db", "db-capacity-reservation", "og", "pg", "snapshot", "subgrp"], "arn": "TdeCredentialArn"}, {"type": "cluster-snapshot", "fill": {"ClusterSnapshotName": "DBClusterSnapshotIdentifier"}}, {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}, {"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:RestoreDBInstanceFromS3": {"action": "rds:RestoreDBInstanceFromS3", "types": ["db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "resources": [{"types": ["db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "arn": "MonitoringRoleArn"}, {"types": ["db", "db-capacity-reservation", "og", "pg", "secgrp", "subgrp"], "arn": "S3IngestionRoleArn"}, {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}, {"type": "secgrp", "fill": {"SecurityGroupName": "DBSecurityGroups[]"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:RestoreDBInstanceToPointInTime": {"action": "rds:RestoreDBInstanceToPointInTime", "types": ["auto-backup", "db", "db-capacity-reservation", "og", "pg", "subgrp"], "resources": [{"types": ["auto-backup", "db", "db-capacity-reservation", "og", "pg", "subgrp"], "arn": "DomainAuthSecretArn"}, {"types": ["auto-backup", "db", "db-capacity-reservation", "og", "pg", "subgrp"], "arn": "SourceDBInstanceAutomatedBackupsArn"}, {"types": ["auto-backup", "db", "db-capacity-reservation", "og", "pg", "subgrp"], "arn": "TdeCredentialArn"}, {"type": "db", "fill": {"DbInstanceName": "SourceDBInstanceIdentifier"}}, {"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}, {"type": "og", "fill": {"OptionGroupName": "OptionGroupName"}}, {"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}, {"type": "subgrp", "fill": {"SubnetGroupName": "DBSubnetGroupName"}}]},
|
||||
"rds:RevokeDBSecurityGroupIngress": {"action": "rds:RevokeDBSecurityGroupIngress", "types": ["secgrp"], "resources": [{"type": "secgrp", "fill": {"SecurityGroupName": "DBSecurityGroupName"}}]},
|
||||
"rds:StartActivityStream": {"action": "rds:StartActivityStream", "types": ["cluster", "db"], "resources": [{"types": ["cluster", "db"], "arn": "ResourceArn"}]},
|
||||
"rds:StartDBCluster": {"action": "rds:StartDBCluster", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:StartDBInstance": {"action": "rds:StartDBInstance", "types": ["db", "db-capacity-reservation"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}, "made": true}, {"type": "db-capacity-reservation", "fill": {"DBCapacityReservationIdentifier": "DBCapacityReservationIdentifier"}}]},
|
||||
"rds:StartDBInstanceAutomatedBackupsReplication": {"action": "rds:StartDBInstanceAutomatedBackupsReplication", "types": ["auto-backup", "db"], "resources": [{"types": ["auto-backup", "db"], "arn": "SourceDBInstanceArn"}]},
|
||||
"rds:StartExportTask": {"action": "rds:StartExportTask", "types": ["cluster", "cluster-snapshot", "snapshot"], "resources": [{"types": ["cluster", "cluster-snapshot", "snapshot"], "arn": "IamRoleArn"}, {"types": ["cluster", "cluster-snapshot", "snapshot"], "arn": "SourceArn"}, {"types": ["snapshot"], "through": "ExportTaskIdentifier"}]},
|
||||
"rds:StopActivityStream": {"action": "rds:StopActivityStream", "types": ["cluster", "db"], "resources": [{"types": ["cluster", "db"], "arn": "ResourceArn"}]},
|
||||
"rds:StopDBCluster": {"action": "rds:StopDBCluster", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"DbClusterInstanceName": "DBClusterIdentifier"}}]},
|
||||
"rds:StopDBInstance": {"action": "rds:StopDBInstance", "types": ["db", "snapshot"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}, {"type": "snapshot", "fill": {"SnapshotName": "DBSnapshotIdentifier"}}]},
|
||||
"rds:StopDBInstanceAutomatedBackupsReplication": {"action": "rds:StopDBInstanceAutomatedBackupsReplication", "types": ["db"], "resources": [{"types": ["db"], "arn": "SourceDBInstanceArn"}]},
|
||||
"rds:SwitchoverBlueGreenDeployment": {"action": "rds:SwitchoverBlueGreenDeployment", "types": ["deployment"], "resources": [{"type": "deployment", "fill": {"BlueGreenDeploymentIdentifier": "BlueGreenDeploymentIdentifier"}}]},
|
||||
"rds:SwitchoverGlobalCluster": {"action": "rds:SwitchoverGlobalCluster", "types": ["cluster", "global-cluster"], "resources": []},
|
||||
"rds:SwitchoverReadReplica": {"action": "rds:SwitchoverReadReplica", "types": ["db"], "resources": [{"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}]},
|
||||
"redshift-data:BatchExecuteStatement": {"action": "redshift-data:BatchExecuteStatement", "types": ["cluster", "workgroup"], "resources": [{"types": ["cluster", "workgroup"], "arn": "SecretArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}, {"type": "workgroup", "fill": {}, "find": ["WorkgroupName"]}, {"types": ["cluster", "workgroup"], "through": "SessionId"}]},
|
||||
"redshift-data:CancelStatement": {"action": "redshift-data:CancelStatement", "types": [], "resources": []},
|
||||
"redshift-data:DescribeStatement": {"action": "redshift-data:DescribeStatement", "types": [], "resources": []},
|
||||
|
||||
@@ -104,6 +104,8 @@ class RequestResourceMembersTest {
|
||||
RequestResourceMembers.table().resourceTagKeys().get("secretsmanager").get("Secret"));
|
||||
assertEquals(List.of("aws:ResourceTag/", "ssm:resourceTag/"),
|
||||
RequestResourceMembers.table().resourceTagKeys().get("ssm").get("parameter"));
|
||||
assertEquals(List.of("aws:ResourceTag/", "rds:pg-tag/"),
|
||||
RequestResourceMembers.table().resourceTagKeys().get("rds").get("pg"));
|
||||
ObjectNode document = (ObjectNode) MAPPER.readTree("""
|
||||
{"namespaces":{"example":["example"]},"arnFormats":{"example":{
|
||||
"thing":"arn:${Partition}:example:${Region}:${Account}:thing/${ThingId}"}},
|
||||
@@ -114,7 +116,9 @@ class RequestResourceMembersTest {
|
||||
parse(document.toString()).resourceTagKeys().get("example").get("thing"));
|
||||
for (String invalid : List.of("{\"missing\":[\"vendor:ResourceTag/\"]}",
|
||||
"{\"thing\":\"vendor:ResourceTag/\"}", "{\"thing\":[\"vendor:ResourceTag\"]}",
|
||||
"{\"thing\":[\"vendor:ResourceTag/\",\"vendor:ResourceTag/\"]}")) {
|
||||
"{\"thing\":[\"vendor:ResourceTag/\",\"vendor:ResourceTag/\"]}",
|
||||
"{\"thing\":[\"vendor:thing-tag/\"]}", "{\"thing\":[\"example:other-tag/\"]}",
|
||||
"{\"thing\":[\"example:req-tag/\"]}")) {
|
||||
ObjectNode changed = document.deepCopy();
|
||||
((ObjectNode) changed.path("resourceTagKeys")).set("example", MAPPER.readTree(invalid));
|
||||
assertThrows(IllegalStateException.class, () -> parse(changed.toString()), invalid);
|
||||
@@ -176,6 +180,8 @@ class RequestResourceMembersTest {
|
||||
.collect(Collectors.toSet()),
|
||||
"only the operations listed to read override hand-built operations");
|
||||
assertTrue(table.namespaces().stream().noneMatch(table.notCovered()::contains));
|
||||
assertTrue(table.operations().containsKey("rds:CreateDBParameterGroup"));
|
||||
assertTrue(table.operations().containsKey("rds:CreateDBProxy"));
|
||||
assertTrue(table.otherNamespaces().stream().noneMatch(table.notCovered()::contains));
|
||||
table.operations().forEach((operation, resources) -> {
|
||||
Map<String, ArnFormat> formats = table.formats().get(operation.substring(0, operation.indexOf(':')));
|
||||
@@ -670,7 +676,7 @@ class RequestResourceMembersTest {
|
||||
* {@code ""}).
|
||||
*/
|
||||
private static boolean sharesAMember(Resource resource, Map<Member, String> given) {
|
||||
if (resource.arn() != null || resource.fill().values().stream()
|
||||
if (resource.arn() != null || Stream.concat(resource.fill().values().stream(), resource.find().stream())
|
||||
.noneMatch(member -> given.containsKey(member) && (!resource.arnOf().containsKey(member.path())
|
||||
|| !AwsArnUtils.isArn(given.get(member))))) {
|
||||
return false;
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.core.common.BackupWindows;
|
||||
import io.floci.aws.core.common.RegionResolver;
|
||||
import io.floci.aws.core.storage.AccountAwareStorageBackend;
|
||||
import io.floci.aws.core.storage.InMemoryStorage;
|
||||
import io.floci.aws.core.storage.StorageBackend;
|
||||
import io.floci.aws.core.storage.StorageFactory;
|
||||
import io.floci.aws.services.docdb.container.DocDbContainerManager;
|
||||
@@ -25,6 +26,7 @@ import org.mockito.Mockito;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import static io.floci.aws.testing.Ec2ServiceFixtures.securityGroup;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
@@ -74,6 +76,31 @@ class DocDbServiceTest {
|
||||
rdsService, ec2Service, kmsService);
|
||||
}
|
||||
|
||||
@Test
|
||||
void storedTagsReadLegacyKeysWithoutScanningOrMigrating() {
|
||||
String account = "000000000000";
|
||||
String arn = "arn:aws:rds:us-east-1:" + account + ":cluster:legacy";
|
||||
DocDbCluster cluster = new DocDbCluster();
|
||||
cluster.setDbClusterIdentifier("legacy");
|
||||
cluster.setDbClusterArn(arn);
|
||||
cluster.setTags(Map.of("Owner", "team-a"));
|
||||
InMemoryStorage<String, DocDbCluster> raw = new InMemoryStorage<>();
|
||||
raw.put("legacy", cluster);
|
||||
AccountAwareStorageBackend<DocDbCluster> scoped = Mockito.spy(new AccountAwareStorageBackend<>(raw, null, account));
|
||||
StorageFactory factory = Mockito.mock(StorageFactory.class);
|
||||
when(factory.create(anyString(), anyString(), any())).thenAnswer(inv ->
|
||||
"docdb-clusters.json".equals(inv.getArgument(1)) ? scoped : AccountAwareStorageBackend.inMemory(account));
|
||||
DocDbService service = new DocDbService(Mockito.mock(EmulatorConfig.class), new RegionResolver("us-east-1", account),
|
||||
containerManager, factory, rdsService, ec2Service, kmsService);
|
||||
assertEquals(Optional.of(Map.of("Owner", "team-a")), service.storedResourceTags(arn));
|
||||
assertEquals(Optional.empty(), service.storedResourceTags(arn.replace(":legacy", ":missing")));
|
||||
assertEquals(Optional.empty(), service.storedResourceTags(arn.replace(account, "111111111111")));
|
||||
assertEquals(Optional.empty(), service.storedResourceTags(arn.replace("us-east-1", "us-west-2")));
|
||||
assertEquals(Set.of("legacy"), raw.keys());
|
||||
verify(scoped, never()).scanAllAccountEntries(any());
|
||||
verify(scoped, never()).scanForAccount(anyString(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void createClusterInMockModeSkipsContainer() {
|
||||
DocDbCluster cluster = docDbService.createDbCluster(
|
||||
|
||||
@@ -123,6 +123,41 @@ class ResourceArnBuilderTest {
|
||||
}).when(ctx).setEntityStream(any(InputStream.class));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvSource({"aws,us-east-1", "aws-us-gov,us-gov-west-1", "aws-cn,cn-north-1"})
|
||||
void rdsGroupLifecycleUsesTheNamedGroupAndUnfilteredListsRemainWildcard(String partition, String region) {
|
||||
String prefix = "arn:" + partition + ":rds:" + region + ":" + ACCOUNT + ":";
|
||||
for (String[] group : List.of(new String[]{"DBParameterGroup", "pg"},
|
||||
new String[]{"DBClusterParameterGroup", "cluster-pg"}, new String[]{"DBSubnetGroup", "subgrp"})) {
|
||||
for (String verb : List.of("Create", "Modify", "Delete", "Describe")) {
|
||||
String action = verb + group[0] + ("Describe".equals(verb) ? "s" : "");
|
||||
setFormBody(group[0] + "Name=owned");
|
||||
assertEquals(List.of(prefix + group[1] + ":owned"),
|
||||
builder.buildResources("rds", "rds:" + action, ctx, region, ACCOUNT, partition), action);
|
||||
}
|
||||
setFormBody("");
|
||||
assertEquals(List.of("*"), builder.buildResources("rds", "rds:Describe" + group[0] + "s",
|
||||
ctx, region, ACCOUNT, partition));
|
||||
}
|
||||
for (String action : List.of("AddTagsToResource", "RemoveTagsFromResource", "ListTagsForResource")) {
|
||||
setFormBody("ResourceName=" + prefix + "pg:owned");
|
||||
assertEquals(List.of(prefix + "pg:owned"),
|
||||
builder.buildResources("rds", "rds:" + action, ctx, region, ACCOUNT, partition));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void rdsCreatesAuthorizeEachExplicitDatabaseAndGroupTarget() {
|
||||
String prefix = "arn:aws:rds:us-east-1:" + ACCOUNT + ":";
|
||||
setFormBody("DBClusterIdentifier=db&DBClusterParameterGroupName=parameters&DBSubnetGroupName=subnets");
|
||||
assertEquals(List.of(prefix + "cluster:db", prefix + "cluster-pg:parameters", prefix + "subgrp:subnets"),
|
||||
builder.buildResources("rds", "rds:CreateDBCluster", ctx, "us-east-1", ACCOUNT, "aws"));
|
||||
setFormBody("DBInstanceIdentifier=instance&DBClusterIdentifier=db&DBParameterGroupName=parameters"
|
||||
+ "&DBSubnetGroupName=subnets");
|
||||
assertEquals(List.of(prefix + "cluster:db", prefix + "db:instance", prefix + "pg:parameters", prefix + "subgrp:subnets"),
|
||||
builder.buildResources("rds", "rds:CreateDBInstance", ctx, "us-east-1", ACCOUNT, "aws"));
|
||||
}
|
||||
|
||||
// ── IAM ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,451 @@
|
||||
package io.floci.aws.services.rds;
|
||||
|
||||
import io.floci.aws.core.common.AwsRegions;
|
||||
import io.floci.aws.services.ec2.Ec2Service;
|
||||
import io.floci.aws.testing.AwsTestClients;
|
||||
import io.floci.aws.testing.EnforcementFixtures;
|
||||
import io.floci.aws.testing.PartitionCleanup;
|
||||
import io.floci.aws.testing.RdsIamEnforcementProfile;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.junit.TestProfile;
|
||||
import io.restassured.RestAssured;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.rds.RdsClient;
|
||||
import software.amazon.awssdk.services.rds.model.RdsException;
|
||||
import software.amazon.awssdk.services.rds.model.Tag;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static io.floci.aws.testing.EnforcementFixtures.auth;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
@QuarkusTest
|
||||
@TestProfile(RdsIamEnforcementProfile.class)
|
||||
class RdsResourceIamIntegrationTest {
|
||||
private static final String ACCOUNT = "000000000000";
|
||||
|
||||
@RegisterExtension
|
||||
final PartitionCleanup cleanup = new PartitionCleanup();
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvSource({"pg,us-east-1", "cluster-pg,us-east-1", "subgrp,us-east-1", "db,us-east-1", "cluster,us-east-1",
|
||||
"pg,cn-north-1", "cluster-pg,cn-north-1", "subgrp,cn-north-1", "db,cn-north-1", "cluster,cn-north-1",
|
||||
"pg,us-gov-west-1", "cluster-pg,us-gov-west-1", "subgrp,us-gov-west-1",
|
||||
"db,us-gov-west-1", "cluster,us-gov-west-1"})
|
||||
void exactArnGrantsAndStoredTagsControlTheResourceLifecycle(String type, String regionName) {
|
||||
Region region = Region.of(regionName);
|
||||
String name = "iam-rds-" + UUID.randomUUID().toString().substring(0, 12);
|
||||
String arn = "arn:" + AwsRegions.partitionFor(regionName) + ":rds:" + regionName + ":" + ACCOUNT + ":" + type + ":" + name;
|
||||
String user = "rds-iam-" + UUID.randomUUID();
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":["rds:Create*","rds:AddTagsToResource"],"Resource":"%s",
|
||||
"Condition":{"StringEquals":{"aws:RequestTag/Owner":"team-a"}}},
|
||||
{"Effect":"Allow","Action":["rds:Describe*","rds:ListTagsForResource"],"Resource":"%s"},
|
||||
{"Effect":"Allow","Action":["rds:Delete*","rds:Modify*","rds:AddTagsToResource","rds:RemoveTagsFromResource"],
|
||||
"Resource":"%s","Condition":{"StringEquals":{"aws:ResourceTag/Owner":"team-a"}}}]
|
||||
""".formatted(arn, arn, arn));
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, region);
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), region)) {
|
||||
denied(() -> create(limited, type, name + "-other", regionName, "team-a"));
|
||||
denied(() -> create(limited, type, name, regionName, "team-b"));
|
||||
assertEquals(arn, create(limited, type, name, regionName, "team-a"));
|
||||
try {
|
||||
assertEquals(List.of(tag("Owner", "team-a")), limited.listTagsForResource(r -> r.resourceName(arn)).tagList());
|
||||
modify(limited, type, name, regionName);
|
||||
limited.addTagsToResource(r -> r.resourceName(arn).tags(tag("Review", "ok")));
|
||||
limited.removeTagsFromResource(r -> r.resourceName(arn).tagKeys("Review"));
|
||||
root.addTagsToResource(r -> r.resourceName(arn).tags(tag("Owner", "team-b")));
|
||||
denied(() -> modify(limited, type, name, regionName));
|
||||
denied(() -> delete(limited, type, name));
|
||||
root.addTagsToResource(r -> r.resourceName(arn).tags(tag("Owner", "team-a")));
|
||||
delete(limited, type, name);
|
||||
} finally {
|
||||
try {
|
||||
delete(root, type, name);
|
||||
} catch (RdsException expected) {
|
||||
// Deletion above succeeded, or this finally removes the fixture after an assertion failure.
|
||||
if (!expected.awsErrorDetails().errorCode().contains("NotFound")) {
|
||||
throw expected;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvSource({"pg,aws:ResourceTag/", "cluster-pg,aws:ResourceTag/", "subgrp,aws:ResourceTag/",
|
||||
"pg,rds:pg-tag/", "cluster-pg,rds:cluster-pg-tag/", "subgrp,rds:subgrp-tag/"})
|
||||
void resourceTagGrantsCannotBorrowTagsFromAnotherAccountOrRegion(String type, String prefix) {
|
||||
String name = "iam-tags-" + UUID.randomUUID().toString().substring(0, 12);
|
||||
String user = "rds-tags-" + UUID.randomUUID();
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:ListTagsForResource","Resource":"*",
|
||||
"Condition":{"StringEquals":{"%sOwner":"team-a"}}}]
|
||||
""".formatted(prefix));
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, Region.US_EAST_1);
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), Region.US_EAST_1)) {
|
||||
String arn = create(root, type, name, "us-east-1", "team-a");
|
||||
try {
|
||||
assertEquals(List.of(tag("Owner", "team-a")), limited.listTagsForResource(r -> r.resourceName(arn)).tagList());
|
||||
for (String foreign : List.of(arn.replace(ACCOUNT, "111111111111"),
|
||||
arn.replace("us-east-1", "us-west-2"), arn.replace("arn:aws:", "arn:aws-cn:"), arn + "-absent")) {
|
||||
denied(() -> limited.listTagsForResource(r -> r.resourceName(foreign)));
|
||||
}
|
||||
root.removeTagsFromResource(r -> r.resourceName(arn).tagKeys("Owner"));
|
||||
denied(() -> limited.listTagsForResource(r -> r.resourceName(arn)));
|
||||
} finally {
|
||||
delete(root, type, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvSource({"cluster,cluster-pg,CreateDBCluster", "db,pg,CreateDBInstance"})
|
||||
void aCreateNeedsItsExplicitParameterGroupButTagsOnlyTheNewDatabase(String type, String groupType, String action) {
|
||||
String name = "iam-secondary-" + UUID.randomUUID().toString().substring(0, 12);
|
||||
String arn = "arn:aws:rds:us-east-1:" + ACCOUNT + ":" + type + ":" + name;
|
||||
String user = "rds-secondary-" + UUID.randomUUID();
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, Region.US_EAST_1);
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), Region.US_EAST_1)) {
|
||||
String group = name + "-parameters";
|
||||
String groupArn = create(root, groupType, group, "us-east-1", "team-a");
|
||||
boolean created = false;
|
||||
try {
|
||||
Runnable create = () -> {
|
||||
if ("cluster".equals(type)) {
|
||||
limited.createDBCluster(r -> r.dbClusterIdentifier(name).engine("aurora-postgresql")
|
||||
.dbClusterParameterGroupName(group).masterUsername("admin")
|
||||
.masterUserPassword("Password12345").tags(tag("Owner", "team-a")));
|
||||
} else {
|
||||
limited.createDBInstance(r -> r.dbInstanceIdentifier(name).engine("postgres")
|
||||
.dbParameterGroupName(group).dbInstanceClass("db.t3.micro").allocatedStorage(20)
|
||||
.masterUsername("admin").masterUserPassword("Password12345").tags(tag("Owner", "team-a")));
|
||||
}
|
||||
};
|
||||
String statements = """
|
||||
[{"Effect":"Allow","Action":"rds:%s","Resource":[%s]},
|
||||
{"Effect":"Allow","Action":"rds:AddTagsToResource","Resource":"%s",
|
||||
"Condition":{"StringEquals":{"aws:RequestTag/Owner":"team-a"}}}]
|
||||
""";
|
||||
policy(user, statements.formatted(action, "\"" + arn + "\"", arn));
|
||||
denied(create);
|
||||
policy(user, statements.formatted(action, "\"" + arn + "\",\"" + groupArn + "\"", arn));
|
||||
create.run();
|
||||
created = true;
|
||||
assertEquals(List.of(tag("Owner", "team-a")), root.listTagsForResource(r -> r.resourceName(arn)).tagList());
|
||||
} finally {
|
||||
if (created) {
|
||||
delete(root, type, name);
|
||||
}
|
||||
delete(root, groupType, group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void taggedClusterEndpointHonorsExplicitDeny() {
|
||||
String name = "iam-endpoint-" + UUID.randomUUID().toString().substring(0, 8);
|
||||
String user = "endpoint-reader-" + UUID.randomUUID();
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:ListTagsForResource","Resource":"*"},
|
||||
{"Effect":"Deny","Action":"rds:ListTagsForResource","Resource":"*",
|
||||
"Condition":{"StringEquals":{"aws:ResourceTag/Owner":"team-a"}}}]
|
||||
""");
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, Region.US_EAST_1);
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), Region.US_EAST_1)) {
|
||||
create(root, "cluster", name, "us-east-1", "team-a");
|
||||
try {
|
||||
String arn = root.createDBClusterEndpoint(r -> r.dbClusterIdentifier(name)
|
||||
.dbClusterEndpointIdentifier(name + "-reader").endpointType("READER")
|
||||
.tags(tag("Owner", "team-a"))).dbClusterEndpointArn();
|
||||
try {
|
||||
denied(() -> limited.listTagsForResource(r -> r.resourceName(arn)));
|
||||
root.removeTagsFromResource(r -> r.resourceName(arn).tagKeys("Owner"));
|
||||
assertEquals(List.of(), limited.listTagsForResource(r -> r.resourceName(arn)).tagList());
|
||||
} finally {
|
||||
root.deleteDBClusterEndpoint(r -> r.dbClusterEndpointIdentifier(name + "-reader"));
|
||||
}
|
||||
} finally {
|
||||
delete(root, "cluster", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void documentDbTagsUseTheServiceThatOwnsTheSharedRdsArn() {
|
||||
String name = "iam-docdb-" + UUID.randomUUID().toString().substring(0, 8);
|
||||
String user = "docdb-reader-" + UUID.randomUUID();
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":["rds:ListTagsForResource","rds:DeleteDBCluster"],"Resource":"*"},
|
||||
{"Effect":"Deny","Action":["rds:ListTagsForResource","rds:DeleteDBCluster"],"Resource":"*",
|
||||
"Condition":{"StringEquals":{"rds:cluster-tag/Owner":"team-a"}}}]
|
||||
""");
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, Region.US_EAST_1);
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), Region.US_EAST_1)) {
|
||||
String arn = root.createDBCluster(r -> r.dbClusterIdentifier(name).engine("docdb")
|
||||
.masterUsername("admin").masterUserPassword("Password12345").tags(tag("Owner", "team-a")))
|
||||
.dbCluster().dbClusterArn();
|
||||
try {
|
||||
denied(() -> limited.listTagsForResource(r -> r.resourceName(arn)));
|
||||
denied(() -> limited.deleteDBCluster(r -> r.dbClusterIdentifier(name).skipFinalSnapshot(true)));
|
||||
root.removeTagsFromResource(r -> r.resourceName(arn).tagKeys("Owner"));
|
||||
assertEquals(List.of(), limited.listTagsForResource(r -> r.resourceName(arn)).tagList());
|
||||
} finally {
|
||||
delete(root, "cluster", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"cluster-pg", "pg"})
|
||||
void modifyingAClusterAuthorizesItsExplicitParameterGroups(String type) {
|
||||
String name = "iam-modify-" + UUID.randomUUID().toString().substring(0, 8);
|
||||
String user = "modify-groups-" + UUID.randomUUID();
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, Region.US_EAST_1);
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), Region.US_EAST_1)) {
|
||||
String arn = create(root, "cluster", name, "us-east-1", "team-a");
|
||||
try {
|
||||
String groupArn = create(root, type, name + "-parameters", "us-east-1", "team-a");
|
||||
try {
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:ModifyDBCluster","Resource":"%s"}]
|
||||
""".formatted(arn));
|
||||
Runnable change = () -> limited.modifyDBCluster(r -> {
|
||||
r.dbClusterIdentifier(name);
|
||||
if ("cluster-pg".equals(type)) {
|
||||
r.dbClusterParameterGroupName(name + "-parameters");
|
||||
} else {
|
||||
r.dbInstanceParameterGroupName(name + "-parameters");
|
||||
}
|
||||
});
|
||||
denied(change);
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:ModifyDBCluster","Resource":"*"},
|
||||
{"Effect":"Deny","Action":"rds:ModifyDBCluster","Resource":"%s"}]
|
||||
""".formatted(groupArn));
|
||||
denied(change);
|
||||
} finally {
|
||||
delete(root, type, name + "-parameters");
|
||||
}
|
||||
} finally {
|
||||
delete(root, "cluster", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"us-east-1", "cn-north-1", "us-gov-west-1"})
|
||||
void generatedProxyIdsAndParentScopedTargetGroupsUseStoredArns(String regionName) {
|
||||
String name = "iam-proxy-" + UUID.randomUUID().toString().substring(0, 8);
|
||||
String other = name + "-other";
|
||||
String user = "proxy-user-" + UUID.randomUUID();
|
||||
String prefix = "arn:" + AwsRegions.partitionFor(regionName) + ":";
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, Region.of(regionName));
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), Region.of(regionName))) {
|
||||
for (String proxyName : List.of(name, other)) {
|
||||
root.createDBProxy(r -> r.dbProxyName(proxyName).engineFamily("POSTGRESQL")
|
||||
.roleArn(prefix + "iam::" + ACCOUNT + ":role/proxy")
|
||||
.vpcSubnetIds(Ec2Service.defaultSubnetId(regionName, "a"),
|
||||
Ec2Service.defaultSubnetId(regionName, "b"))
|
||||
.auth(a -> a.authScheme("SECRETS")
|
||||
.secretArn(prefix + "secretsmanager:" + regionName + ":" + ACCOUNT + ":secret:db-AbCdEf"))
|
||||
.tags(tag("Owner", "team-a")));
|
||||
}
|
||||
try {
|
||||
String proxyArn = root.describeDBProxies(r -> r.dbProxyName(name)).dbProxies().getFirst().dbProxyArn();
|
||||
String targetArn = root.describeDBProxyTargetGroups(r -> r.dbProxyName(name))
|
||||
.targetGroups().getFirst().targetGroupArn();
|
||||
String endpointArn = root.createDBProxyEndpoint(r -> r.dbProxyName(name).dbProxyEndpointName(name)
|
||||
.vpcSubnetIds(Ec2Service.defaultSubnetId(regionName, "a"),
|
||||
Ec2Service.defaultSubnetId(regionName, "b"))).dbProxyEndpoint().dbProxyEndpointArn();
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:ModifyDBProxy","Resource":"%s",
|
||||
"Condition":{"StringEquals":{"aws:ResourceTag/Owner":"team-a"}}},
|
||||
{"Effect":"Allow","Action":["rds:ModifyDBProxyTargetGroup","rds:DeregisterDBProxyTargets"],
|
||||
"Resource":["%s","%s"]},
|
||||
{"Effect":"Allow","Action":"rds:DeleteDBProxyEndpoint","Resource":"%s"}]
|
||||
""".formatted(proxyArn, proxyArn, targetArn, endpointArn));
|
||||
limited.modifyDBProxy(r -> r.dbProxyName(name).idleClientTimeout(1200));
|
||||
denied(() -> limited.modifyDBProxy(r -> r.dbProxyName(other).idleClientTimeout(1200)));
|
||||
limited.modifyDBProxyTargetGroup(r -> r.dbProxyName(name).targetGroupName("default")
|
||||
.connectionPoolConfig(c -> c.maxConnectionsPercent(80)));
|
||||
denied(() -> limited.modifyDBProxyTargetGroup(r -> r.dbProxyName(other).targetGroupName("default")
|
||||
.connectionPoolConfig(c -> c.maxConnectionsPercent(80))));
|
||||
// The exact proxy and group grants reach input validation; an unscoped group cannot.
|
||||
RdsException invalid = assertThrows(RdsException.class,
|
||||
() -> limited.deregisterDBProxyTargets(r -> r.dbProxyName(name).targetGroupName("default")));
|
||||
assertEquals("InvalidParameterValue", invalid.awsErrorDetails().errorCode());
|
||||
denied(() -> limited.deregisterDBProxyTargets(r -> r.dbProxyName(other).targetGroupName("default")));
|
||||
RdsException defaultGroup = assertThrows(RdsException.class,
|
||||
() -> limited.deregisterDBProxyTargets(r -> r.dbProxyName(name)));
|
||||
assertEquals("InvalidParameterValue", defaultGroup.awsErrorDetails().errorCode());
|
||||
denied(() -> limited.deregisterDBProxyTargets(r -> r.dbProxyName(other)));
|
||||
limited.deleteDBProxyEndpoint(r -> r.dbProxyEndpointName(name));
|
||||
root.removeTagsFromResource(r -> r.resourceName(proxyArn).tagKeys("Owner"));
|
||||
denied(() -> limited.modifyDBProxy(r -> r.dbProxyName(name).idleClientTimeout(1200)));
|
||||
} finally {
|
||||
root.deleteDBProxy(r -> r.dbProxyName(name));
|
||||
root.deleteDBProxy(r -> r.dbProxyName(other));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void removingAGlobalMemberAuthorizesItsArnWithoutTreatingItAsAName() {
|
||||
String name = "iam-global-" + UUID.randomUUID().toString().substring(0, 8);
|
||||
String user = "global-user-" + UUID.randomUUID();
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, Region.US_EAST_1);
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), Region.US_EAST_1)) {
|
||||
String clusterArn = create(root, "cluster", name, "us-east-1", "team-a");
|
||||
String globalArn = root.createGlobalCluster(r -> r.globalClusterIdentifier(name)
|
||||
.sourceDBClusterIdentifier(clusterArn)).globalCluster().globalClusterArn();
|
||||
try {
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:RemoveFromGlobalCluster","Resource":"%s"}]
|
||||
""".formatted(globalArn));
|
||||
denied(() -> limited.removeFromGlobalCluster(r -> r.globalClusterIdentifier(name)
|
||||
.dbClusterIdentifier(clusterArn)));
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:RemoveFromGlobalCluster","Resource":["%s","%s"]}]
|
||||
""".formatted(globalArn, clusterArn));
|
||||
assertEquals(0, limited.removeFromGlobalCluster(r -> r.globalClusterIdentifier(name)
|
||||
.dbClusterIdentifier(clusterArn)).globalCluster().globalClusterMembers().size());
|
||||
} finally {
|
||||
delete(root, "cluster", name);
|
||||
root.deleteGlobalCluster(r -> r.globalClusterIdentifier(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {false, true})
|
||||
void clusterSnapshotRestoresFindTheStoredSnapshotByNameOrArn(boolean useArn) {
|
||||
String name = "iam-restore-" + UUID.randomUUID().toString().substring(0, 8);
|
||||
String restored = name + "-restored";
|
||||
String user = "restore-user-" + UUID.randomUUID();
|
||||
EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser(cleanup,
|
||||
RestAssured.port, auth(ACCOUNT, "iam"), user);
|
||||
try (RdsClient root = AwsTestClients.create(RdsClient.builder(), ACCOUNT, Region.US_EAST_1);
|
||||
RdsClient limited = AwsTestClients.create(RdsClient.builder(), credentials.accessKeyId(),
|
||||
credentials.secretAccessKey(), Region.US_EAST_1)) {
|
||||
create(root, "cluster", name, "us-east-1", "team-a");
|
||||
String snapshotArn = root.createDBClusterSnapshot(r -> r.dbClusterIdentifier(name)
|
||||
.dbClusterSnapshotIdentifier(name)).dbClusterSnapshot().dbClusterSnapshotArn();
|
||||
String selector = useArn ? snapshotArn : name;
|
||||
String restoredArn = "arn:aws:rds:us-east-1:" + ACCOUNT + ":cluster:" + restored;
|
||||
boolean created = false;
|
||||
try {
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:RestoreDBClusterFromSnapshot","Resource":"%s"}]
|
||||
""".formatted(restoredArn));
|
||||
denied(() -> limited.restoreDBClusterFromSnapshot(r -> r.dbClusterIdentifier(restored)
|
||||
.snapshotIdentifier(selector).engine("aurora-postgresql")));
|
||||
policy(user, """
|
||||
[{"Effect":"Allow","Action":"rds:RestoreDBClusterFromSnapshot","Resource":["%s","%s"]}]
|
||||
""".formatted(restoredArn, snapshotArn));
|
||||
assertEquals(restoredArn, limited.restoreDBClusterFromSnapshot(r -> r.dbClusterIdentifier(restored)
|
||||
.snapshotIdentifier(selector).engine("aurora-postgresql")).dbCluster().dbClusterArn());
|
||||
created = true;
|
||||
} finally {
|
||||
if (created) {
|
||||
delete(root, "cluster", restored);
|
||||
}
|
||||
root.deleteDBClusterSnapshot(r -> r.dbClusterSnapshotIdentifier(name));
|
||||
delete(root, "cluster", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String create(RdsClient client, String type, String name, String region, String owner) {
|
||||
Tag tag = tag("Owner", owner);
|
||||
return switch (type) {
|
||||
case "pg" -> client.createDBParameterGroup(r -> r.dbParameterGroupName(name)
|
||||
.dbParameterGroupFamily("postgres16").description("IAM regression").tags(tag))
|
||||
.dbParameterGroup().dbParameterGroupArn();
|
||||
case "cluster-pg" -> client.createDBClusterParameterGroup(r -> r.dbClusterParameterGroupName(name)
|
||||
.dbParameterGroupFamily("aurora-postgresql16").description("IAM regression").tags(tag))
|
||||
.dbClusterParameterGroup().dbClusterParameterGroupArn();
|
||||
case "subgrp" -> client.createDBSubnetGroup(r -> r.dbSubnetGroupName(name)
|
||||
.dbSubnetGroupDescription("IAM regression").tags(tag)
|
||||
.subnetIds(Ec2Service.defaultSubnetId(region, "a"), Ec2Service.defaultSubnetId(region, "b")))
|
||||
.dbSubnetGroup().dbSubnetGroupArn();
|
||||
case "db" -> client.createDBInstance(r -> r.dbInstanceIdentifier(name).engine("postgres")
|
||||
.dbInstanceClass("db.t3.micro").allocatedStorage(20).masterUsername("admin")
|
||||
.masterUserPassword("Password12345").tags(tag)).dbInstance().dbInstanceArn();
|
||||
case "cluster" -> client.createDBCluster(r -> r.dbClusterIdentifier(name).engine("aurora-postgresql")
|
||||
.masterUsername("admin").masterUserPassword("Password12345").tags(tag)).dbCluster().dbClusterArn();
|
||||
default -> throw new IllegalArgumentException(type);
|
||||
};
|
||||
}
|
||||
|
||||
private static void modify(RdsClient client, String type, String name, String region) {
|
||||
switch (type) {
|
||||
case "pg" -> client.modifyDBParameterGroup(r -> r.dbParameterGroupName(name).parameters(parameter ->
|
||||
parameter.parameterName("log_min_duration_statement").parameterValue("1000").applyMethod("immediate")));
|
||||
case "cluster-pg" -> client.modifyDBClusterParameterGroup(r -> r.dbClusterParameterGroupName(name)
|
||||
.parameters(parameter -> parameter.parameterName("log_min_duration_statement")
|
||||
.parameterValue("1000").applyMethod("immediate")));
|
||||
case "subgrp" -> client.modifyDBSubnetGroup(r -> r.dbSubnetGroupName(name).dbSubnetGroupDescription("updated")
|
||||
.subnetIds(Ec2Service.defaultSubnetId(region, "a"), Ec2Service.defaultSubnetId(region, "b")));
|
||||
case "db" -> client.modifyDBInstance(r -> r.dbInstanceIdentifier(name).backupRetentionPeriod(2));
|
||||
case "cluster" -> client.modifyDBCluster(r -> r.dbClusterIdentifier(name).backupRetentionPeriod(2));
|
||||
default -> throw new IllegalArgumentException(type);
|
||||
}
|
||||
}
|
||||
|
||||
private static void delete(RdsClient client, String type, String name) {
|
||||
switch (type) {
|
||||
case "pg" -> client.deleteDBParameterGroup(r -> r.dbParameterGroupName(name));
|
||||
case "cluster-pg" -> client.deleteDBClusterParameterGroup(r -> r.dbClusterParameterGroupName(name));
|
||||
case "subgrp" -> client.deleteDBSubnetGroup(r -> r.dbSubnetGroupName(name));
|
||||
case "db" -> client.deleteDBInstance(r -> r.dbInstanceIdentifier(name).skipFinalSnapshot(true));
|
||||
case "cluster" -> client.deleteDBCluster(r -> r.dbClusterIdentifier(name).skipFinalSnapshot(true));
|
||||
default -> throw new IllegalArgumentException(type);
|
||||
}
|
||||
}
|
||||
|
||||
private static void policy(String user, String statements) {
|
||||
EnforcementFixtures.putUserPolicy(RestAssured.port, auth(ACCOUNT, "iam"), user, "scope",
|
||||
"{\"Version\":\"2012-10-17\",\"Statement\":" + statements + "}");
|
||||
}
|
||||
|
||||
private static Tag tag(String key, String value) {
|
||||
return Tag.builder().key(key).value(value).build();
|
||||
}
|
||||
|
||||
private static void denied(Runnable call) {
|
||||
RdsException exception = assertThrows(RdsException.class, call::run);
|
||||
assertEquals("AccessDenied", exception.awsErrorDetails().errorCode());
|
||||
}
|
||||
}
|
||||
@@ -232,6 +232,60 @@ class RdsServiceTest {
|
||||
.toList());
|
||||
}
|
||||
|
||||
@Test
|
||||
void storedProxySelectorsAreAccountAndRegionScopedAndDoNotMigrateLegacyKeys() {
|
||||
String account = "123456789012";
|
||||
InMemoryStorage<String, DbProxy> rawProxies = new InMemoryStorage<>();
|
||||
InMemoryStorage<String, DbProxyTargetGroup> rawGroups = new InMemoryStorage<>();
|
||||
DbProxy proxy = persistedProxy("one", "us-east-1", account, "one", 5432);
|
||||
proxy.setTags(new LinkedHashMap<>(Map.of("Owner", "team-a")));
|
||||
DbProxyTargetGroup one = persistedTargetGroup("one", "us-east-1", account, "one");
|
||||
DbProxyTargetGroup two = persistedTargetGroup("two", "us-east-1", account, "two");
|
||||
rawProxies.put("one", proxy);
|
||||
rawGroups.put("one", one);
|
||||
rawGroups.put(account + "/us-east-1::two", two);
|
||||
RdsService service = proxyStoreService(regionResolver, config,
|
||||
new AccountAwareStorageBackend<>(rawProxies, null, account),
|
||||
new AccountAwareStorageBackend<>(rawGroups, null, account),
|
||||
new InMemoryStorage<>(), new InMemoryStorage<>());
|
||||
assertEquals(Optional.of(proxy.getDbProxyArn()), service.findStoredArn("proxy", List.of("one"), "us-east-1"));
|
||||
assertEquals(Optional.of(one.getTargetGroupArn()),
|
||||
service.findStoredArn("target-group", List.of("one", "default"), "us-east-1"));
|
||||
assertEquals(Optional.of(two.getTargetGroupArn()),
|
||||
service.findStoredArn("target-group", List.of("two", "default"), "us-east-1"));
|
||||
assertEquals(Optional.empty(), service.findStoredArn("target-group", List.of("default"), "us-east-1"));
|
||||
assertEquals(Optional.empty(), service.findStoredArn("proxy", List.of("one"), "us-west-2"));
|
||||
assertEquals(Map.of("Owner", "team-a"), service.storedTags(proxy.getDbProxyArn()));
|
||||
assertEquals(Map.of(), service.storedTags(proxy.getDbProxyArn().replace(account, "999999999999")));
|
||||
assertEquals(Set.of("one"), rawProxies.keys());
|
||||
assertEquals(Set.of("one", account + "/us-east-1::two"), rawGroups.keys());
|
||||
RdsService foreign = proxyStoreService(new RegionResolver("us-east-1", "999999999999"), config,
|
||||
new AccountAwareStorageBackend<>(rawProxies, null, account),
|
||||
new AccountAwareStorageBackend<>(rawGroups, null, account),
|
||||
new InMemoryStorage<>(), new InMemoryStorage<>());
|
||||
assertEquals(Optional.empty(), foreign.findStoredArn("proxy", List.of("one"), "us-east-1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void storedIamTagsReadLegacyRecordsWithoutMigratingOrMutatingThem() {
|
||||
String arn = "arn:aws:rds:us-east-1:123456789012:cluster:legacy-tags";
|
||||
InMemoryStorage<String, DbCluster> records = new InMemoryStorage<>();
|
||||
DbCluster cluster = new DbCluster();
|
||||
cluster.setDbClusterIdentifier("legacy-tags");
|
||||
cluster.setDbClusterArn(arn);
|
||||
cluster.setTags(new LinkedHashMap<>(Map.of("Owner", "fixture")));
|
||||
records.put("legacy-tags", cluster);
|
||||
RdsService service = newService(containerManager, proxyManager, new InMemoryStorage<>(),
|
||||
new AccountAwareStorageBackend<>(records, null, "123456789012"),
|
||||
new InMemoryStorage<>(), new InMemoryStorage<>(), new InMemoryStorage<>());
|
||||
Map<String, String> read = service.storedTags(arn);
|
||||
assertEquals(Map.of("Owner", "fixture"), read);
|
||||
read.put("Owner", "changed-copy");
|
||||
assertEquals(Map.of("Owner", "fixture"), cluster.getTags());
|
||||
assertEquals(Set.of("legacy-tags"), records.keys());
|
||||
assertEquals(Map.of(), service.storedTags(arn.replace("123456789012", "999999999999")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void createDbInstanceGeneratesMissingFields() {
|
||||
DbInstance instance = rdsService.createDbInstance("mydb", "postgres", "13",
|
||||
@@ -5103,6 +5157,7 @@ class RdsServiceTest {
|
||||
List.of(), List.of(), true, Map.of("env", "original")).getEventSubscriptionArn();
|
||||
assertEquals("arn:aws-cn:rds:" + region + ":123456789012:es:events", arn);
|
||||
assertEquals(Map.of("env", "original"), rdsService.listTagsForResource(arn, region));
|
||||
assertEquals(Map.of("env", "original"), rdsService.storedTags(arn));
|
||||
rdsService.addTagsToResource(arn, Map.of("env", "changed"), region);
|
||||
assertEquals(Map.of("env", "changed"), rdsService.listTagsForResource(arn, region));
|
||||
String wrongPartition = arn.replace("arn:aws-cn:", "arn:aws:");
|
||||
@@ -5115,6 +5170,7 @@ class RdsServiceTest {
|
||||
assertEquals(Map.of("env", "changed"), rdsService.listTagsForResource(arn, region));
|
||||
rdsService.removeTagsFromResource(arn, List.of("env"), region);
|
||||
assertEquals(Map.of(), rdsService.listTagsForResource(arn, region));
|
||||
assertEquals(Map.of(), rdsService.storedTags(arn));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package io.floci.aws.services.rds;
|
||||
|
||||
import io.floci.aws.services.docdb.DocDbService;
|
||||
import io.floci.aws.services.rds.export.RdsExportTaskService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
class RdsStoredResourceArnsTest {
|
||||
@Test
|
||||
void anUntaggedOwnerDoesNotBorrowTagsFromALegacyArnCollision() {
|
||||
String arn = "arn:aws:rds:us-east-1:000000000000:cluster:shared";
|
||||
RdsService rds = mock(RdsService.class);
|
||||
DocDbService docdb = mock(DocDbService.class);
|
||||
RdsStoredResourceArns lookup = new RdsStoredResourceArns(rds, docdb, mock(RdsExportTaskService.class));
|
||||
when(rds.storedTags(arn)).thenReturn(Map.of("Owner", "rds"));
|
||||
when(docdb.storedResourceTags(arn)).thenReturn(Optional.of(Map.of()));
|
||||
assertEquals(Map.of(), lookup.storedTags(arn));
|
||||
when(docdb.storedResourceTags(arn)).thenReturn(Optional.empty());
|
||||
assertEquals(Map.of("Owner", "rds"), lookup.storedTags(arn));
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import java.time.ZoneOffset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
@@ -26,7 +27,9 @@ import static org.hamcrest.Matchers.hasSize;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
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;
|
||||
import static org.mockito.ArgumentMatchers.argThat;
|
||||
@@ -87,6 +90,26 @@ class RdsExportTaskServiceTest {
|
||||
pending.forEach(Runnable::run);
|
||||
}
|
||||
|
||||
@Test
|
||||
void iamReadsTheStoredExportSourceWithoutStartingWorkOrChangingState() {
|
||||
InMemoryStorage<String, ExportTask> raw = new InMemoryStorage<>();
|
||||
AccountAwareStorageBackend<ExportTask> scoped = new AccountAwareStorageBackend<>(raw, null, ACCOUNT);
|
||||
RdsExportTaskService service = new RdsExportTaskService(scoped, rdsService, s3Service,
|
||||
mock(SnapshotExporter.class), regionResolver, true, CLOCK, workers::add);
|
||||
ExportTask task = new ExportTask();
|
||||
task.setAccountId(ACCOUNT);
|
||||
task.setRegion(REGION);
|
||||
task.setSourceArn(SNAPSHOT_ARN);
|
||||
task.setStatus(ExportTask.STATUS_COMPLETE);
|
||||
raw.put("export-task::us-east-1::legacy", task);
|
||||
assertEquals(Optional.of(SNAPSHOT_ARN), service.storedSourceArn("legacy", REGION));
|
||||
assertEquals(Optional.empty(), service.storedSourceArn("legacy", "us-west-2"));
|
||||
assertEquals(Optional.empty(), service.storedSourceArn("missing", REGION));
|
||||
assertEquals(1, raw.keys().size());
|
||||
assertTrue(workers.isEmpty());
|
||||
assertEquals(ExportTask.STATUS_COMPLETE, task.getStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
void startExportTask_isStartingWithTheSnapshotAndRequestRecorded() {
|
||||
RdsExportTaskService service = service((task, source, progress) -> outcome(0, List.of()));
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package io.floci.aws.testing;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/** Real control-plane authorization with only the database container runtime mocked. */
|
||||
public class RdsIamEnforcementProfile extends IamEnforcementProfile {
|
||||
@Override
|
||||
public Map<String, String> getConfigOverrides() {
|
||||
Map<String, String> overrides = new HashMap<>(super.getConfigOverrides());
|
||||
overrides.put("floci.services.rds.mock", "true");
|
||||
overrides.put("floci.services.docdb.mock", "true");
|
||||
return overrides;
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,8 @@ Beyond the members' names, botocore's shapes and documentation say what a member
|
||||
variable when it is the kind the variable is (a name, an id), and is found by the type's service otherwise
|
||||
(`find`: "The name of the stream processor" for its `${StreamprocessorId}`), the id open when it finds none;
|
||||
one whose documentation's head noun is an ARN ("The Amazon Resource Name (ARN) to which you want to add the tag")
|
||||
holds an ARN, and so does one whose name ends in `ArnList`;
|
||||
holds an ARN, as does a member documented with "This value is an Amazon Resource Name (ARN).",
|
||||
and so does one whose name ends in `ArnList`;
|
||||
- a field of a top-level structure is a member too (`Budget.BudgetName`, `pipeline.name`, a bare field taking the
|
||||
structure's name), and so is a field of each element of a list or value of a map of structures named after a type
|
||||
(`PutEvents`' `Entries[].EventBusName`); a nested field named as an optional top-level member filling the same
|
||||
@@ -278,7 +279,7 @@ NAMESPACES = ("access-analyzer", "account", "acm", "application-autoscaling", "a
|
||||
"datasync", "ec2", "ecr", "ecs", "elasticloadbalancing", "elasticmapreduce", "emr-containers",
|
||||
"emr-serverless", "es", "events",
|
||||
"firehose", "fis", "globalaccelerator", "inspector2", "kinesisanalytics", "macie2", "oam",
|
||||
"payment-cryptography", "quicksight", "ram", "redshift", "redshift-data", "redshift-serverless",
|
||||
"payment-cryptography", "quicksight", "ram", "rds", "redshift", "redshift-data", "redshift-serverless",
|
||||
"rekognition", "resource-explorer-2", "route53", "s3tables", "s3vectors", "servicediscovery",
|
||||
"servicequotas", "ssm", "sso", "states", "textract", "timestream-influxdb", "translate", "signer", "xray",
|
||||
"securityhub", "guardduty", "secretsmanager", "scheduler", "lambda", "cloudformation", "glue")
|
||||
@@ -431,7 +432,6 @@ NOT_COVERED: dict[str, str] = {
|
||||
"mq": _REST,
|
||||
"network-firewall": _LATER,
|
||||
"organizations": _LATER,
|
||||
"rds": _LATER,
|
||||
"rds-data": _REST,
|
||||
"route53resolver": _LATER,
|
||||
"rum": _REST,
|
||||
@@ -573,9 +573,18 @@ def resource_tag_keys(documents: list[dict], formats: dict[str, dict[str, str]])
|
||||
namespace = document["Name"]
|
||||
if namespace not in formats:
|
||||
continue
|
||||
types = {resource["Name"]: sorted({match.group("prefix") for match in map(
|
||||
RESOURCE_TAG_KEY_RE.fullmatch, resource.get("ConditionKeys", [])) if match})
|
||||
for resource in document.get("Resources", []) if resource["Name"] in formats[namespace]}
|
||||
types = {}
|
||||
for resource in document.get("Resources", []):
|
||||
kind = resource["Name"]
|
||||
if kind not in formats[namespace]:
|
||||
continue
|
||||
keys = resource.get("ConditionKeys", [])
|
||||
prefixes = {match.group("prefix") for match in map(RESOURCE_TAG_KEY_RE.fullmatch, keys) if match}
|
||||
# RDS spells its resource-specific keys as the namespace and resource type, e.g. rds:pg-tag/${TagKey}.
|
||||
typed_prefix = f"{namespace}:{kind}-tag/"
|
||||
if typed_prefix + "${TagKey}" in keys or typed_prefix + "tag-key" in keys:
|
||||
prefixes.add(typed_prefix)
|
||||
types[kind] = sorted(prefixes)
|
||||
types = {kind: keys for kind, keys in types.items() if keys}
|
||||
if types:
|
||||
result[namespace] = dict(sorted(types.items()))
|
||||
@@ -764,7 +773,7 @@ def doc_head(lead: str) -> tuple[str, str | None]:
|
||||
of trail, event data store, dashboard, or channel arns" before "whose tags will be listed")."""
|
||||
rest = re.sub(r" (?:of|for)$", "", re.split(r" (?:to|from|whose|that|which|in which|with|associated) ", lead,
|
||||
maxsplit=1)[0])
|
||||
match = re.match(r"^(.*?)(?: (?:of|for) (?:the |a |an )?(.*))?$", rest)
|
||||
match = re.match(r"^(.*?)(?: (?:of|for|identifying) (?:the |a |an )?(.*))?$", rest)
|
||||
head, of = match.group(1).strip(), (match.group(2) or None)
|
||||
if re.search(r"(?:^|\s)list$", head) and of:
|
||||
return f"{head} of {of}", None
|
||||
@@ -840,6 +849,9 @@ def documented_members(models: dict[str, dict], operation: str) -> dict[str, dic
|
||||
element = model["shapes"][item_shape["member"]["shape"]] if item_shape["type"] == "list" else item_shape
|
||||
found.setdefault(path, {"path": path + strings, "nested": "." in path,
|
||||
"lead": _lead(item.get("documentation") or item_shape.get("documentation")),
|
||||
"arnValue": bool(re.search(
|
||||
r"(?:^|\. )this value is an amazon resource name \(arn\)\.",
|
||||
_lead_text(item.get("documentation") or item_shape.get("documentation")))),
|
||||
"pattern": element.get("pattern") or ""})
|
||||
return found
|
||||
|
||||
@@ -920,9 +932,14 @@ def with_documented(operation: str, types: list[str], formats: dict[str, str], m
|
||||
kinds = [kind for kind in types if kind in formats]
|
||||
resources = [dict(resource) for resource in resources]
|
||||
held = {resource["arn"] for resource in resources if "arn" in resource}
|
||||
documented_arns = set()
|
||||
for path, fact in sorted(facts.items()):
|
||||
if fact["nested"] or fact["path"] in held or not kinds or re.search(r"arn(s|list)?$", path, re.IGNORECASE):
|
||||
continue
|
||||
if fact["arnValue"]:
|
||||
resources.insert(0, {"types": kinds, "arn": fact["path"]})
|
||||
documented_arns.add(fact["path"])
|
||||
continue
|
||||
head, of = doc_head(fact["lead"])
|
||||
if re.search(r"(?:arns?|amazon resource names? \(arns?\))$", head) \
|
||||
and not re.search(r"(?:\b(?:name|id|identifier)s?|\)) or\b", head) and (
|
||||
@@ -930,6 +947,11 @@ def with_documented(operation: str, types: list[str], formats: dict[str, str], m
|
||||
or (of is not None and any(doc_names("the name of the " + part.strip(), kind, formats)
|
||||
for part in re.split(r",| or ", of) for kind in kinds))):
|
||||
resources.insert(0, {"types": kinds, "arn": fact["path"]})
|
||||
if " identifying " in fact["lead"]:
|
||||
documented_arns.add(fact["path"])
|
||||
# A member documented as an ARN cannot also fill a name variable of that same target.
|
||||
resources = [resource for resource in resources if not resource.get("fill")
|
||||
or not set(resource["fill"].values()) <= documented_arns]
|
||||
services = {formats[kind].split(":")[2] for kind in kinds}
|
||||
def foreign(path: str) -> bool:
|
||||
fact = facts.get(path.removesuffix("[]"))
|
||||
@@ -974,7 +996,8 @@ def with_documented(operation: str, types: list[str], formats: dict[str, str], m
|
||||
kind_stem = stem(kind)
|
||||
candidates = []
|
||||
for path, fact in sorted(facts.items()):
|
||||
if path in used or re.search(r"arns?$", path, re.IGNORECASE):
|
||||
if path in used or re.search(r"arns?$", path, re.IGNORECASE) \
|
||||
or any(resource.get("through") == fact["path"] for resource in resources):
|
||||
continue
|
||||
field = path.split(".")[-1]
|
||||
effective = stem(path.split(".")[0] if fact["nested"] and field.lower() in BARE else field)
|
||||
@@ -985,6 +1008,9 @@ def with_documented(operation: str, types: list[str], formats: dict[str, str], m
|
||||
candidates.append(("fill", fact["path"]))
|
||||
elif doc_names(fact["lead"], kind, formats):
|
||||
said = doc_kind(fact["lead"]) or kind_of(field)
|
||||
# "Identifier" can mean a name; an explicitly named member cannot fill a generated id.
|
||||
if kind_of(field) == "name" and re.search(r"\bidentifiers?$", doc_head(fact["lead"])[0]):
|
||||
said = "name"
|
||||
if (compatible(said, variable) or (kind_of(variable) == "identifier" and not creating)) \
|
||||
and not (creating and not kind_of(variable)) \
|
||||
and not (creating and said != kind_of(variable) and kind_of(variable) != "identifier"):
|
||||
@@ -1717,7 +1743,15 @@ def resources_for(operation: str, types: list[str], formats: dict[str, str], mem
|
||||
in_slot = slot.group(1) if slot else None
|
||||
fill: dict[str, str] = {}
|
||||
for variable in sorted(variables, key=lambda v: (v == in_slot, kind_of(v) == "", v)):
|
||||
choice = _filling(variable, kind_stem, len(variables), {m: p for m, p in names.items() if m not in fill.values()},
|
||||
# Reserve a member naming a more qualified variable for that type. A cluster parameter group
|
||||
# cannot also fill the instance parameter group's shorter ParameterGroupName variable.
|
||||
qualified = {v for other in types if other != kind for v in VARIABLE_RE.findall(formats.get(other, ""))
|
||||
if stem(variable) and v not in KNOWN_VARIABLES and stem(v) != stem(variable)
|
||||
and stem(v).endswith(stem(variable))}
|
||||
eligible = {m: p for m, p in names.items() if m not in fill.values()
|
||||
and not ("." not in p and not p.endswith("[]")
|
||||
and any(stem(m).endswith(stem(v)) and compatible(m, v) for v in qualified))}
|
||||
choice = _filling(variable, kind_stem, len(variables), eligible,
|
||||
bare=bare, aliased=aliased, word_stem=word_stem,
|
||||
shapes=shapes if not held else None)
|
||||
if choice is not None:
|
||||
@@ -1757,7 +1791,8 @@ ACCOUNT_SLOT_RE = re.compile(r"^arn:\$\{Partition}:[^:]*:[^:]*:\$\{(\w+)}:")
|
||||
def with_made(resources: list[dict], operation: str, formats: dict[str, str]) -> list[dict]:
|
||||
"""The resources, those a create makes marked `made` when it names others too (the pipeline a webhook connects
|
||||
to, the namespace a service is created in), so that its tags are checked on what it makes alone: of a type, or
|
||||
with an ARN format's leading resource word, related to the operation's name past its verb. A member that may hold
|
||||
with an ARN format's leading resource word, related to the operation's name past its verb, or with its sole
|
||||
resource variable named after that operation's subject (`db:${DbInstanceName}`). A member that may hold
|
||||
an ARN of several types is made only when every one of them is: one that may name the parent too (a subscriber's
|
||||
`EventBusArn`) names a resource the create does not make."""
|
||||
name = operation.split(":", 1)[1]
|
||||
@@ -1767,7 +1802,10 @@ def with_made(resources: list[dict], operation: str, formats: dict[str, str]) ->
|
||||
|
||||
def is_created(kind: str) -> bool:
|
||||
word = RESOURCE_PART_RE.match(formats.get(kind, ""))
|
||||
return related(created, stem(kind)) or (word is not None and related(created, stem(word.group(1))))
|
||||
variables = [variable for variable in VARIABLE_RE.findall(formats.get(kind, ""))
|
||||
if variable not in KNOWN_VARIABLES]
|
||||
return (related(created, stem(kind)) or (word is not None and related(created, stem(word.group(1))))
|
||||
or len(variables) == 1 and stem(variables[0]) == created)
|
||||
|
||||
def makes(resource: dict) -> bool:
|
||||
return all(is_created(kind) for kind in _kinds(resource))
|
||||
@@ -2318,6 +2356,7 @@ def read_resources(operation: str, types: list[str], formats: dict[str, str], mo
|
||||
requested_members(models)),
|
||||
types, members, through_members(models, formats))
|
||||
resources = with_documented(operation, types, formats, models, resources)
|
||||
resources = with_find_scope(resources, models, name, formats)
|
||||
resources = with_typed_targets(resources, formats, typed_target_fields(models, name))
|
||||
resources = with_integer_members(resources, formats, models, name)
|
||||
resources = with_minted_names(operation, resources, formats, models)
|
||||
@@ -2849,6 +2888,41 @@ def with_found(resources: list[dict], types: list[str], formats: dict[str, str],
|
||||
return found + [{"type": kind, "fill": {}, "find": list(by)} for kind, by in by_kind.items()]
|
||||
|
||||
|
||||
def with_find_scope(resources: list[dict], models: dict[str, dict], operation: str,
|
||||
formats: dict[str, str]) -> list[dict]:
|
||||
"""A found name is scoped by a request member its record says is associated with that resource."""
|
||||
members = request_members(models, operation)
|
||||
found = []
|
||||
for resource in resources:
|
||||
if "find" not in resource:
|
||||
found.append(resource)
|
||||
continue
|
||||
scope = set()
|
||||
for model in models.values():
|
||||
for shape_name, shape in model["shapes"].items():
|
||||
fields = shape.get("members", {}) if shape.get("type") == "structure" else {}
|
||||
if not stem(shape_name).endswith(stem(resource["type"])) \
|
||||
or any(stem(member) == stem(shape_name) for member in resource["find"]) \
|
||||
or not all(member in fields for member in resource["find"]):
|
||||
continue
|
||||
for member, spec in fields.items():
|
||||
associated = re.search(r"\bassociated with (?:this|the) (.+)$", _lead(spec.get("documentation")))
|
||||
if member in members and member not in resource["find"] and associated \
|
||||
and stem(member) and stem(shape_name).startswith(stem(member)) \
|
||||
and stem(shape_name) != stem(member) \
|
||||
and doc_names("the name of the " + associated.group(1), resource["type"], formats):
|
||||
scope.add(member)
|
||||
scoped = dict(resource, find=sorted(scope) + resource["find"])
|
||||
if scope and len(resource["find"]) == 1 and resource["find"][0] in optional_members(models, operation):
|
||||
absent = {resource["find"][0]: [None]}
|
||||
found.append(dict(scoped, unless=absent))
|
||||
# With no child name, the handler uses its default child of the explicitly named parent.
|
||||
found.append(dict(resource, find=sorted(scope), when=absent))
|
||||
else:
|
||||
found.append(scoped)
|
||||
return found
|
||||
|
||||
|
||||
def requested_members(models: dict[str, dict]) -> set[str]:
|
||||
"""Every top-level member of every request of the clients given."""
|
||||
return {member for model in models.values() for spec in model["operations"].values() if "input" in spec
|
||||
@@ -2917,6 +2991,15 @@ def through_members(models: dict[str, dict], formats: dict[str, str]) -> dict[st
|
||||
for known, kind in stems.items() if related(stem(field), known)}
|
||||
if kinds:
|
||||
found.setdefault(member, set()).update(kinds)
|
||||
source = fields.get("SourceArn")
|
||||
if source is not None:
|
||||
head, of = doc_head(_lead(source.get("documentation")))
|
||||
if of and re.search(r"(?:arn|amazon resource name \(arn\))$", head):
|
||||
kinds = {kind for kind in formats for phrase in re.split(r",| or ", of)
|
||||
if doc_names("the name of the " + phrase.strip(), kind, formats)}
|
||||
for member in fields:
|
||||
if kinds and kind_of(member) == "identifier" and stem(member) == stem(shape_name):
|
||||
found.setdefault(member, set()).update(kinds)
|
||||
for member, kinds in documented_through(models, formats).items():
|
||||
found.setdefault(member, set()).update(kinds)
|
||||
return {member: sorted(kinds) for member, kinds in sorted(found.items())}
|
||||
@@ -3257,7 +3340,8 @@ def validate(document: dict) -> list[str]:
|
||||
if not isinstance(tag_keys, dict) or any(
|
||||
not isinstance(kinds, dict) or any(kind not in formats.get(namespace, {})
|
||||
or not isinstance(keys, list) or not all(isinstance(key, str) for key in keys) or keys != sorted(set(keys))
|
||||
or any(not isinstance(key, str) or not re.fullmatch(r"[a-z0-9-]+:(?i:ResourceTag)/", key) for key in keys)
|
||||
or any(not isinstance(key, str) or (not re.fullmatch(r"[a-z0-9-]+:(?i:ResourceTag)/", key)
|
||||
and key != f"{namespace}:{kind}-tag/") for key in keys)
|
||||
for kind, keys in kinds.items()) for namespace, kinds in tag_keys.items()):
|
||||
problems.append("resourceTagKeys is not stored-tag prefixes for supported resource types")
|
||||
resource_keys_document = document.get("resourceKeys", {})
|
||||
|
||||
@@ -2254,6 +2254,58 @@ def test_eip_operations_read_scalar_targets_from_models(operation, members, kind
|
||||
assert entry["resources"] == [{"type": kind, "fill": {variables[kind]: variables[kind]}} for kind in kinds]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("documentation,expected", [
|
||||
("<p>The resource to tag. This value is an Amazon Resource Name (ARN).</p>", True),
|
||||
("<p>This value is an Amazon Resource Name (ARN).</p>", True),
|
||||
("<p>The resource to tag. This value is an Amazon Resource Name (ARN) or a name.</p>", False),
|
||||
("<p>The resource to tag. This value can be an Amazon Resource Name (ARN).</p>", False),
|
||||
("<p>The resource to tag. Its parent is an Amazon Resource Name (ARN).</p>", False),
|
||||
])
|
||||
def test_an_explicit_arn_value_sentence_identifies_the_request_resource(documentation, expected):
|
||||
modeled = model({"AddTagsToResource": {"ResourceName": "String"}}, protocol="query")
|
||||
modeled["shapes"]["AddTagsToResourceIn"]["members"]["ResourceName"]["documentation"] = documentation
|
||||
result = r.with_documented("svc:AddTagsToResource", ["thing", "pool"], FORMATS, {"svc": modeled}, [])
|
||||
assert result == ([{"types": ["thing", "pool"], "arn": "ResourceName"}] if expected else [])
|
||||
|
||||
|
||||
def test_a_creates_subject_can_be_its_sole_arn_variable_for_an_abbreviated_type():
|
||||
formats = {"db": "arn:${Partition}:svc:${Region}:${Account}:db:${DbInstanceName}",
|
||||
"pg": "arn:${Partition}:svc:${Region}:${Account}:pg:${ParameterGroupName}"}
|
||||
database = {"type": "db", "fill": {"DbInstanceName": "DBInstanceIdentifier"}}
|
||||
group = {"type": "pg", "fill": {"ParameterGroupName": "DBParameterGroupName"}}
|
||||
assert r.with_made([database, group], "svc:CreateDBInstance", formats) == [dict(database, made=True), group]
|
||||
assert r.with_made([database, group], "svc:ModifyDBInstance", formats) == [database, group]
|
||||
|
||||
|
||||
def test_resource_type_tag_prefixes_require_the_documented_namespace_and_type():
|
||||
formats = {"rds": {"pg": "arn:${Partition}:rds:${Region}:${Account}:pg:${PgName}"}}
|
||||
documents = [{"Name": "rds", "Resources": [{"Name": "pg", "ConditionKeys": [
|
||||
"aws:ResourceTag/${TagKey}", "rds:pg-tag/${TagKey}", "rds:pg-tag/tag-key",
|
||||
"rds:req-tag/${TagKey}", "rds:db-tag/${TagKey}", "other:pg-tag/${TagKey}", "rds:pg-tag/Owner"]}]}]
|
||||
assert r.resource_tag_keys(documents, formats) == {"rds": {"pg": ["aws:ResourceTag/", "rds:pg-tag/"]}}
|
||||
|
||||
|
||||
def test_distinct_qualified_parameter_groups_do_not_collapse_to_one_ambiguous_member():
|
||||
formats = {"cluster-pg": "arn:${Partition}:rds:${Region}:${Account}:cluster-pg:${ClusterParameterGroupName}",
|
||||
"pg": "arn:${Partition}:rds:${Region}:${Account}:pg:${ParameterGroupName}"}
|
||||
assert r.resources_for("rds:ModifyDBCluster", ["cluster-pg", "pg"], formats,
|
||||
members("DBClusterParameterGroupName", "DBInstanceParameterGroupName")) == [
|
||||
{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}},
|
||||
{"type": "pg", "fill": {"ParameterGroupName": "DBInstanceParameterGroupName"}}]
|
||||
assert r.resources_for("rds:ModifyDBCluster", ["cluster-pg", "pg"], formats,
|
||||
members("DBClusterParameterGroupName")) == [
|
||||
{"type": "cluster-pg", "fill": {"ClusterParameterGroupName": "DBClusterParameterGroupName"}}]
|
||||
|
||||
|
||||
def test_a_shorter_member_is_not_reserved_for_a_more_qualified_variable():
|
||||
formats = {"subnet": "arn:${Partition}:ec2:${Region}:${Account}:subnet/${SubnetId}",
|
||||
"secondary-subnet": "arn:${Partition}:ec2:${Region}:${Account}:secondary-subnet/${SecondarySubnetId}"}
|
||||
assert r.resources_for("ec2:RunInstances", ["subnet", "secondary-subnet"], formats,
|
||||
members("SubnetId", "SecondarySubnetId")) == [
|
||||
{"type": "subnet", "fill": {"SubnetId": "SubnetId"}},
|
||||
{"type": "secondary-subnet", "fill": {"SecondarySubnetId": "SecondarySubnetId"}}]
|
||||
|
||||
|
||||
QUALIFIED_FORMATS = {"function": "arn:${Partition}:svc:${Region}:${Account}:function:${FunctionName}",
|
||||
"function alias": "arn:${Partition}:svc:${Region}:${Account}:function:${FunctionName}:${Alias}",
|
||||
"function version": "arn:${Partition}:svc:${Region}:${Account}:function:${FunctionName}:${Version}"}
|
||||
@@ -2427,3 +2479,60 @@ def test_a_create_acting_on_other_types_alone_tags_what_it_makes_when_it_names_i
|
||||
# One whose request does not name every variable of what it makes leaves it to the action's own resources.
|
||||
formats["widget"] = "arn:${Partition}:svc:${Region}:${Account}:widget/${WidgetName}/${WidgetId}"
|
||||
assert r.makes_for("svc:CreateWidget", ["kind"], formats, members("KindName"), models=widget_model(True)) == []
|
||||
|
||||
|
||||
def test_an_arn_identifying_a_type_is_not_read_as_its_name():
|
||||
modeled = model({"RemoveFromPool": {"ThingIdentifier": "String"}}, protocol="query")
|
||||
modeled["shapes"]["RemoveFromPoolIn"]["members"]["ThingIdentifier"]["documentation"] = (
|
||||
"<p>The Amazon Resource Name (ARN) identifying the thing that was detached from the pool.</p>")
|
||||
result = r.with_documented("svc:RemoveFromPool", ["thing"], FORMATS, {"svc": modeled}, [])
|
||||
assert result == [{"types": ["thing"], "arn": "ThingIdentifier"}]
|
||||
|
||||
|
||||
def test_a_name_documented_as_an_identifier_finds_a_generated_id():
|
||||
formats = {"proxy": "arn:${Partition}:svc:${Region}:${Account}:proxy:${ProxyId}"}
|
||||
modeled = model({"ModifyProxy": {"ProxyName": "String"}}, protocol="query")
|
||||
modeled["shapes"]["ModifyProxyIn"]["members"]["ProxyName"]["documentation"] = (
|
||||
"<p>The identifier for the proxy to modify.</p>")
|
||||
assert r.with_documented("svc:ModifyProxy", ["proxy"], formats, {"svc": modeled}, []) == [
|
||||
{"type": "proxy", "fill": {}, "find": ["ProxyName"]}]
|
||||
|
||||
|
||||
def test_an_arn_identifying_a_type_replaces_the_identifier_name_mapping():
|
||||
modeled = model({"RemoveFromPool": {"ThingIdentifier": "String"}}, protocol="query")
|
||||
modeled["shapes"]["RemoveFromPoolIn"]["members"]["ThingIdentifier"]["documentation"] = (
|
||||
"<p>The Amazon Resource Name (ARN) identifying the thing that was detached from the pool.</p>")
|
||||
modeled["shapes"]["RemoveFromPoolIn"]["required"] = ["ThingIdentifier"]
|
||||
assert r.read_resources("svc:RemoveFromPool", ["thing"], FORMATS, {"svc": modeled}) == [
|
||||
{"types": ["thing"], "arn": "ThingIdentifier"}]
|
||||
|
||||
|
||||
def test_a_found_child_name_is_scoped_by_its_records_associated_parent():
|
||||
formats = {"group": "arn:${Partition}:svc:${Region}:${Account}:group:${GroupId}"}
|
||||
modeled = model({"ModifyGroup": {"ProxyName": "String", "GroupName": "String"}}, protocol="query")
|
||||
modeled["shapes"]["ProxyGroup"] = {"type": "structure", "members": {
|
||||
"GroupName": {"shape": "String"}, "ProxyName": {"shape": "String", "documentation":
|
||||
"<p>The identifier for the proxy associated with this group.</p>"}}}
|
||||
modeled["shapes"]["ModifyGroupIn"]["required"] = ["GroupName", "ProxyName"]
|
||||
resources = [{"type": "group", "fill": {}, "find": ["GroupName"]}]
|
||||
assert r.with_find_scope(resources, {"svc": modeled}, "ModifyGroup", formats) == [
|
||||
{"type": "group", "fill": {}, "find": ["ProxyName", "GroupName"]}]
|
||||
modeled["shapes"]["ModifyGroupIn"]["required"] = ["ProxyName"]
|
||||
assert r.with_find_scope(resources, {"svc": modeled}, "ModifyGroup", formats) == [
|
||||
{"type": "group", "fill": {}, "find": ["ProxyName", "GroupName"], "unless": {"GroupName": [None]}},
|
||||
{"type": "group", "fill": {}, "find": ["ProxyName"], "when": {"GroupName": [None]}}]
|
||||
# A fully named record, such as a proxy endpoint, already has its independent key.
|
||||
modeled["shapes"]["ProxyGroup"]["members"]["ProxyGroupName"] = {"shape": "String"}
|
||||
independently_named = [{"type": "group", "fill": {}, "find": ["ProxyGroupName"]}]
|
||||
assert r.with_find_scope(independently_named, {"svc": modeled}, "ModifyGroup", formats) == independently_named
|
||||
modeled["shapes"]["OtherGroup"] = modeled["shapes"].pop("ProxyGroup")
|
||||
assert r.with_find_scope(resources, {"svc": modeled}, "ModifyGroup", formats) == resources
|
||||
|
||||
|
||||
def test_a_task_identifier_reaches_the_source_arn_its_record_documents():
|
||||
modeled = model({"DescribeExports": {"ExportTaskIdentifier": "String"}}, protocol="query")
|
||||
modeled["shapes"]["ExportTask"] = {"type": "structure", "members": {
|
||||
"ExportTaskIdentifier": {"shape": "String"}, "SourceArn": {"shape": "String", "documentation":
|
||||
"<p>The Amazon Resource Name (ARN) of the thing that was exported to storage.</p>"}}}
|
||||
assert r.read_resources("svc:DescribeExports", ["thing"], FORMATS, {"svc": modeled}) == [
|
||||
{"types": ["thing"], "through": "ExportTaskIdentifier"}]
|
||||
Reference in new issue
Block a user