diff --git a/docs/services/iam.md b/docs/services/iam.md
index df5e28815f..f7fe908c9e 100644
--- a/docs/services/iam.md
+++ b/docs/services/iam.md
@@ -3201,8 +3201,9 @@ floci populates:
snapshot schedules, event subscriptions and integrations, SSM for its parameters, documents and associations,
EMR for its clusters, CloudFront for every resource it tags, by its ARN, IAM Identity Center for its instances,
permission sets, applications and trusted token issuers, OAM for its sinks and links, RAM for its resource shares,
- Payment Cryptography for its keys, Resource Explorer for its indexes and views, and Application Auto Scaling for
- its scalable targets. Tag keys differing only in case are one condition key holding every value.
+ Payment Cryptography for its keys, Resource Explorer for its indexes and views, Application Auto Scaling for its
+ scalable targets, and ECS for its clusters, task definitions, services, capacity providers, tasks and container
+ instances. Tag keys differing only in case are one condition key holding every value.
- EC2 resource keys such as a network interface's `ec2:Vpc`, `ec2:Subnet`, `ec2:AvailabilityZone` and
`ec2:NetworkInterfaceID`: for every action on a resource EC2 holds, the members of the resource the
key names, an ARN for a key the Service Reference types as one. `resourceKeys` in
diff --git a/src/main/java/io/floci/aws/core/common/StoredResourceArns.java b/src/main/java/io/floci/aws/core/common/StoredResourceArns.java
index 1ebad35bac..91dcb86ed1 100644
--- a/src/main/java/io/floci/aws/core/common/StoredResourceArns.java
+++ b/src/main/java/io/floci/aws/core/common/StoredResourceArns.java
@@ -42,9 +42,11 @@ import java.util.Optional;
* and the tags of a cluster, a snapshot, a parameter group, a subnet group, a snapshot copy grant, a snapshot
* schedule, an event subscription or an integration; SSM, for the parameter a legacy ARN names, the document of
* another account an association runs and the tags of a parameter, a document or an association; CloudFront, for the
- * key value store a name names and the tags of any resource it tags); looked up lazily by {@code ResourceArnBuilder}
- * and {@code IamConditionContextResolver} through {@code Instance} for the namespace a request or
- * an ARN is of, so IAM never depends on that service directly.
+ * key value store a name names and the tags of any resource it tags; ECS, for the revision a task definition
+ * reference resolves to, its default cluster and the tags of a cluster, a task definition, a service, a capacity
+ * provider, a task or a container instance); looked up lazily by {@code ResourceArnBuilder} and
+ * {@code IamConditionContextResolver} through {@code Instance} for the namespace a request or an
+ * ARN is of, so IAM never depends on that service directly.
*
* Each answer is a lookup of what the service holds, asked for by an entry of the generated table ({@code find},
* {@code through}, a default, {@code forwarded}, a type's {@code resourceTagKeys}): never a fact about what an operation acts on, which the table alone
diff --git a/src/main/java/io/floci/aws/services/ecs/EcsService.java b/src/main/java/io/floci/aws/services/ecs/EcsService.java
index 1e0c8636cc..a020342e0c 100644
--- a/src/main/java/io/floci/aws/services/ecs/EcsService.java
+++ b/src/main/java/io/floci/aws/services/ecs/EcsService.java
@@ -15,6 +15,7 @@ import io.floci.aws.core.resource.ResourceProvider;
import io.floci.aws.core.resource.SupportedResourceType;
import io.floci.aws.core.storage.AccountAwareStorageBackend;
import io.floci.aws.core.storage.StorageBackedMap;
+import io.floci.aws.core.storage.StorageBackend;
import io.floci.aws.core.storage.StorageFactory;
import io.floci.aws.services.cloudwatch.metrics.CloudWatchMetricsService;
import io.floci.aws.services.cloudwatch.metrics.model.Dimension;
@@ -171,8 +172,10 @@ public class EcsService implements ContainerTeardown, ResourceProvider, Resettab
// region::clusterName → EcsCluster
private Map clusters = new ConcurrentHashMap<>();
+ private AccountAwareStorageBackend clustersStore;
// region::family:revision → TaskDefinition (entries persisted before regions were keyed: family:revision)
private Map taskDefinitions = new ConcurrentHashMap<>();
+ private AccountAwareStorageBackend taskDefinitionsStore;
// region::family → latest revision number
private Map latestRevisions = new ConcurrentHashMap<>();
// taskArn → EcsTask
@@ -257,6 +260,7 @@ public class EcsService implements ContainerTeardown, ResourceProvider, Resettab
private final Map containerInstances = new ConcurrentHashMap<>();
// name → CapacityProvider (excludes built-ins FARGATE, FARGATE_SPOT)
private Map capacityProviders = new ConcurrentHashMap<>();
+ private AccountAwareStorageBackend capacityProvidersStore;
// taskSetArn → TaskSet
private final Map taskSets = new ConcurrentHashMap<>();
// Serializes create/update/delete of one service key (region, cluster, name). A fixed set of
@@ -414,17 +418,20 @@ public class EcsService implements ContainerTeardown, ResourceProvider, Resettab
if (storageFactory == null) {
return; // keeps non-CDI unit tests working
}
- this.clusters = storageBacked("ecs-clusters.json",
+ this.clustersStore = storageFactory.create("ecs", "ecs-clusters.json",
new TypeReference