From 77565a9c60a4c3d421a37d9bc5faba2e5bf34bc2 Mon Sep 17 00:00:00 2001
From: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
Date: Tue, 17 Nov 2026 22:19:08 -0400
Subject: [PATCH] fix(timestream-influxdb): give resource-tag conditions the
tags of the resource a request names (#8803)
The generated request resources give Timestream for InfluxDB's
db-instance, db-cluster, db-parameter-group and db-backup types the
aws:ResourceTag/ key, but no service answered the timestream-influxdb
namespace's stored tags, so a condition on such a resource's tags saw
none. TimestreamInfluxDbService now answers it: storedTags reads the
resource the ARN's type and id name, under the Region the ARN names, in
the request's account, where the handlers read, in place, and matched
on the whole ARN. Tag calls already run one at a time and give the
resource a new map; the tags fields are now volatile.
---
docs/services/iam.md | 7 +--
.../aws/core/common/StoredResourceArns.java | 7 +--
.../TimestreamInfluxDbService.java | 41 +++++++++++++++-
.../timestreaminfluxdb/model/DbBackup.java | 2 +-
.../timestreaminfluxdb/model/DbCluster.java | 2 +-
.../timestreaminfluxdb/model/DbInstance.java | 2 +-
.../model/DbParameterGroup.java | 2 +-
...estResourceEnforcementIntegrationTest.java | 39 +++++++++++++--
.../TimestreamInfluxDbServiceTest.java | 47 +++++++++++++++++++
9 files changed, 134 insertions(+), 15 deletions(-)
diff --git a/docs/services/iam.md b/docs/services/iam.md
index 4819e7473b..0b4876763b 100644
--- a/docs/services/iam.md
+++ b/docs/services/iam.md
@@ -3315,9 +3315,10 @@ floci populates:
Payment Cryptography for its keys, Resource Explorer for its indexes and views, Application Auto Scaling for its
scalable targets, ECS for its clusters, task definitions, services, capacity providers, tasks and container
instances, ACM for its certificates, Firehose for its delivery streams, Cognito for its user pools and identity
- pools, OpenSearch for its domains, Signer for its signing profiles, Access Analyzer for its analyzers, Managed
- Service for Apache Flink for its applications, and S3 Vectors for its vector buckets and indexes. Tag keys differing
- only in case are one condition key holding every value.
+ pools, OpenSearch for its domains, Signer for its signing profiles, Access Analyzer for its analyzers, Managed Service
+ for Apache Flink for its applications, S3 Vectors for its vector buckets and indexes, and Timestream for InfluxDB for
+ its DB instances, DB clusters, parameter groups and backups. 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 abd94907e2..396335d63e 100644
--- a/src/main/java/io/floci/aws/core/common/StoredResourceArns.java
+++ b/src/main/java/io/floci/aws/core/common/StoredResourceArns.java
@@ -47,9 +47,10 @@ import java.util.Optional;
* provider, a task or a container instance; ACM, for the tags of a certificate; Firehose, for the tags of a delivery
* stream; Cognito, for the tags of a user pool or an identity pool; OpenSearch, for the tags of a domain; Signer, for
* the tags of a signing profile; Access Analyzer, for the tags of an analyzer; Managed Service for Apache Flink, for
- * the tags of an application; S3 Vectors, for the tags of a vector bucket or an index); 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.
+ * the tags of an application; S3 Vectors, for the tags of a vector bucket or an index; Timestream for InfluxDB, for the
+ * tags of a DB instance, a DB cluster, a parameter group or a backup); 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/timestreaminfluxdb/TimestreamInfluxDbService.java b/src/main/java/io/floci/aws/services/timestreaminfluxdb/TimestreamInfluxDbService.java
index 0720d3e7a2..b2072619fd 100644
--- a/src/main/java/io/floci/aws/services/timestreaminfluxdb/TimestreamInfluxDbService.java
+++ b/src/main/java/io/floci/aws/services/timestreaminfluxdb/TimestreamInfluxDbService.java
@@ -10,6 +10,7 @@ import io.floci.aws.core.common.PaginatedResult;
import io.floci.aws.core.common.Pagination;
import io.floci.aws.core.common.RegionResolver;
import io.floci.aws.core.common.Resettable;
+import io.floci.aws.core.common.StoredResourceArns;
import io.floci.aws.core.storage.AccountAwareStorageBackend;
import io.floci.aws.core.storage.StorageFactory;
import io.floci.aws.services.secretsmanager.SecretsManagerService;
@@ -50,7 +51,7 @@ import static io.floci.aws.services.timestreaminfluxdb.TimestreamInfluxDbValidat
import static io.floci.aws.services.timestreaminfluxdb.TimestreamInfluxDbValidation.validation;
@ApplicationScoped
-public class TimestreamInfluxDbService implements Resettable {
+public class TimestreamInfluxDbService implements Resettable, StoredResourceArns {
static final String ENGINE_V2 = "INFLUXDB_V2";
static final String ENGINE_V3_CORE = "INFLUXDB_V3_CORE";
@@ -785,6 +786,44 @@ public class TimestreamInfluxDbService implements Resettable {
saveTags(arn, tags);
}
+ @Override
+ public String namespace() {
+ return "timestream-influxdb";
+ }
+
+ /** A request names a resource by the id Timestream for InfluxDB minted, which its ARN ends in: nothing to find. */
+ @Override
+ public Optional find(String type, List names, String region) {
+ return Optional.empty();
+ }
+
+ /**
+ * The tags of the DB instance, DB cluster, parameter group or backup whose ARN is {@code arn}, in the request's
+ * account, where the handlers read: an ARN of another account names none. Read in place under the Region the ARN
+ * names and the resource's id, a resource stored before storage was account-aware included, and matched on the
+ * whole ARN. Tag calls run one at a time and give the resource a new map, so the read is of one whole set.
+ */
+ @Override
+ public Map storedTags(String arn) {
+ Matcher matcher = arn == null ? null : TimestreamInfluxDbValidation.ARN.matcher(arn);
+ if (matcher == null || !matcher.matches() || !matcher.group(2).equals(regionResolver.getAccountId())) {
+ return Map.of();
+ }
+ String account = matcher.group(2);
+ String storageKey = key(matcher.group(1), matcher.group(4));
+ Optional