diff --git a/docs/services/iam.md b/docs/services/iam.md index 6c41c24fcf..b7c66dca1e 100644 --- a/docs/services/iam.md +++ b/docs/services/iam.md @@ -1676,7 +1676,7 @@ Map, ACM, CodePipeline, CodeBuild, Amazon Managed Service for Apache Flink (Kine Application Auto Scaling, AWS Budgets, Cost and Usage Reports, Service Quotas, Amazon Textract, Amazon Translate, Amazon Athena, AWS Data Exports, AWS Pricing Calculator, Cost Explorer, CloudTrail, Global Accelerator, Amazon Timestream for InfluxDB, the Amazon Redshift Data API, AWS Payment Cryptography, AWS DataSync, Amazon EMR, -Amazon Rekognition and IAM Identity Center they come from a table generated from AWS's Service Reference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives each +Amazon Rekognition, IAM Identity Center and Amazon OpenSearch Service they come from a table generated from AWS's Service Reference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives each operation's action, the resource types that action acts on with their ARN formats, and the request members that name them: a member holding a resource's ARN, which counts when it matches the format of a type the action acts on, or members filling the variables of a type's format. A member holding @@ -1853,6 +1853,18 @@ it is signed with. The ARN is the one after `/tags/` or `/v1/tags/`, the body's `resourceArn` on `POST /tags`, and the `resourceArn` query parameter on the other bare routes. +A REST request names its resources in its path and its query as well as its body. For OpenSearch +Service, the one REST service the table reads, a member its path carries, the `DomainName` of +`/2021-01-01/opensearch/domain/{DomainName}`, is read from the route the request matches in the +vendored routes below, and one its query carries, the `arn` of `ListTags`, from the query, as members of +the body are: `DescribeDomain` is checked on `domain/` and `ListTags` on the ARN it gives. +A member its path or query carries is read from there alone, as OpenSearch reads it: a +`GetCompatibleVersions` naming a domain in its body and none in its query names no domain. +The table reads both API versions' operations, `2015-01-01` and `2021-01-01`, the Service Reference +listing the first's alone, each the action of its own name. A request of an operation whose resource +the table does not find, an outbound connection's or an OpenSearch application's, is checked on `*`; +Floci serves neither. + A route no rule maps is the operation whose route it matches in botocore's model of its service, vendored in `src/main/resources/aws/rest-routes.json` (`make aws-data-sync` regenerates it): of the routes it matches, the most specific, segment by segment from the left a literal before a label and a @@ -1863,10 +1875,11 @@ when the Service Reference gives the action no resource type, as AWS authorizes The actions of no resource type are vendored in `src/main/resources/aws/iam-authorized-actions.json` for each scope whose routes are read (`make iam-authorized-actions-sync` regenerates them). So OpenSearch Service's `ListDomainNames`, `ListVersions` and VPC endpoint operations, in both API -versions, and Access Analyzer's `ListAnalyzers` and `ValidatePolicy` are checked by their routes. A -route whose action AWS checks on a resource Floci neither builds nor reads, OpenSearch's domain -operations and Access Analyzer's analyzer operations among them, is not checked: checked on `*`, a -grant scoped to the domain or analyzer would be refused. The routes of +versions, and Access Analyzer's `ListAnalyzers` and `ValidatePolicy` are checked by their routes, and +so are OpenSearch Service's domain operations, the table of request resources reading the domain they +name. A route whose action AWS checks on a resource Floci neither builds nor reads, Access Analyzer's +analyzer operations among them, is not checked: checked on `*`, a grant scoped to the analyzer would +be refused. The routes of Lambda, EKS, EventBridge Scheduler, EventBridge Pipes and Aurora DSQL are all mapped by their rules, so none is checked differently. S3 and API Gateway are routed by their rules alone: S3 tells apart the operations of one route by their query and headers, and API Gateway is checked by HTTP method. A route diff --git a/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.java b/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.java index 767399619a..d9d03ce9b4 100644 --- a/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.java +++ b/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.java @@ -1138,7 +1138,7 @@ public class IamEnforcementFilter implements ContainerRequestFilter { String region, String accountId, String akid) { // A create tags the resource it makes, not the parent it makes it in (see RequestResources.created). List created = RequestResources.created(operation, ctx, AwsRegions.partitionFor(region), region, - accountId); + accountId, IamActionRegistry.pathLabels(credentialScope, ctx)); List made = created.isEmpty() ? resources : created; for (TagOnCreate.TagSet set : tagging.checked()) { Map> context = TagOnCreate.conditionContext(tagging, set, operation); diff --git a/src/main/java/io/github/hectorvent/floci/core/common/RequestResourceMembers.java b/src/main/java/io/github/hectorvent/floci/core/common/RequestResourceMembers.java index 1a748598d1..ab29bc73e9 100644 --- a/src/main/java/io/github/hectorvent/floci/core/common/RequestResourceMembers.java +++ b/src/main/java/io/github/hectorvent/floci/core/common/RequestResourceMembers.java @@ -45,6 +45,9 @@ final class RequestResourceMembers { "^arn:\\$\\{Partition}:[^:]*:[^:]*:[^:]*:([A-Za-z][A-Za-z0-9-]*)(.*)$"); /** A format's resource that is a literal and one variable. */ private static final Pattern ONE_VARIABLE = Pattern.compile("[^$]*\\$\\{\\w+}"); + /** A member a REST request carries outside its body, by its name, and where: a path label or a query parameter. */ + private static final Pattern LOCATED_MEMBER = Pattern.compile("[A-Za-z][A-Za-z0-9_]*"); + private static final Pattern LOCATION = Pattern.compile("\\{[A-Za-z0-9_]+}|\\?[A-Za-z0-9_.-]+"); /** The one id a child type's format appends to its parent's. */ private static final Pattern APPENDED_ID = Pattern.compile("[/:]\\$\\{\\w+}"); /** The keys a resource found by members does not take: it is read no other way, in the caller's account. */ @@ -169,12 +172,14 @@ final class RequestResourceMembers { /** * The file: each operation's resources and the resources it creates under a parent, as - * {@code :}, each namespace's ARN formats, and the namespaces it reads, those built by - * hand, those not read yet, and the others with resource types. + * {@code :}, the members a REST operation's request carries outside its body, each + * namespace's ARN formats, and the namespaces it reads, those built by hand, those not read yet, and the others + * with resource types. A located member is a label of the request's path, {@code {Label}}, or a parameter of its + * query, {@code ?name}, by the member's name. */ record Table(Map> operations, Map> creates, - Map> formats, Set namespaces, Set handBuilt, - Set notCovered, Set otherNamespaces) { + Map> located, Map> formats, + Set namespaces, Set handBuilt, Set notCovered, Set otherNamespaces) { } private static final class Holder { @@ -229,6 +234,7 @@ final class RequestResourceMembers { }); Map> entries = new LinkedHashMap<>(); Map> creates = new LinkedHashMap<>(); + Map> located = new LinkedHashMap<>(); operations.properties().forEach(operation -> { String namespace = operation.getKey().substring(0, Math.max(0, operation.getKey().indexOf(':'))); if (!namespaces.contains(namespace)) { @@ -247,8 +253,20 @@ final class RequestResourceMembers { if (!made.isEmpty()) { creates.put(operation.getKey(), List.copyOf(made)); } + Map where = new LinkedHashMap<>(); + operation.getValue().path("located").properties().forEach(member -> { + if (!LOCATED_MEMBER.matcher(member.getKey()).matches() + || !LOCATION.matcher(member.getValue().asText("")).matches()) { + throw new IllegalStateException(RESOURCE_NAME + " locates " + operation.getKey() + "'s " + + member.getKey() + " at " + member.getValue() + ", no label of a path or query parameter"); + } + where.put(member.getKey(), member.getValue().asText()); + }); + if (!where.isEmpty()) { + located.put(operation.getKey(), Map.copyOf(where)); + } }); - return new Table(Map.copyOf(entries), Map.copyOf(creates), Map.copyOf(formats), namespaces, + return new Table(Map.copyOf(entries), Map.copyOf(creates), Map.copyOf(located), Map.copyOf(formats), namespaces, names(document.path("handBuilt")), Set.copyOf(document.path("notCovered").propertyStream().map(Map.Entry::getKey).toList()), names(document.path("otherNamespaces"))); diff --git a/src/main/java/io/github/hectorvent/floci/core/common/RequestResources.java b/src/main/java/io/github/hectorvent/floci/core/common/RequestResources.java index 5fe6f503f5..77515ced32 100644 --- a/src/main/java/io/github/hectorvent/floci/core/common/RequestResources.java +++ b/src/main/java/io/github/hectorvent/floci/core/common/RequestResources.java @@ -1,7 +1,10 @@ package io.github.hectorvent.floci.core.common; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.MultivaluedMap; import java.util.ArrayList; import java.util.HashMap; @@ -79,6 +82,16 @@ public final class RequestResources { */ public static List of(String operation, ContainerRequestContext ctx, String partition, String region, String accountId, StoredResourceArns stored) { + return of(operation, ctx, partition, region, accountId, stored, Map.of()); + } + + /** + * As {@link #of(String, ContainerRequestContext, String, String, String, StoredResourceArns)}, a member the table + * locates in a REST request's path read from {@code labels}, the value the request's path gives each label of the + * route it was routed by, and one it locates in its query from the request's query parameters. + */ + public static List of(String operation, ContainerRequestContext ctx, String partition, String region, + String accountId, StoredResourceArns stored, Map labels) { RequestResourceMembers.Table table = RequestResourceMembers.table(); List resources = operation == null ? null : served(table.operations().get(operation), ctx); @@ -86,7 +99,7 @@ public final class RequestResources { return List.of(); } Map form = IamConditionContextResolver.formParameters(ctx); - JsonNode body = form.isEmpty() ? PassedRoles.jsonBody(ctx) : null; + JsonNode body = form.isEmpty() ? located(table, operation, PassedRoles.jsonBody(ctx), ctx, labels) : null; return named(resources, formats(table, operation), form, body, partition, region, accountId, stored); } @@ -128,6 +141,15 @@ public final class RequestResources { */ public static List created(String operation, ContainerRequestContext ctx, String partition, String region, String accountId) { + return created(operation, ctx, partition, region, accountId, Map.of()); + } + + /** + * As {@link #created(String, ContainerRequestContext, String, String, String)}, with the path's labels as for + * {@link #of(String, ContainerRequestContext, String, String, String, StoredResourceArns, Map)}. + */ + public static List created(String operation, ContainerRequestContext ctx, String partition, String region, + String accountId, Map labels) { RequestResourceMembers.Table table = RequestResourceMembers.table(); List creates = operation == null ? null : table.creates().get(operation); List made = operation == null || creates != null ? List.of() @@ -137,7 +159,7 @@ public final class RequestResources { return List.of(); } Map form = IamConditionContextResolver.formParameters(ctx); - JsonNode body = form.isEmpty() ? PassedRoles.jsonBody(ctx) : null; + JsonNode body = form.isEmpty() ? located(table, operation, PassedRoles.jsonBody(ctx), ctx, labels) : null; Map formats = formats(table, operation); if (creates == null) { return named(made, formats, form, body, partition, region, accountId, null); @@ -163,6 +185,32 @@ public final class RequestResources { return List.copyOf(arns); } + /** + * The request's body with each member the table locates in a REST request's path or query laid over it under the + * member's name, so a resource reads it as it reads a member of the body: a path label's value from {@code labels}, + * a query parameter's first value; the body itself when the operation locates none. A located member is read from + * where it is alone, as its handler reads it: one the body also gives is dropped, so a body naming a domain the + * query does not name names nothing. + */ + private static JsonNode located(RequestResourceMembers.Table table, String operation, JsonNode body, + ContainerRequestContext ctx, Map labels) { + Map located = table.located().getOrDefault(operation, Map.of()); + if (located.isEmpty()) { + return body; + } + ObjectNode overlaid = body instanceof ObjectNode object ? object.deepCopy() : JsonNodeFactory.instance.objectNode(); + MultivaluedMap query = ctx.getUriInfo() == null ? null : ctx.getUriInfo().getQueryParameters(); + located.forEach((member, where) -> { + overlaid.remove(member); + String value = where.startsWith("{") ? labels.get(where.substring(1, where.length() - 1)) + : query == null ? null : query.getFirst(where.substring(1)); + if (value != null) { + overlaid.put(member, value); + } + }); + return overlaid; + } + /** * The resources that apply to a request of the service serving it: one with an {@code endpoint} applies only to * a request the service of that endpoint prefix serves, read from the claim of the service whose handler runs it diff --git a/src/main/java/io/github/hectorvent/floci/services/iam/IamActionRegistry.java b/src/main/java/io/github/hectorvent/floci/services/iam/IamActionRegistry.java index 8acbfd7ff9..9b98c066ed 100644 --- a/src/main/java/io/github/hectorvent/floci/services/iam/IamActionRegistry.java +++ b/src/main/java/io/github/hectorvent/floci/services/iam/IamActionRegistry.java @@ -743,6 +743,21 @@ public class IamActionRegistry { return null; } + /** + * The value a REST request's path gives each label of the vendored route it matches, decoded, by the label's + * name; empty when it matches none. {@link RequestResources} reads a member the table of request resources + * locates in the path from them, as {@link #resolveRoute} matches the route. + */ + public static Map pathLabels(String credentialScope, ContainerRequestContext ctx) { + IamRestRoutes routes = IamRestRoutes.vendored(); + if (credentialScope == null || !routes.routes(credentialScope)) { + return Map.of(); + } + return routes.match(credentialScope, ctx.getMethod().toUpperCase(), routedPath(ctx), + ctx.getUriInfo() == null ? null : ctx.getUriInfo().getQueryParameters()) + .map(IamRestRoutes.Match::labels).orElse(Map.of()); + } + /** * Whether a request of the operation is checked on the resources AWS checks its action on: those its request * names, which the vendored request resources read for the operation ({@link RequestResources#reads}) or diff --git a/src/main/java/io/github/hectorvent/floci/services/iam/IamRestRoutes.java b/src/main/java/io/github/hectorvent/floci/services/iam/IamRestRoutes.java index 9a396f3493..ed751e1860 100644 --- a/src/main/java/io/github/hectorvent/floci/services/iam/IamRestRoutes.java +++ b/src/main/java/io/github/hectorvent/floci/services/iam/IamRestRoutes.java @@ -7,6 +7,8 @@ import jakarta.ws.rs.core.MultivaluedMap; import java.io.IOException; import java.io.InputStream; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -52,8 +54,15 @@ final class IamRestRoutes { private static final int ONE_SEGMENT = 1; private static final int REST_OF_PATH = 0; - /** A route: its operation, its path as a pattern, each segment's rank, and the query it names. */ - private record Route(String operation, Pattern path, int[] ranks, Map query) { + /** A route a request matched: its operation, and the value its path gives each of the route's labels, decoded. */ + record Match(String operation, Map labels) { + } + + /** + * A route: its operation, its path as a pattern capturing each label in turn, the labels' names, each segment's + * rank, and the query it names. + */ + private record Route(String operation, Pattern path, List labels, int[] ranks, Map query) { boolean matches(String requestPath, MultivaluedMap parameters) { if (!path.matcher(requestPath).matches()) { @@ -68,6 +77,20 @@ final class IamRestRoutes { return true; } + /** The value the path gives each label, decoded as the router decodes a path parameter. */ + Map labelValues(String requestPath) { + Matcher matcher = path.matcher(requestPath); + if (!matcher.matches()) { + return Map.of(); + } + Map values = new LinkedHashMap<>(); + for (int i = 0; i < labels.size(); i++) { + values.put(labels.get(i), URLDecoder.decode(matcher.group(i + 1).replace("+", "%2B"), + StandardCharsets.UTF_8)); + } + return Map.copyOf(values); + } + /** Whether this route is more specific than the other, as {@link IamRestRoutes} orders them. */ boolean outranks(Route other) { int compared = Arrays.compare(ranks, other.ranks); @@ -97,6 +120,11 @@ final class IamRestRoutes { * matches several; empty when it matches none, or its scope is one the file does not route. */ Optional operation(String scope, String method, String path, MultivaluedMap query) { + return match(scope, method, path, query).map(Match::operation); + } + + /** As {@link #operation}, with the values the request's path gives the route's labels. */ + Optional match(String scope, String method, String path, MultivaluedMap query) { String requestPath = IamActionRegistry.withoutTrailingSlash(path); Route best = null; for (Route route : routes.getOrDefault(scope, Map.of()).getOrDefault(method, List.of())) { @@ -104,7 +132,12 @@ final class IamRestRoutes { best = route; } } - return best == null ? Optional.empty() : Optional.of(best.operation()); + return best == null ? Optional.empty() : Optional.of(new Match(best.operation(), best.labelValues(requestPath))); + } + + /** Whether the file routes any request of the credential scope. */ + boolean routes(String scope) { + return routes.containsKey(scope); } static IamRestRoutes parse(InputStream in) throws IOException { @@ -153,12 +186,14 @@ final class IamRestRoutes { String path = IamActionRegistry.withoutTrailingSlash(question < 0 ? requestUri : requestUri.substring(0, question)); List segments = path.equals("/") ? List.of() : List.of(path.substring(1).split("/", -1)); StringBuilder pattern = new StringBuilder(); + List labels = new ArrayList<>(); int[] ranks = new int[segments.size()]; for (int i = 0; i < segments.size(); i++) { String segment = segments.get(i); pattern.append('/'); if (GREEDY.matcher(segment).matches()) { - pattern.append(".+"); + pattern.append("(.+)"); + labels.add(segment.substring(1, segment.length() - 2)); ranks[i] = REST_OF_PATH; continue; } @@ -166,7 +201,8 @@ final class IamRestRoutes { int literalFrom = 0; boolean labelled = false; while (label.find()) { - pattern.append(Pattern.quote(segment.substring(literalFrom, label.start()))).append("[^/]+"); + pattern.append(Pattern.quote(segment.substring(literalFrom, label.start()))).append("([^/]+)"); + labels.add(segment.substring(label.start() + 1, label.end() - 1)); literalFrom = label.end(); labelled = true; } @@ -181,7 +217,7 @@ final class IamRestRoutes { equals < 0 ? "" : parameter.substring(equals + 1)); } } - return new Route(operation, Pattern.compile(pattern.isEmpty() ? "/" : pattern.toString()), ranks, - Map.copyOf(query)); + return new Route(operation, Pattern.compile(pattern.isEmpty() ? "/" : pattern.toString()), List.copyOf(labels), + ranks, Map.copyOf(query)); } } diff --git a/src/main/java/io/github/hectorvent/floci/services/iam/ResourceArnBuilder.java b/src/main/java/io/github/hectorvent/floci/services/iam/ResourceArnBuilder.java index 11dee5f360..b5ceb68821 100644 --- a/src/main/java/io/github/hectorvent/floci/services/iam/ResourceArnBuilder.java +++ b/src/main/java/io/github/hectorvent/floci/services/iam/ResourceArnBuilder.java @@ -229,7 +229,8 @@ public class ResourceArnBuilder { private List namedResources(String credentialScope, String operation, ContainerRequestContext ctx, String region, String accountId, String partition) { List named = operation == null || !operation.startsWith(credentialScope + ":") ? List.of() - : RequestResources.of(operation, ctx, partition, region, accountId, storedResourceArns(credentialScope)); + : RequestResources.of(operation, ctx, partition, region, accountId, storedResourceArns(credentialScope), + IamActionRegistry.pathLabels(credentialScope, ctx)); return named.isEmpty() ? List.of("*") : named; } diff --git a/src/main/resources/aws/iam-request-resources.json b/src/main/resources/aws/iam-request-resources.json index 080a543d2b..24a6c8ee22 100644 --- a/src/main/resources/aws/iam-request-resources.json +++ b/src/main/resources/aws/iam-request-resources.json @@ -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-03", "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": {"acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "globalaccelerator": ["globalaccelerator"], "kinesisanalytics": ["kinesisanalyticsv2"], "logs": ["logs"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "redshift-data": ["redshift-data"], "rekognition": ["rekognition"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"]}, - "clientsNotRead": {"kinesisanalytics": "Kinesis Data Analytics v1, SQL applications on the KinesisAnalytics_20150814 target, which Floci does not serve (it serves v2, kinesisanalyticsv2); its operations share v2's names and name their resources by other members"}, + "_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-04", "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": {"acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "globalaccelerator": ["globalaccelerator"], "kinesisanalytics": ["kinesisanalyticsv2"], "logs": ["logs"], "payment-cryptography": ["payment-cryptography"], "redshift-data": ["redshift-data"], "rekognition": ["rekognition"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"]}, + "clientsNotRead": {"kinesisanalytics": "Kinesis Data Analytics v1, SQL applications on the KinesisAnalytics_20150814 target, which Floci does not serve (it serves v2, kinesisanalyticsv2); its operations share v2's names and name their resources by other members", "payment-cryptography-data": "the Payment Cryptography data plane, REST routes such as /keys/{KeyIdentifier}/encrypt, which Floci does not serve (it serves the control plane's JSON operations); its KeyIdentifier may be an alias, read on the control plane by the handler, not by its path"}, "handBuilt": ["apigateway", "bedrock", "dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "lambda", "logs", "pipes", "resource-groups", "s3", "scheduler", "secretsmanager", "sns", "sqs", "ssm", "sts"], - "notCovered": {"access-analyzer": "REST: its requests name their resources in the path, which RequestResources does not read yet", "account": "REST: its requests name their resources in the path, which RequestResources does not read yet", "airflow": "REST: its requests name their resources in the path, which RequestResources does not read yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources does not read yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources does not read yet", "appsync": "REST: its requests name their resources in the path, which RequestResources does not read yet", "aps": "REST: its requests name their resources in the path, which RequestResources does not read yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup::autoScalingGroupName/`, while Floci mints `autoScalingGroup:`, 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 does not read yet", "batch": "REST: its requests name their resources in the path, which RequestResources does not read yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources does not read yet", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudfront": "REST: its requests name their resources in the path, which RequestResources does not read yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rule does not fill a name from, so nearly every operation needs a correction", "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 does not read 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/_, 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 does not read 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 does not read yet", "controlcatalog": "REST: its requests name their resources in the path, which RequestResources does not read yet", "controltower": "REST: its requests name their resources in the path, which RequestResources does not read yet", "detective": "REST: its requests name their resources in the path, which RequestResources does not read yet", "dlm": "REST: its requests name their resources in the path, which RequestResources does not read yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ecs": "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//`, 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 does not read yet", "emr-serverless": "REST: its requests name their resources in the path, which RequestResources does not read yet", "es": "REST: its requests name their resources in the path, which RequestResources does not read yet", "execute-api": "REST: its requests name their resources in the path, which RequestResources does not read yet", "fis": "REST: its requests name their resources in the path, which RequestResources does not read yet", "glue": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "guardduty": "REST: its requests name their resources in the path, which RequestResources does not read yet", "identitystore": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "inspector2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "iot": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "kafka": "REST: its requests name their resources in the path, which RequestResources does not read yet", "lightsail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "macie2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "memorydb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "mq": "REST: its requests name their resources in the path, which RequestResources does not read yet", "network-firewall": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "oam": "REST: its requests name their resources in the path, which RequestResources does not read yet", "organizations": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ram": "REST: its requests name their resources in the path, which RequestResources does not read yet", "rds": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rds-data": "REST: its requests name their resources in the path, which RequestResources does not read yet", "redshift": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "redshift-serverless": "not read yet: its namespace, workgroup, snapshot and managed VPC endpoint ARNs end in an id the service mints, `namespace/`, while its requests name them by namespaceName, workgroupName, snapshotName and endpointName, so reading it needs the stored ARNs those find, as Redshift Data's workgroups are found", "resource-explorer-2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "route53": "REST: its requests name their resources in the path, which RequestResources does not read yet", "route53resolver": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rum": "REST: its requests name their resources in the path, which RequestResources does not read yet", "s3tables": "REST: its requests name their resources in the path, which RequestResources does not read yet", "s3vectors": "REST: its requests name their resources in the path, which RequestResources does not read yet", "sagemaker": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "securityhub": "REST: its requests name their resources in the path, which RequestResources does not read yet", "servicecatalog": "not read yet: CreatePortfolioShare, UpdatePortfolioShare and DeletePortfolioShare give in AccountId the account a portfolio is shared with, which the rule reads as the portfolio's; a portfolio or product imported from another account keeps its owner's account in its ARN while requests name it by its id alone; and AppRegistry's applications and attribute groups are named in the path", "ses": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "signin": "REST: its requests name their resources in the path, which RequestResources does not read yet", "sso-oauth": "REST: its requests name their resources in the path, which RequestResources does not read yet", "swf": "not read yet: the Service Reference gives a domain's ARN no Region, `swf:::/domain/`, while the SWF Developer Guide gives it as arn:aws:swf:Region:AccountID:/domain/DomainName, as Floci mints it; reading it needs that format corrected", "transcribe": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "transfer": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "verifiedpermissions": "not read yet: a policyStoreId may name its store by an alias, `policy-store-alias/`, which AWS authorizes as the action on the store the alias points to and GetPolicyStoreAlias on the alias, and an aliasName carries the `policy-store-alias/` its format already gives; reading it needs both", "wafv2": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint"}, + "notCovered": {"access-analyzer": "REST: its requests name their resources in the path, which RequestResources does not read yet", "account": "REST: its requests name their resources in the path, which RequestResources does not read yet", "airflow": "REST: its requests name their resources in the path, which RequestResources does not read yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources does not read yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources does not read yet", "appsync": "REST: its requests name their resources in the path, which RequestResources does not read yet", "aps": "REST: its requests name their resources in the path, which RequestResources does not read yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup::autoScalingGroupName/`, while Floci mints `autoScalingGroup:`, 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 does not read yet", "batch": "REST: its requests name their resources in the path, which RequestResources does not read yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources does not read yet", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudfront": "REST: its requests name their resources in the path, which RequestResources does not read yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rule does not fill a name from, so nearly every operation needs a correction", "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 does not read 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/_, 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 does not read 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 does not read yet", "controlcatalog": "REST: its requests name their resources in the path, which RequestResources does not read yet", "controltower": "REST: its requests name their resources in the path, which RequestResources does not read yet", "detective": "REST: its requests name their resources in the path, which RequestResources does not read yet", "dlm": "REST: its requests name their resources in the path, which RequestResources does not read yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ecs": "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//`, 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 does not read yet", "emr-serverless": "REST: its requests name their resources in the path, which RequestResources does not read yet", "execute-api": "REST: its requests name their resources in the path, which RequestResources does not read yet", "fis": "REST: its requests name their resources in the path, which RequestResources does not read yet", "glue": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "guardduty": "REST: its requests name their resources in the path, which RequestResources does not read yet", "identitystore": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "inspector2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "iot": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "kafka": "REST: its requests name their resources in the path, which RequestResources does not read yet", "lightsail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "macie2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "memorydb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "mq": "REST: its requests name their resources in the path, which RequestResources does not read yet", "network-firewall": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "oam": "REST: its requests name their resources in the path, which RequestResources does not read yet", "organizations": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ram": "REST: its requests name their resources in the path, which RequestResources does not read yet", "rds": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rds-data": "REST: its requests name their resources in the path, which RequestResources does not read yet", "redshift": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "redshift-serverless": "not read yet: its namespace, workgroup, snapshot and managed VPC endpoint ARNs end in an id the service mints, `namespace/`, while its requests name them by namespaceName, workgroupName, snapshotName and endpointName, so reading it needs the stored ARNs those find, as Redshift Data's workgroups are found", "resource-explorer-2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "route53": "REST: its requests name their resources in the path, which RequestResources does not read yet", "route53resolver": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rum": "REST: its requests name their resources in the path, which RequestResources does not read yet", "s3tables": "REST: its requests name their resources in the path, which RequestResources does not read yet", "s3vectors": "REST: its requests name their resources in the path, which RequestResources does not read yet", "sagemaker": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "securityhub": "REST: its requests name their resources in the path, which RequestResources does not read yet", "servicecatalog": "not read yet: CreatePortfolioShare, UpdatePortfolioShare and DeletePortfolioShare give in AccountId the account a portfolio is shared with, which the rule reads as the portfolio's; a portfolio or product imported from another account keeps its owner's account in its ARN while requests name it by its id alone; and AppRegistry's applications and attribute groups are named in the path", "ses": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "signin": "REST: its requests name their resources in the path, which RequestResources does not read yet", "sso-oauth": "REST: its requests name their resources in the path, which RequestResources does not read yet", "swf": "not read yet: the Service Reference gives a domain's ARN no Region, `swf:::/domain/`, while the SWF Developer Guide gives it as arn:aws:swf:Region:AccountID:/domain/DomainName, as Floci mints it; reading it needs that format corrected", "transcribe": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "transfer": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "verifiedpermissions": "not read yet: a policyStoreId may name its store by an alias, `policy-store-alias/`, which AWS authorizes as the action on the store the alias points to and GetPolicyStoreAlias on the alias, and an aliasName carries the `policy-store-alias/` its format already gives; reading it needs both", "wafv2": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint"}, "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", "cloudfront-keyvaluestore", "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", "ec2-instance-connect", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "emr-containers", "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", "quicksight", "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", "signer", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "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", "xray"], - "arnFormats": {"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}", "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}"}, "cloudtrail": {"channel": "arn:${Partition}:cloudtrail:${Region}:${Account}:channel/${ChannelId}", "dashboard": "arn:${Partition}:cloudtrail:${Region}:${Account}:dashboard/${DashboardName}", "eventdatastore": "arn:${Partition}:cloudtrail:${Region}:${Account}:eventdatastore/${EventDataStoreId}", "trail": "arn:${Partition}:cloudtrail:${Region}:${Account}:trail/${TrailName}"}, "codebuild": {"build": "arn:${Partition}:codebuild:${Region}:${Account}:build/${BuildId}", "build-batch": "arn:${Partition}:codebuild:${Region}:${Account}:build-batch/${BuildBatchId}", "fleet": "arn:${Partition}:codebuild:${Region}:${Account}:fleet/${FleetName}:${FleetId}", "project": "arn:${Partition}:codebuild:${Region}:${Account}:project/${ProjectName}", "report": "arn:${Partition}:codebuild:${Region}:${Account}:report/${ReportGroupName}:${ReportId}", "report-group": "arn:${Partition}:codebuild:${Region}:${Account}:report-group/${ReportGroupName}", "sandbox": "arn:${Partition}:codebuild:${Region}:${Account}:sandbox/${SandboxId}"}, "codepipeline": {"action": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}/${ActionName}", "actiontype": "arn:${Partition}:codepipeline:${Region}:${Account}:actiontype:${Owner}/${Category}/${Provider}/${Version}", "pipeline": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}", "stage": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}", "webhook": "arn:${Partition}:codepipeline:${Region}:${Account}:webhook:${WebhookName}"}, "cognito-identity": {"identitypool": "arn:${Partition}:cognito-identity:${Region}:${Account}:identitypool/${IdentityPoolId}"}, "cognito-idp": {"userpool": "arn:${Partition}:cognito-idp:${Region}:${Account}:userpool/${UserPoolId}", "webacl": "arn:${Partition}:wafv2:${Region}:${Account}:${Scope}/webacl/${Name}/${Id}"}, "cur": {"cur": "arn:${Partition}:cur:${Region}:${Account}:definition/${ReportName}"}, "datasync": {"agent": "arn:${Partition}:datasync:${Region}:${Account}:agent/${AgentId}", "discoveryjob": "arn:${Partition}:datasync:${Region}:${Account}:system/${StorageSystemId}/job/${DiscoveryJobId}", "location": "arn:${Partition}:datasync:${Region}:${Account}:location/${LocationId}", "storagesystem": "arn:${Partition}:datasync:${Region}:${Account}:system/${StorageSystemId}", "task": "arn:${Partition}:datasync:${Region}:${Account}:task/${TaskId}", "taskexecution": "arn:${Partition}:datasync:${Region}:${Account}:task/${TaskId}/execution/${ExecutionId}"}, "dynamodb": {"backup": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/backup/${BackupName}", "export": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/export/${ExportName}", "global-table": "arn:${Partition}:dynamodb::${Account}:global-table/${GlobalTableName}", "import": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/import/${ImportName}", "index": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/index/${IndexName}", "stream": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/stream/${StreamLabel}", "table": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}"}, "ecr": {"repository": "arn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName}"}, "elasticloadbalancing": {"listener-rule/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener-rule/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/gwy": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/gwy/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "loadbalancer": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/${LoadBalancerName}", "loadbalancer/app/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/gwy/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/gwy/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/net/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/net/${LoadBalancerName}/${LoadBalancerId}", "targetgroup": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:targetgroup/${TargetGroupName}/${TargetGroupId}", "truststore": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:truststore/${TrustStoreName}/${TrustStoreId}"}, "elasticmapreduce": {"cluster": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:cluster/${ClusterId}", "editor": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:editor/${EditorId}", "notebook-execution": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:notebook-execution/${NotebookExecutionId}", "session": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:cluster/${ClusterId}/session/${SessionId}", "studio": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:studio/${StudioId}"}, "events": {"alias": "arn:${Partition}:kms:${Region}:${Account}:alias/${Alias}", "api-destination": "arn:${Partition}:events:${Region}:${Account}:api-destination/${ApiDestinationName}", "archive": "arn:${Partition}:events:${Region}:${Account}:archive/${ArchiveName}", "connection": "arn:${Partition}:events:${Region}:${Account}:connection/${ConnectionName}", "create-snapshot": "arn:${Partition}:events:${Region}:${Account}:target/create-snapshot", "endpoint": "arn:${Partition}:events:${Region}:${Account}:endpoint/${EndpointName}", "event-bus": "arn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName}", "event-busv2": "arn:${Partition}:events:${Region}:${Account}:event-busv2/${EventBusName}/${OpaqueId}", "event-source": "arn:${Partition}:events:${Region}::event-source/${EventSourceName}", "event-sourcev2": "arn:${Partition}:events:${Region}:${Account}:event-sourcev2/${SourceType}/${EventSourceName}/${OpaqueId}", "key": "arn:${Partition}:kms:${Region}:${Account}:key/${KeyId}", "reboot-instance": "arn:${Partition}:events:${Region}:${Account}:target/reboot-instance", "replay": "arn:${Partition}:events:${Region}:${Account}:replay/${ReplayName}", "rule-on-custom-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName}", "rule-on-default-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${RuleName}", "stop-instance": "arn:${Partition}:events:${Region}:${Account}:target/stop-instance", "subscriber": "arn:${Partition}:events:${Region}:${Account}:subscriber/${SubscriberName}/${OpaqueId}", "terminate-instance": "arn:${Partition}:events:${Region}:${Account}:target/terminate-instance"}, "firehose": {"deliverystream": "arn:${Partition}:firehose:${Region}:${Account}:deliverystream/${DeliveryStreamName}"}, "globalaccelerator": {"accelerator": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}", "attachment": "arn:${Partition}:globalaccelerator::${Account}:attachment/${ResourceId}", "endpointgroup": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}/listener/${ListenerId}/endpoint-group/${EndpointGroupId}", "listener": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}/listener/${ListenerId}"}, "kinesisanalytics": {"application": "arn:${Partition}:kinesisanalytics:${Region}:${Account}:application/${ApplicationName}"}, "logs": {"anomaly-detector": "arn:${Partition}:logs:${Region}:${Account}:anomaly-detector:${DetectorId}", "delivery": "arn:${Partition}:logs:${Region}:${Account}:delivery:${DeliveryName}", "delivery-destination": "arn:${Partition}:logs:${Region}:${Account}:delivery-destination:${DeliveryDestinationName}", "delivery-source": "arn:${Partition}:logs:${Region}:${Account}:delivery-source:${DeliverySourceName}", "destination": "arn:${Partition}:logs:${Region}:${Account}:destination:${DestinationName}", "log-group": "arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}", "log-stream": "arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}", "lookup-table": "arn:${Partition}:logs:${Region}:${Account}:lookup-table:${LookupTableName}", "scheduled-query": "arn:${Partition}:logs:${Region}:${Account}:scheduled-query:${ScheduledQueryId}"}, "payment-cryptography": {"alias": "arn:${Partition}:payment-cryptography:${Region}:${Account}:alias/${Alias}", "approval-team": "arn:${Partition}:mpa:${Region}:${Account}:approval-team/${ApprovalTeamId}", "key": "arn:${Partition}:payment-cryptography:${Region}:${Account}:key/${KeyId}"}, "redshift-data": {"cluster": "arn:${Partition}:redshift:${Region}:${Account}:cluster:${ClusterName}", "managed-workgroup": "arn:${Partition}:redshift-serverless:${Region}:${Account}:managed-workgroup/${ManagedWorkgroupId}", "workgroup": "arn:${Partition}:redshift-serverless:${Region}:${Account}:workgroup/${WorkgroupId}"}, "rekognition": {"collection": "arn:${Partition}:rekognition:${Region}:${Account}:collection/${CollectionId}", "dataset": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/dataset/${DatasetType}/${CreationTimestamp}", "project": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/${CreationTimestamp}", "projectversion": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/version/${VersionName}/${CreationTimestamp}", "streamprocessor": "arn:${Partition}:rekognition:${Region}:${Account}:streamprocessor/${StreamprocessorId}"}, "servicediscovery": {"namespace": "arn:${Partition}:servicediscovery:${Region}:${Account}:namespace/${NamespaceId}", "service": "arn:${Partition}:servicediscovery:${Region}:${Account}:service/${ServiceId}"}, "servicequotas": {"quota": "arn:${Partition}:servicequotas:${Region}:${Account}:${ServiceCode}/${QuotaCode}"}, "sso": {"Account": "arn:${Partition}:sso:::account/${AccountId}", "Application": "arn:${Partition}:sso::${Account}:application/${InstanceId}/${ApplicationId}", "ApplicationProvider": "arn:${Partition}:sso::aws:applicationProvider/${ApplicationProviderId}", "Instance": "arn:${Partition}:sso:::instance/${InstanceId}", "PermissionSet": "arn:${Partition}:sso:::permissionSet/${InstanceId}/${PermissionSetId}", "TrustedTokenIssuer": "arn:${Partition}:sso::${Account}:trustedTokenIssuer/${InstanceId}/${TrustedTokenIssuerId}"}, "states": {"activity": "arn:${Partition}:states:${Region}:${Account}:activity:${ActivityName}", "execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}:${ExecutionId}", "express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}:${ExecutionId}:${ExpressId}", "labelled execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}/${MapRunLabel}:${ExecutionId}", "labelled express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}/${MapRunLabel}:${ExecutionId}:${ExpressId}", "maprun": "arn:${Partition}:states:${Region}:${Account}:mapRun:${StateMachineName}/${MapRunLabel}:${MapRunId}", "statemachine": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}", "statemachinealias": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineAliasName}", "statemachineversion": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineVersionId}"}, "textract": {"adapter": "arn:${Partition}:textract:${Region}:${Account}:/adapters/${AdapterId}", "adapterversion": "arn:${Partition}:textract:${Region}:${Account}:/adapters/${AdapterId}/versions/${AdapterVersion}"}, "timestream-influxdb": {"db-backup": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-backup/${DbBackupId}", "db-cluster": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-cluster/${DbClusterId}", "db-instance": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-instance/${DbInstanceIdentifier}", "db-parameter-group": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-parameter-group/${DbParameterGroupIdentifier}"}, "translate": {"parallel-data": "arn:${Partition}:translate:${Region}:${Account}:parallel-data/${ResourceName}", "terminology": "arn:${Partition}:translate:${Region}:${Account}:terminology/${ResourceName}"}}, + "arnFormats": {"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}", "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}"}, "cloudtrail": {"channel": "arn:${Partition}:cloudtrail:${Region}:${Account}:channel/${ChannelId}", "dashboard": "arn:${Partition}:cloudtrail:${Region}:${Account}:dashboard/${DashboardName}", "eventdatastore": "arn:${Partition}:cloudtrail:${Region}:${Account}:eventdatastore/${EventDataStoreId}", "trail": "arn:${Partition}:cloudtrail:${Region}:${Account}:trail/${TrailName}"}, "codebuild": {"build": "arn:${Partition}:codebuild:${Region}:${Account}:build/${BuildId}", "build-batch": "arn:${Partition}:codebuild:${Region}:${Account}:build-batch/${BuildBatchId}", "fleet": "arn:${Partition}:codebuild:${Region}:${Account}:fleet/${FleetName}:${FleetId}", "project": "arn:${Partition}:codebuild:${Region}:${Account}:project/${ProjectName}", "report": "arn:${Partition}:codebuild:${Region}:${Account}:report/${ReportGroupName}:${ReportId}", "report-group": "arn:${Partition}:codebuild:${Region}:${Account}:report-group/${ReportGroupName}", "sandbox": "arn:${Partition}:codebuild:${Region}:${Account}:sandbox/${SandboxId}"}, "codepipeline": {"action": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}/${ActionName}", "actiontype": "arn:${Partition}:codepipeline:${Region}:${Account}:actiontype:${Owner}/${Category}/${Provider}/${Version}", "pipeline": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}", "stage": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}", "webhook": "arn:${Partition}:codepipeline:${Region}:${Account}:webhook:${WebhookName}"}, "cognito-identity": {"identitypool": "arn:${Partition}:cognito-identity:${Region}:${Account}:identitypool/${IdentityPoolId}"}, "cognito-idp": {"userpool": "arn:${Partition}:cognito-idp:${Region}:${Account}:userpool/${UserPoolId}", "webacl": "arn:${Partition}:wafv2:${Region}:${Account}:${Scope}/webacl/${Name}/${Id}"}, "cur": {"cur": "arn:${Partition}:cur:${Region}:${Account}:definition/${ReportName}"}, "datasync": {"agent": "arn:${Partition}:datasync:${Region}:${Account}:agent/${AgentId}", "discoveryjob": "arn:${Partition}:datasync:${Region}:${Account}:system/${StorageSystemId}/job/${DiscoveryJobId}", "location": "arn:${Partition}:datasync:${Region}:${Account}:location/${LocationId}", "storagesystem": "arn:${Partition}:datasync:${Region}:${Account}:system/${StorageSystemId}", "task": "arn:${Partition}:datasync:${Region}:${Account}:task/${TaskId}", "taskexecution": "arn:${Partition}:datasync:${Region}:${Account}:task/${TaskId}/execution/${ExecutionId}"}, "dynamodb": {"backup": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/backup/${BackupName}", "export": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/export/${ExportName}", "global-table": "arn:${Partition}:dynamodb::${Account}:global-table/${GlobalTableName}", "import": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/import/${ImportName}", "index": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/index/${IndexName}", "stream": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/stream/${StreamLabel}", "table": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}"}, "ecr": {"repository": "arn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName}"}, "elasticloadbalancing": {"listener-rule/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener-rule/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/gwy": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/gwy/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "loadbalancer": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/${LoadBalancerName}", "loadbalancer/app/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/gwy/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/gwy/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/net/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/net/${LoadBalancerName}/${LoadBalancerId}", "targetgroup": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:targetgroup/${TargetGroupName}/${TargetGroupId}", "truststore": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:truststore/${TrustStoreName}/${TrustStoreId}"}, "elasticmapreduce": {"cluster": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:cluster/${ClusterId}", "editor": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:editor/${EditorId}", "notebook-execution": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:notebook-execution/${NotebookExecutionId}", "session": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:cluster/${ClusterId}/session/${SessionId}", "studio": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:studio/${StudioId}"}, "es": {"application": "arn:${Partition}:opensearch:${Region}:${Account}:application/${AppId}", "datasource": "arn:${Partition}:opensearch:${Region}:${Account}:datasource/${DataSourceName}", "domain": "arn:${Partition}:es:${Region}:${Account}:domain/${DomainName}", "es_role": "arn:${Partition}:iam::${Account}:role/aws-service-role/es.amazonaws.com/AWSServiceRoleForAmazonOpenSearchService", "opensearchservice_role": "arn:${Partition}:iam::${Account}:role/aws-service-role/opensearchservice.amazonaws.com/AWSServiceRoleForAmazonOpenSearchService"}, "events": {"alias": "arn:${Partition}:kms:${Region}:${Account}:alias/${Alias}", "api-destination": "arn:${Partition}:events:${Region}:${Account}:api-destination/${ApiDestinationName}", "archive": "arn:${Partition}:events:${Region}:${Account}:archive/${ArchiveName}", "connection": "arn:${Partition}:events:${Region}:${Account}:connection/${ConnectionName}", "create-snapshot": "arn:${Partition}:events:${Region}:${Account}:target/create-snapshot", "endpoint": "arn:${Partition}:events:${Region}:${Account}:endpoint/${EndpointName}", "event-bus": "arn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName}", "event-busv2": "arn:${Partition}:events:${Region}:${Account}:event-busv2/${EventBusName}/${OpaqueId}", "event-source": "arn:${Partition}:events:${Region}::event-source/${EventSourceName}", "event-sourcev2": "arn:${Partition}:events:${Region}:${Account}:event-sourcev2/${SourceType}/${EventSourceName}/${OpaqueId}", "key": "arn:${Partition}:kms:${Region}:${Account}:key/${KeyId}", "reboot-instance": "arn:${Partition}:events:${Region}:${Account}:target/reboot-instance", "replay": "arn:${Partition}:events:${Region}:${Account}:replay/${ReplayName}", "rule-on-custom-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName}", "rule-on-default-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${RuleName}", "stop-instance": "arn:${Partition}:events:${Region}:${Account}:target/stop-instance", "subscriber": "arn:${Partition}:events:${Region}:${Account}:subscriber/${SubscriberName}/${OpaqueId}", "terminate-instance": "arn:${Partition}:events:${Region}:${Account}:target/terminate-instance"}, "firehose": {"deliverystream": "arn:${Partition}:firehose:${Region}:${Account}:deliverystream/${DeliveryStreamName}"}, "globalaccelerator": {"accelerator": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}", "attachment": "arn:${Partition}:globalaccelerator::${Account}:attachment/${ResourceId}", "endpointgroup": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}/listener/${ListenerId}/endpoint-group/${EndpointGroupId}", "listener": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}/listener/${ListenerId}"}, "kinesisanalytics": {"application": "arn:${Partition}:kinesisanalytics:${Region}:${Account}:application/${ApplicationName}"}, "logs": {"anomaly-detector": "arn:${Partition}:logs:${Region}:${Account}:anomaly-detector:${DetectorId}", "delivery": "arn:${Partition}:logs:${Region}:${Account}:delivery:${DeliveryName}", "delivery-destination": "arn:${Partition}:logs:${Region}:${Account}:delivery-destination:${DeliveryDestinationName}", "delivery-source": "arn:${Partition}:logs:${Region}:${Account}:delivery-source:${DeliverySourceName}", "destination": "arn:${Partition}:logs:${Region}:${Account}:destination:${DestinationName}", "log-group": "arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}", "log-stream": "arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}", "lookup-table": "arn:${Partition}:logs:${Region}:${Account}:lookup-table:${LookupTableName}", "scheduled-query": "arn:${Partition}:logs:${Region}:${Account}:scheduled-query:${ScheduledQueryId}"}, "payment-cryptography": {"alias": "arn:${Partition}:payment-cryptography:${Region}:${Account}:alias/${Alias}", "approval-team": "arn:${Partition}:mpa:${Region}:${Account}:approval-team/${ApprovalTeamId}", "key": "arn:${Partition}:payment-cryptography:${Region}:${Account}:key/${KeyId}"}, "redshift-data": {"cluster": "arn:${Partition}:redshift:${Region}:${Account}:cluster:${ClusterName}", "managed-workgroup": "arn:${Partition}:redshift-serverless:${Region}:${Account}:managed-workgroup/${ManagedWorkgroupId}", "workgroup": "arn:${Partition}:redshift-serverless:${Region}:${Account}:workgroup/${WorkgroupId}"}, "rekognition": {"collection": "arn:${Partition}:rekognition:${Region}:${Account}:collection/${CollectionId}", "dataset": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/dataset/${DatasetType}/${CreationTimestamp}", "project": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/${CreationTimestamp}", "projectversion": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/version/${VersionName}/${CreationTimestamp}", "streamprocessor": "arn:${Partition}:rekognition:${Region}:${Account}:streamprocessor/${StreamprocessorId}"}, "servicediscovery": {"namespace": "arn:${Partition}:servicediscovery:${Region}:${Account}:namespace/${NamespaceId}", "service": "arn:${Partition}:servicediscovery:${Region}:${Account}:service/${ServiceId}"}, "servicequotas": {"quota": "arn:${Partition}:servicequotas:${Region}:${Account}:${ServiceCode}/${QuotaCode}"}, "sso": {"Account": "arn:${Partition}:sso:::account/${AccountId}", "Application": "arn:${Partition}:sso::${Account}:application/${InstanceId}/${ApplicationId}", "ApplicationProvider": "arn:${Partition}:sso::aws:applicationProvider/${ApplicationProviderId}", "Instance": "arn:${Partition}:sso:::instance/${InstanceId}", "PermissionSet": "arn:${Partition}:sso:::permissionSet/${InstanceId}/${PermissionSetId}", "TrustedTokenIssuer": "arn:${Partition}:sso::${Account}:trustedTokenIssuer/${InstanceId}/${TrustedTokenIssuerId}"}, "states": {"activity": "arn:${Partition}:states:${Region}:${Account}:activity:${ActivityName}", "execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}:${ExecutionId}", "express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}:${ExecutionId}:${ExpressId}", "labelled execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}/${MapRunLabel}:${ExecutionId}", "labelled express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}/${MapRunLabel}:${ExecutionId}:${ExpressId}", "maprun": "arn:${Partition}:states:${Region}:${Account}:mapRun:${StateMachineName}/${MapRunLabel}:${MapRunId}", "statemachine": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}", "statemachinealias": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineAliasName}", "statemachineversion": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineVersionId}"}, "textract": {"adapter": "arn:${Partition}:textract:${Region}:${Account}:/adapters/${AdapterId}", "adapterversion": "arn:${Partition}:textract:${Region}:${Account}:/adapters/${AdapterId}/versions/${AdapterVersion}"}, "timestream-influxdb": {"db-backup": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-backup/${DbBackupId}", "db-cluster": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-cluster/${DbClusterId}", "db-instance": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-instance/${DbInstanceIdentifier}", "db-parameter-group": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-parameter-group/${DbParameterGroupIdentifier}"}, "translate": {"parallel-data": "arn:${Partition}:translate:${Region}:${Account}:parallel-data/${ResourceName}", "terminology": "arn:${Partition}:translate:${Region}:${Account}:terminology/${ResourceName}"}}, "unqualified": {"states": ["statemachine"]}, "mintedIds": {"events": ["api-destination", "connection"]}, "operations": { @@ -831,6 +831,126 @@ "elasticmapreduce:TerminateSession": {"action": "elasticmapreduce:TerminateSession", "types": ["session"], "resources": [{"type": "session", "fill": {"ClusterId": "ClusterId", "SessionId": "SessionId"}}]}, "elasticmapreduce:UpdateStudio": {"action": "elasticmapreduce:UpdateStudio", "types": ["studio"], "resources": [{"types": ["studio"], "arn": "EncryptionKeyArn"}, {"type": "studio", "fill": {"StudioId": "StudioId"}}]}, "elasticmapreduce:UpdateStudioSessionMapping": {"action": "elasticmapreduce:UpdateStudioSessionMapping", "types": ["studio"], "resources": [{"types": ["studio"], "arn": "SessionPolicyArn"}, {"type": "studio", "fill": {"StudioId": "StudioId"}}]}, + "es:AcceptInboundConnection": {"action": "es:AcceptInboundConnection", "types": [], "resources": []}, + "es:AcceptInboundCrossClusterSearchConnection": {"action": "es:AcceptInboundCrossClusterSearchConnection", "types": [], "resources": []}, + "es:AddDataSource": {"action": "es:AddDataSource", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:AddDirectQueryDataSource": {"action": "es:AddDirectQueryDataSource", "types": ["datasource"], "resources": [{"types": ["datasource"], "arn": "OpenSearchArns[]"}, {"type": "datasource", "fill": {"DataSourceName": "DataSourceName"}}]}, + "es:AddTags": {"action": "es:AddTags", "types": ["application", "datasource", "domain"], "resources": [{"types": ["application", "datasource", "domain"], "arn": "ARN"}]}, + "es:AssociatePackage": {"action": "es:AssociatePackage", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:AssociatePackages": {"action": "es:AssociatePackages", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:AttachDataSource": {"action": "es:AttachDataSource", "types": ["application"], "resources": [{"types": ["application"], "arn": "dataSourceArn"}]}, + "es:AuthorizeVpcEndpointAccess": {"action": "es:AuthorizeVpcEndpointAccess", "types": [], "resources": []}, + "es:CancelDomainConfigChange": {"action": "es:CancelDomainConfigChange", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:CancelElasticsearchServiceSoftwareUpdate": {"action": "es:CancelElasticsearchServiceSoftwareUpdate", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:CancelServiceSoftwareUpdate": {"action": "es:CancelServiceSoftwareUpdate", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:CreateApplication": {"action": "es:CreateApplication", "types": [], "resources": []}, + "es:CreateDomain": {"action": "es:CreateDomain", "types": ["domain"], "resources": [{"types": ["domain"], "arn": "CognitoOptions.RoleArn"}, {"types": ["domain"], "arn": "DomainEndpointOptions.CustomEndpointCertificateArn"}, {"types": ["domain"], "arn": "IdentityCenterOptions.IdentityCenterInstanceARN"}, {"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:CreateElasticsearchDomain": {"action": "es:CreateElasticsearchDomain", "types": ["domain"], "resources": [{"types": ["domain"], "arn": "CognitoOptions.RoleArn"}, {"types": ["domain"], "arn": "DomainEndpointOptions.CustomEndpointCertificateArn"}, {"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:CreateIndex": {"action": "es:CreateIndex", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:CreateOutboundConnection": {"action": "es:CreateOutboundConnection", "types": ["domain"], "resources": []}, + "es:CreateOutboundCrossClusterSearchConnection": {"action": "es:CreateOutboundCrossClusterSearchConnection", "types": ["domain"], "resources": []}, + "es:CreatePackage": {"action": "es:CreatePackage", "types": [], "resources": []}, + "es:CreateVpcEndpoint": {"action": "es:CreateVpcEndpoint", "types": [], "resources": []}, + "es:DeleteApplication": {"action": "es:DeleteApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"AppId": "id"}}], "located": {"id": "{id}"}}, + "es:DeleteDataSource": {"action": "es:DeleteDataSource", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DeleteDirectQueryDataSource": {"action": "es:DeleteDirectQueryDataSource", "types": ["datasource"], "resources": [{"type": "datasource", "fill": {"DataSourceName": "DataSourceName"}}], "located": {"DataSourceName": "{DataSourceName}"}}, + "es:DeleteDomain": {"action": "es:DeleteDomain", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DeleteElasticsearchDomain": {"action": "es:DeleteElasticsearchDomain", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DeleteElasticsearchServiceRole": {"action": "es:DeleteElasticsearchServiceRole", "types": [], "resources": []}, + "es:DeleteInboundConnection": {"action": "es:DeleteInboundConnection", "types": [], "resources": []}, + "es:DeleteInboundCrossClusterSearchConnection": {"action": "es:DeleteInboundCrossClusterSearchConnection", "types": [], "resources": []}, + "es:DeleteIndex": {"action": "es:DeleteIndex", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DeleteOutboundConnection": {"action": "es:DeleteOutboundConnection", "types": [], "resources": []}, + "es:DeleteOutboundCrossClusterSearchConnection": {"action": "es:DeleteOutboundCrossClusterSearchConnection", "types": [], "resources": []}, + "es:DeletePackage": {"action": "es:DeletePackage", "types": [], "resources": []}, + "es:DeleteVpcEndpoint": {"action": "es:DeleteVpcEndpoint", "types": [], "resources": []}, + "es:DeregisterCapability": {"action": "es:DeregisterCapability", "types": ["application"], "resources": [{"type": "application", "fill": {"AppId": "applicationId"}}], "located": {"applicationId": "{ApplicationId}"}}, + "es:DescribeDataSourceAttachment": {"action": "es:DescribeDataSourceAttachment", "types": ["application"], "resources": [{"types": ["application"], "arn": "dataSourceArn"}]}, + "es:DescribeDomain": {"action": "es:DescribeDomain", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeDomainAutoTunes": {"action": "es:DescribeDomainAutoTunes", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeDomainChangeProgress": {"action": "es:DescribeDomainChangeProgress", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeDomainConfig": {"action": "es:DescribeDomainConfig", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeDomainHealth": {"action": "es:DescribeDomainHealth", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeDomainNodes": {"action": "es:DescribeDomainNodes", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeDomains": {"action": "es:DescribeDomains", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainNames[]"}}]}, + "es:DescribeDryRunProgress": {"action": "es:DescribeDryRunProgress", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeElasticsearchDomain": {"action": "es:DescribeElasticsearchDomain", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeElasticsearchDomainConfig": {"action": "es:DescribeElasticsearchDomainConfig", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DescribeElasticsearchDomains": {"action": "es:DescribeElasticsearchDomains", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainNames[]"}}]}, + "es:DescribeElasticsearchInstanceTypeLimits": {"action": "es:DescribeElasticsearchInstanceTypeLimits", "types": [], "resources": []}, + "es:DescribeInboundConnections": {"action": "es:DescribeInboundConnections", "types": [], "resources": []}, + "es:DescribeInboundCrossClusterSearchConnections": {"action": "es:DescribeInboundCrossClusterSearchConnections", "types": [], "resources": []}, + "es:DescribeInsightDetails": {"action": "es:DescribeInsightDetails", "types": ["domain"], "resources": []}, + "es:DescribeInstanceTypeLimits": {"action": "es:DescribeInstanceTypeLimits", "types": [], "resources": []}, + "es:DescribeOutboundConnections": {"action": "es:DescribeOutboundConnections", "types": [], "resources": []}, + "es:DescribeOutboundCrossClusterSearchConnections": {"action": "es:DescribeOutboundCrossClusterSearchConnections", "types": [], "resources": []}, + "es:DescribePackages": {"action": "es:DescribePackages", "types": [], "resources": []}, + "es:DescribeReservedElasticsearchInstanceOfferings": {"action": "es:DescribeReservedElasticsearchInstanceOfferings", "types": [], "resources": []}, + "es:DescribeReservedElasticsearchInstances": {"action": "es:DescribeReservedElasticsearchInstances", "types": [], "resources": []}, + "es:DescribeReservedInstanceOfferings": {"action": "es:DescribeReservedInstanceOfferings", "types": [], "resources": []}, + "es:DescribeReservedInstances": {"action": "es:DescribeReservedInstances", "types": [], "resources": []}, + "es:DescribeVpcEndpoints": {"action": "es:DescribeVpcEndpoints", "types": [], "resources": []}, + "es:DetachDataSource": {"action": "es:DetachDataSource", "types": ["application"], "resources": [{"types": ["application"], "arn": "dataSourceArn"}]}, + "es:DissociatePackage": {"action": "es:DissociatePackage", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:DissociatePackages": {"action": "es:DissociatePackages", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:GetApplication": {"action": "es:GetApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"AppId": "id"}}], "located": {"id": "{id}"}}, + "es:GetCapability": {"action": "es:GetCapability", "types": ["application"], "resources": [{"type": "application", "fill": {"AppId": "applicationId"}}], "located": {"applicationId": "{ApplicationId}"}}, + "es:GetCompatibleElasticsearchVersions": {"action": "es:GetCompatibleElasticsearchVersions", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "?domainName"}}, + "es:GetCompatibleVersions": {"action": "es:GetCompatibleVersions", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "?domainName"}}, + "es:GetDataSource": {"action": "es:GetDataSource", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:GetDefaultApplicationSetting": {"action": "es:GetDefaultApplicationSetting", "types": ["application"], "resources": []}, + "es:GetDirectQueryDataSource": {"action": "es:GetDirectQueryDataSource", "types": ["datasource"], "resources": [{"type": "datasource", "fill": {"DataSourceName": "DataSourceName"}}], "located": {"DataSourceName": "{DataSourceName}"}}, + "es:GetDomainMaintenanceStatus": {"action": "es:GetDomainMaintenanceStatus", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:GetIndex": {"action": "es:GetIndex", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:GetMigration": {"action": "es:GetMigration", "types": ["application"], "resources": []}, + "es:GetPackageVersionHistory": {"action": "es:GetPackageVersionHistory", "types": [], "resources": []}, + "es:GetUpgradeHistory": {"action": "es:GetUpgradeHistory", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:GetUpgradeStatus": {"action": "es:GetUpgradeStatus", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:InsightFeedback": {"action": "es:InsightFeedback", "types": ["domain"], "resources": []}, + "es:ListApplications": {"action": "es:ListApplications", "types": ["application"], "resources": []}, + "es:ListDataSourceAttachments": {"action": "es:ListDataSourceAttachments", "types": ["application"], "resources": []}, + "es:ListDataSources": {"action": "es:ListDataSources", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:ListDirectQueryDataSources": {"action": "es:ListDirectQueryDataSources", "types": ["datasource"], "resources": []}, + "es:ListDomainMaintenances": {"action": "es:ListDomainMaintenances", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:ListDomainNames": {"action": "es:ListDomainNames", "types": [], "resources": []}, + "es:ListDomainsForPackage": {"action": "es:ListDomainsForPackage", "types": [], "resources": []}, + "es:ListElasticsearchInstanceTypes": {"action": "es:ListElasticsearchInstanceTypes", "types": [], "resources": []}, + "es:ListElasticsearchVersions": {"action": "es:ListElasticsearchVersions", "types": [], "resources": []}, + "es:ListInsights": {"action": "es:ListInsights", "types": ["domain"], "resources": []}, + "es:ListInstanceTypeDetails": {"action": "es:ListInstanceTypeDetails", "types": [], "resources": []}, + "es:ListMigrations": {"action": "es:ListMigrations", "types": ["application"], "resources": [{"type": "application", "fill": {"AppId": "applicationId"}}], "located": {"applicationId": "?applicationId"}}, + "es:ListPackagesForDomain": {"action": "es:ListPackagesForDomain", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:ListScheduledActions": {"action": "es:ListScheduledActions", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:ListTags": {"action": "es:ListTags", "types": ["application", "datasource", "domain"], "resources": [{"types": ["application", "datasource", "domain"], "arn": "ARN"}], "located": {"ARN": "?arn"}}, + "es:ListVersions": {"action": "es:ListVersions", "types": [], "resources": []}, + "es:ListVpcEndpointAccess": {"action": "es:ListVpcEndpointAccess", "types": [], "resources": []}, + "es:ListVpcEndpoints": {"action": "es:ListVpcEndpoints", "types": [], "resources": []}, + "es:ListVpcEndpointsForDomain": {"action": "es:ListVpcEndpointsForDomain", "types": [], "resources": []}, + "es:PurchaseReservedElasticsearchInstanceOffering": {"action": "es:PurchaseReservedElasticsearchInstanceOffering", "types": [], "resources": []}, + "es:PurchaseReservedInstanceOffering": {"action": "es:PurchaseReservedInstanceOffering", "types": [], "resources": []}, + "es:PutDefaultApplicationSetting": {"action": "es:PutDefaultApplicationSetting", "types": ["application"], "resources": [{"types": ["application"], "arn": "applicationArn"}]}, + "es:RegisterCapability": {"action": "es:RegisterCapability", "types": ["application"], "resources": [{"type": "application", "fill": {"AppId": "applicationId"}}], "located": {"applicationId": "{ApplicationId}"}}, + "es:RejectInboundConnection": {"action": "es:RejectInboundConnection", "types": [], "resources": []}, + "es:RejectInboundCrossClusterSearchConnection": {"action": "es:RejectInboundCrossClusterSearchConnection", "types": [], "resources": []}, + "es:RemoveTags": {"action": "es:RemoveTags", "types": ["application", "datasource", "domain"], "resources": [{"types": ["application", "datasource", "domain"], "arn": "ARN"}]}, + "es:RevokeVpcEndpointAccess": {"action": "es:RevokeVpcEndpointAccess", "types": [], "resources": []}, + "es:RollbackServiceSoftwareUpdate": {"action": "es:RollbackServiceSoftwareUpdate", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:StartDomainMaintenance": {"action": "es:StartDomainMaintenance", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:StartElasticsearchServiceSoftwareUpdate": {"action": "es:StartElasticsearchServiceSoftwareUpdate", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:StartMigration": {"action": "es:StartMigration", "types": ["application"], "resources": [{"type": "application", "fill": {"AppId": "applicationId"}}]}, + "es:StartServiceSoftwareUpdate": {"action": "es:StartServiceSoftwareUpdate", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:UpdateApplication": {"action": "es:UpdateApplication", "types": ["application"], "resources": [{"types": ["application"], "arn": "dataSources[].dataSourceArn"}, {"types": ["application"], "arn": "dataSources[].iamRoleForDataSourceArn"}, {"types": ["application"], "arn": "iamIdentityCenterOptions.iamIdentityCenterInstanceArn"}, {"types": ["application"], "arn": "iamIdentityCenterOptions.iamRoleForIdentityCenterApplicationArn"}, {"type": "application", "fill": {"AppId": "id"}}], "located": {"id": "{id}"}}, + "es:UpdateDataSource": {"action": "es:UpdateDataSource", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:UpdateDirectQueryDataSource": {"action": "es:UpdateDirectQueryDataSource", "types": ["datasource"], "resources": [{"types": ["datasource"], "arn": "OpenSearchArns[]"}, {"type": "datasource", "fill": {"DataSourceName": "DataSourceName"}}], "located": {"DataSourceName": "{DataSourceName}"}}, + "es:UpdateDomainConfig": {"action": "es:UpdateDomainConfig", "types": ["domain"], "resources": [{"types": ["domain"], "arn": "CognitoOptions.RoleArn"}, {"types": ["domain"], "arn": "DomainEndpointOptions.CustomEndpointCertificateArn"}, {"types": ["domain"], "arn": "IdentityCenterOptions.IdentityCenterInstanceARN"}, {"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:UpdateElasticsearchDomainConfig": {"action": "es:UpdateElasticsearchDomainConfig", "types": ["domain"], "resources": [{"types": ["domain"], "arn": "CognitoOptions.RoleArn"}, {"types": ["domain"], "arn": "DomainEndpointOptions.CustomEndpointCertificateArn"}, {"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:UpdateIndex": {"action": "es:UpdateIndex", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:UpdatePackage": {"action": "es:UpdatePackage", "types": [], "resources": []}, + "es:UpdatePackageScope": {"action": "es:UpdatePackageScope", "types": [], "resources": []}, + "es:UpdateScheduledAction": {"action": "es:UpdateScheduledAction", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}], "located": {"DomainName": "{DomainName}"}}, + "es:UpdateVpcEndpoint": {"action": "es:UpdateVpcEndpoint", "types": [], "resources": []}, + "es:UpgradeDomain": {"action": "es:UpgradeDomain", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, + "es:UpgradeElasticsearchDomain": {"action": "es:UpgradeElasticsearchDomain", "types": ["domain"], "resources": [{"type": "domain", "fill": {"DomainName": "DomainName"}}]}, "events:ActivateEventSource": {"action": "events:ActivateEventSource", "types": ["event-source"], "resources": [{"type": "event-source", "fill": {"EventSourceName": "Name"}}]}, "events:CancelReplay": {"action": "events:CancelReplay", "types": ["replay"], "resources": [{"type": "replay", "fill": {"ReplayName": "ReplayName"}}]}, "events:CreateApiDestination": {"action": "events:CreateApiDestination", "types": ["api-destination", "connection"], "resources": [{"types": ["api-destination", "connection"], "arn": "ConnectionArn"}, {"type": "api-destination", "fill": {"ApiDestinationName": "Name"}, "made": true}]}, diff --git a/src/test/java/io/github/hectorvent/floci/core/common/RequestResourceMembersTest.java b/src/test/java/io/github/hectorvent/floci/core/common/RequestResourceMembersTest.java index 02faa13a2d..c1ed0dfe95 100644 --- a/src/test/java/io/github/hectorvent/floci/core/common/RequestResourceMembersTest.java +++ b/src/test/java/io/github/hectorvent/floci/core/common/RequestResourceMembersTest.java @@ -7,6 +7,9 @@ import io.github.hectorvent.floci.core.common.RequestResourceMembers.Member; import io.github.hectorvent.floci.core.common.RequestResourceMembers.Resource; import jakarta.ws.rs.container.ContainerRequestContext; import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedHashMap; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.UriInfo; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestFactory; @@ -279,7 +282,8 @@ class RequestResourceMembersTest { * account member names when it has one, with those sharing its explicit member selector, those the operation * always names, such as a create's new resource (Cloud Map's {@code CreateService}), and those filled from the ARN * it is read from (a permission set made in an instance); one named through another resource of its service's - * own, the ARN its service gives for that. + * own, the ARN its service gives for that. A member the table locates in a REST request's path or query is given + * there, a body giving it naming nothing, and such a request is not checked as a form. */ @TestFactory Stream everyResourceOfTheTableIsReadFromAJsonBodyAndAForm() { @@ -308,8 +312,20 @@ class RequestResourceMembersTest { given.put(new Member(member, false), allowed.getFirst()); } }); + // A member the table locates in a REST request's path or query goes there, where the reader takes it + // from; a REST request has no form, so the form is checked for an operation locating none. + Map located = table.located().getOrDefault(operation.getKey(), Map.of()); + Map labels = new LinkedHashMap<>(); + MultivaluedMap query = new MultivaluedHashMap<>(); given.forEach((member, value) -> { - put(body, member, value); + String where = member.field() == null && !member.list() ? located.get(member.name()) : null; + if (where == null) { + put(body, member, value); + } else if (where.startsWith("{")) { + labels.put(where.substring(1, where.length() - 1), value); + } else { + query.add(where.substring(1), value); + } form.append('&').append(parameter(member)).append('=').append(encoded(value)); }); List named = operation.getValue().stream() @@ -323,12 +339,17 @@ class RequestResourceMembersTest { "000000000000")) .distinct().toList(); StoredResourceArns stored = runningOn(namespace, arn); - assertEquals(named, RequestResources.of(operation.getKey(), - servedBy(json(body.toString()), resource.endpoint()), "aws", "us-east-1", "000000000000", - stored), body.toString()); - assertEquals(named, RequestResources.of(operation.getKey(), - servedBy(form(form.toString()), resource.endpoint()), "aws", "us-east-1", "000000000000", - stored), form.toString()); + ContainerRequestContext request = servedBy(json(body.toString()), resource.endpoint()); + UriInfo uriInfo = mock(UriInfo.class); + when(uriInfo.getQueryParameters()).thenReturn(query); + when(request.getUriInfo()).thenReturn(uriInfo); + assertEquals(named, RequestResources.of(operation.getKey(), request, "aws", "us-east-1", + "000000000000", stored, labels), body + " " + labels + " " + query); + if (given.keySet().stream().noneMatch(member -> located.containsKey(member.name()))) { + assertEquals(named, RequestResources.of(operation.getKey(), + servedBy(form(form.toString()), resource.endpoint()), "aws", "us-east-1", + "000000000000", stored), form.toString()); + } }))); } diff --git a/src/test/java/io/github/hectorvent/floci/core/common/RequestResourcesTest.java b/src/test/java/io/github/hectorvent/floci/core/common/RequestResourcesTest.java index cff3de359b..0d6ffae93c 100644 --- a/src/test/java/io/github/hectorvent/floci/core/common/RequestResourcesTest.java +++ b/src/test/java/io/github/hectorvent/floci/core/common/RequestResourcesTest.java @@ -4,6 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.cbor.CBORFactory; import jakarta.ws.rs.container.ContainerRequestContext; import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedHashMap; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.UriInfo; import org.junit.jupiter.api.Test; import java.io.ByteArrayInputStream; @@ -826,6 +829,49 @@ class RequestResourcesTest { return request("application/x-amz-json-1.1", body); } + /** + * A REST request's member the table locates in its path is read from the labels of the route it was routed by, + * one it locates in its query from the query, and one in its body from the body beside them: OpenSearch's + * {@code DescribeDomain} names its domain in the path, {@code ListTags} its ARN in {@code ?arn}, and + * {@code UpdateDomainConfig} its domain in the path under a JSON body. With no label given, the path member names + * nothing, so the request is checked on {@code *}; and a located member is read from where it is alone, a body + * giving it under its name naming nothing: {@code GetCompatibleVersions} with a domain in its body and none in its + * query, which its handler answers with every domain's versions, names no domain. + */ + @Test + void aRestRequestsPathAndQueryMembersAreReadWhereTheTableLocatesThem() { + String domain = "arn:aws:es:us-east-1:111111111111:domain/logs"; + assertEquals(List.of(domain), RequestResources.of("es:DescribeDomain", rest("GET", null, Map.of()), "aws", + "us-east-1", "111111111111", null, Map.of("DomainName", "logs"))); + assertEquals(List.of(), RequestResources.of("es:DescribeDomain", rest("GET", null, Map.of()), "aws", + "us-east-1", "111111111111", null, Map.of())); + assertEquals(List.of(domain), RequestResources.of("es:ListTags", rest("GET", null, Map.of("arn", domain)), "aws", + "us-east-1", "111111111111", null, Map.of())); + assertEquals(List.of(domain), RequestResources.of("es:UpdateDomainConfig", + rest("POST", "{\"EngineVersion\":\"OpenSearch_2.11\"}", Map.of()), "aws", "us-east-1", "111111111111", + null, Map.of("DomainName", "logs"))); + assertEquals(List.of(), RequestResources.of("es:GetCompatibleVersions", + rest("GET", "{\"DomainName\":\"logs\"}", Map.of()), "aws", "us-east-1", "111111111111", null, Map.of())); + assertEquals(List.of(domain), RequestResources.of("es:GetCompatibleVersions", + rest("GET", "{\"DomainName\":\"other\"}", Map.of("domainName", "logs")), "aws", "us-east-1", + "111111111111", null, Map.of())); + assertEquals(List.of(domain), RequestResources.of("es:DescribeDomain", + rest("GET", "{\"DomainName\":\"other\"}", Map.of()), "aws", "us-east-1", "111111111111", null, + Map.of("DomainName", "logs"))); + } + + private static ContainerRequestContext rest(String method, String body, Map query) { + ContainerRequestContext request = body == null ? mock(ContainerRequestContext.class) + : request("application/json", body); + when(request.getMethod()).thenReturn(method); + UriInfo uriInfo = mock(UriInfo.class); + MultivaluedMap parameters = new MultivaluedHashMap<>(); + query.forEach(parameters::add); + when(uriInfo.getQueryParameters()).thenReturn(parameters); + when(request.getUriInfo()).thenReturn(uriInfo); + return request; + } + private static ContainerRequestContext form(String body) { return request("application/x-www-form-urlencoded", body); } diff --git a/src/test/java/io/github/hectorvent/floci/services/iam/IamActionRegistryTest.java b/src/test/java/io/github/hectorvent/floci/services/iam/IamActionRegistryTest.java index e0dcf924d7..d5735e473f 100644 --- a/src/test/java/io/github/hectorvent/floci/services/iam/IamActionRegistryTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/iam/IamActionRegistryTest.java @@ -25,6 +25,7 @@ import java.net.URI; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -47,10 +48,10 @@ class IamActionRegistryTest { /** * A REST request no rule maps is checked as the operation whose vendored route it matches, as that operation's * action, when Floci checks it on the resources AWS does: built by hand for its namespace ({@code Invoke} as - * {@code lambda:InvokeFunction}), read by the vendored request resources ({@code DescribeRepositories}), or - * none, AWS authorizing its action on no resource type ({@code ListDomainNames}). One AWS checks on a resource - * Floci does not read stays unmapped ({@code DescribeDomain}), as does a request matching no route, and a rule - * still decides a route it maps. + * {@code lambda:InvokeFunction}), read by the vendored request resources ({@code DescribeRepositories}, and + * {@code DescribeDomain} from its path), or none, AWS authorizing its action on no resource type + * ({@code ListDomainNames}). One AWS checks on a resource Floci does not read stays unmapped ({@code GetAnalyzer}), + * as does a request matching no route, and a rule still decides a route it maps. */ @Test void aRouteNoRuleMapsIsCheckedAsItsOperationWhenFlociChecksItAsAwsDoes() throws IOException { @@ -61,6 +62,9 @@ class IamActionRegistryTest { "ListDomainNames": {"method": "GET", "requestUri": "/unmapped/domain"}, "DescribeDomain": {"method": "GET", "requestUri": "/unmapped/domain/{DomainName}"} }}, + "accessanalyzer": {"credentialScope": "access-analyzer", "operations": { + "GetAnalyzer": {"method": "GET", "requestUri": "/unmapped/analyzer/{analyzerName}"} + }}, "ecr": {"credentialScope": "ecr", "operations": { "DescribeRepositories": {"method": "GET", "requestUri": "/unmapped/repositories"} }}, @@ -72,7 +76,8 @@ class IamActionRegistryTest { IamActionRegistry routed = new IamActionRegistry(routes); MultivaluedMap none = new MultivaluedHashMap<>(); assertEquals("es:ListDomainNames", routed.resolveRoute("es", mockCtx("GET", "/unmapped/domain", none, null, ""))); - assertNull(routed.resolveRoute("es", mockCtx("GET", "/unmapped/domain/logs", none, null, ""))); + assertEquals("es:DescribeDomain", routed.resolveRoute("es", mockCtx("GET", "/unmapped/domain/logs", none, null, ""))); + assertNull(routed.resolveRoute("access-analyzer", mockCtx("GET", "/unmapped/analyzer/a", none, null, ""))); assertNull(routed.resolveRoute("es", mockCtx("GET", "/other/domain", none, null, ""))); assertNull(routed.resolveRoute("other", mockCtx("GET", "/unmapped/domain", none, null, ""))); assertEquals("lambda:InvokeFunction", routed.resolveRoute("lambda", @@ -86,7 +91,7 @@ class IamActionRegistryTest { /** * With the vendored routes, OpenSearch's and Access Analyzer's requests whose actions act on no resource type * are checked as their operations, the OpenSearch VPC endpoint operations among them, in both API versions; - * those AWS checks on a domain or an analyzer stay unmapped, so a grant scoped to one is not refused. + * those AWS checks on an analyzer stay unmapped, so a grant scoped to one is not refused. */ @ParameterizedTest @CsvSource({"es,GET,/2021-01-01/domain,es:ListDomainNames", @@ -107,13 +112,39 @@ class IamActionRegistryTest { } @ParameterizedTest - @CsvSource({"es,GET,/2021-01-01/opensearch/domain/logs", "es,POST,/2021-01-01/opensearch/domain", - "es,GET,/2015-01-01/es/domain/logs", "access-analyzer,PUT,/analyzer", - "access-analyzer,GET,/analyzer/default", "access-analyzer,DELETE,/analyzer/default"}) + @CsvSource({"access-analyzer,PUT,/analyzer", "access-analyzer,GET,/analyzer/default", + "access-analyzer,DELETE,/analyzer/default"}) void aVendoredRouteAwsChecksOnAResourceStaysUnmapped(String scope, String method, String path) { assertNull(registry.resolveRoute(scope, mockCtx(method, path, new MultivaluedHashMap<>(), null, ""))); } + /** + * OpenSearch's domain routes, in both API versions, are checked as their operations, the vendored request + * resources reading the domain from the path, the body or the query, and the labels the routed path gives the + * route are the ones the request resources read. + */ + @ParameterizedTest + @CsvSource({"GET,/2021-01-01/opensearch/domain/logs,es:DescribeDomain", + "POST,/2021-01-01/opensearch/domain,es:CreateDomain", + "DELETE,/2021-01-01/opensearch/domain/logs,es:DeleteDomain", + "GET,/2021-01-01/opensearch/domain/logs/config,es:DescribeDomainConfig", + "GET,/2015-01-01/es/domain/logs,es:DescribeElasticsearchDomain", + "POST,/2015-01-01/es/domain/logs/config,es:UpdateElasticsearchDomainConfig"}) + void anOpenSearchDomainRouteIsCheckedAsItsOperation(String method, String path, String action) { + assertEquals(action, registry.resolveRoute("es", mockCtx(method, path, new MultivaluedHashMap<>(), null, ""))); + } + + @Test + void theLabelsOfTheVendoredRouteARequestMatchesAreItsPathsValuesDecoded() { + MultivaluedMap none = new MultivaluedHashMap<>(); + assertEquals(Map.of("DomainName", "logs"), + IamActionRegistry.pathLabels("es", mockCtx("GET", "/2021-01-01/opensearch/domain/logs", none, null, ""))); + assertEquals(Map.of("DomainName", "logs", "IndexName", "a b"), IamActionRegistry.pathLabels("es", + mockCtx("GET", "/2021-01-01/opensearch/domain/logs/index/a%20b", none, null, ""))); + assertEquals(Map.of(), IamActionRegistry.pathLabels("es", mockCtx("GET", "/nothing", none, null, ""))); + assertEquals(Map.of(), IamActionRegistry.pathLabels("sqs", mockCtx("GET", "/queue", none, null, ""))); + } + @ParameterizedTest @CsvSource({"/policy/validation", "/%70olicy/validation", "/policy/%76alidation", "/policy;ignored=yes/validation", "/policy/validation;ignored=yes", diff --git a/src/test/java/io/github/hectorvent/floci/services/iam/IamRestRouteEnforcementIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/iam/IamRestRouteEnforcementIntegrationTest.java index f5aa81eaaf..fee718e9ae 100644 --- a/src/test/java/io/github/hectorvent/floci/services/iam/IamRestRouteEnforcementIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/iam/IamRestRouteEnforcementIntegrationTest.java @@ -494,8 +494,8 @@ class IamRestRouteEnforcementIntegrationTest { /** * A route no rule maps is checked as the operation of its vendored route when AWS authorizes that operation's - * action on no resource type, in both OpenSearch API versions and for Access Analyzer; one AWS checks on a domain - * stays unchecked, so a grant scoped to the domain is not refused for want of reading it. + * action on no resource type, in both OpenSearch API versions and for Access Analyzer; one AWS checks on an + * analyzer stays unchecked, so a grant scoped to the analyzer is not refused for want of reading it. */ @Test void aVendoredRouteIsCheckedWhenAwsAuthorizesItsActionOnNoResourceType() { @@ -506,7 +506,7 @@ class IamRestRouteEnforcementIntegrationTest { refused(as(user, "es").get("/2015-01-01/domain").then(), "es:ListDomainNames"); refused(as(user, "es").get("/2021-01-01/opensearch/versions").then(), "es:ListVersions"); refused(as(user, "access-analyzer").get("/analyzer").then(), "access-analyzer:ListAnalyzers"); - as(user, "es").get("/2021-01-01/opensearch/domain/route-missing-" + suffix()).then().statusCode(409) + as(user, "access-analyzer").get("/analyzer/route-missing-" + suffix()).then().statusCode(404) .body(containsString("ResourceNotFoundException")); policy(user, allow("es:ListDomainNames", "*")); @@ -514,6 +514,36 @@ class IamRestRouteEnforcementIntegrationTest { as(user, "es").get("/2015-01-01/domain").then().statusCode(200); } + /** + * An OpenSearch request naming its domain in its path, or its ARN in its query, is checked on that domain, in + * both API versions: a grant scoped to the domain lets the request reach OpenSearch, which has no such domain, a + * request naming another domain is refused, and a deny on the domain holds under an allow on everything. A domain + * a request's body gives where OpenSearch reads it from the query names nothing: {@code GetCompatibleVersions} + * with the domain in its body alone, which OpenSearch answers with every version, is checked on {@code *}. + */ + @Test + void anOpenSearchRequestIsCheckedOnTheDomainItsPathOrQueryNames() { + String user = user("route-domain"); + String domain = "route-domain-" + suffix(); + String arn = "arn:aws:es:us-east-1:" + ACCOUNT + ":domain/" + domain; + policy(user, allow("es:DescribeDomain", arn) + "," + allow("es:DescribeElasticsearchDomain", arn) + "," + + allow("es:ListTags", arn) + "," + allow("es:GetCompatibleVersions", arn)); + as(user, "es").queryParam("domainName", domain).get("/2021-01-01/opensearch/compatibleVersions").then() + .statusCode(409); + refused(as(user, "es").body("{\"DomainName\":\"" + domain + "\"}").get("/2021-01-01/opensearch/compatibleVersions") + .then(), "es:GetCompatibleVersions"); + as(user, "es").get("/2021-01-01/opensearch/domain/" + domain).then().statusCode(409); + as(user, "es").get("/2015-01-01/es/domain/" + domain).then().statusCode(409); + as(user, "es").queryParam("arn", arn).get("/2021-01-01/tags/").then().statusCode(not(403)); + refused(as(user, "es").get("/2021-01-01/opensearch/domain/other-" + domain).then(), "es:DescribeDomain"); + refused(as(user, "es").get("/2015-01-01/es/domain/other-" + domain).then(), "es:DescribeElasticsearchDomain"); + refused(as(user, "es").queryParam("arn", arn + "-other").get("/2021-01-01/tags/").then(), "es:ListTags"); + + policy(user, allow("es:*", "*") + "," + deny("es:DescribeDomain", arn)); + refused(as(user, "es").get("/2021-01-01/opensearch/domain/" + domain).then(), "es:DescribeDomain"); + as(user, "es").get("/2021-01-01/opensearch/domain/other-" + domain).then().statusCode(409); + } + /** * A segment ending in a matrix parameter, which the router ignores, is checked as the route it reaches, on the * resource its path names: the routed path carries no matrix parameter, so the rule matches and the ARN is the diff --git a/tools/aws/regen_iam_request_resources.py b/tools/aws/regen_iam_request_resources.py index 108a54d432..04b8abc35c 100644 --- a/tools/aws/regen_iam_request_resources.py +++ b/tools/aws/regen_iam_request_resources.py @@ -60,6 +60,15 @@ A type nothing names is not checked: an action lists the optional resources its that covers what it does name. An operation whose action acts on no resource type, or whose request names none, is checked on `*`, as AWS checks it. +A REST request (`rest-json`) carries members in its path and its query as well as its body: a label of its path, +`{DomainName}`, and a parameter of its query, `?arn`, are members as its body's are, under their botocore names, and +the file records where each is (`located`), which the reader lays over the body from the path the request was routed +by and its query. A namespace read this way also takes the operations of each botocore model Floci reads REST routes +for under it (`regen_rest_routes.MODELS`) that the reference lists for none of its clients, each checked as the action +of its own name with that action's resource types when the reference has that action, and left out when it does not: +the reference lists one client's operations per namespace, and +OpenSearch Service's are the `es` client's alone, while the `opensearch` client's are named after `es` actions. + Every operation in `NAMESPACES` is read, whether Floci serves it or not. Explicit `CORRECTIONS` in `HAND_BUILT` are also read, overriding only those operations while the remaining operations keep their existing resource builders, and so are the operations `READ_IN_HAND_BUILT` lists, which @@ -141,6 +150,7 @@ from regen_iam_passed_roles import ( namespace_of, ) from regen_partitions import resolve_botocore_data +from regen_rest_routes import MODELS as REST_MODELS REPO_ROOT = Path(__file__).resolve().parents[2] OUTPUT = REPO_ROOT / "src/main/resources/aws/iam-request-resources.json" @@ -149,7 +159,7 @@ OUTPUT = REPO_ROOT / "src/main/resources/aws/iam-request-resources.json" # are the ones its handlers mint. NAMESPACES = ("acm", "application-autoscaling", "athena", "bcm-data-exports", "bcm-pricing-calculator", "budgets", "ce", "cloudtrail", "codebuild", "codepipeline", "cognito-identity", "cognito-idp", "cur", "datasync", "ecr", - "elasticloadbalancing", "elasticmapreduce", "events", "firehose", "globalaccelerator", "kinesisanalytics", + "elasticloadbalancing", "elasticmapreduce", "es", "events", "firehose", "globalaccelerator", "kinesisanalytics", "payment-cryptography", "redshift-data", "rekognition", "servicediscovery", "servicequotas", "sso", "states", "textract", "timestream-influxdb", "translate") @@ -159,6 +169,10 @@ CLIENTS_NOT_READ: dict[str, str] = { "kinesisanalytics": "Kinesis Data Analytics v1, SQL applications on the KinesisAnalytics_20150814 target, which " "Floci does not serve (it serves v2, kinesisanalyticsv2); its operations share v2's names and " "name their resources by other members", + "payment-cryptography-data": "the Payment Cryptography data plane, REST routes such as " + "/keys/{KeyIdentifier}/encrypt, which Floci does not serve (it serves the control " + "plane's JSON operations); its KeyIdentifier may be an alias, read on the control " + "plane by the handler, not by its path", } # The namespaces whose resources ResourceArnBuilder builds itself. @@ -224,7 +238,6 @@ NOT_COVERED: dict[str, str] = { "or EnvironmentId alone, so reading it needs the stored environment those find", "elasticfilesystem": _REST, "emr-serverless": _REST, - "es": _REST, "execute-api": _REST, "fis": _REST, "glue": _LATER, @@ -588,8 +601,11 @@ CREATING_RE = re.compile(r"^(Create|Run|Allocate|Register|Put|Import|Copy|Reques # An operation's verb: what follows is what it acts on. SUBJECT_RE = re.compile(r"^[A-Z][a-z]+") # The protocols whose requests RequestResources reads: form parameters or a JSON or CBOR body. -READ_PROTOCOLS = {"json", "query", "ec2", "smithy-rpc-v2-cbor"} +READ_PROTOCOLS = {"json", "query", "ec2", "smithy-rpc-v2-cbor", "rest-json"} BODY_LOCATIONS = (None, "") +# Where a REST request carries a member outside its body, as the file writes it: a label of its path, `{Name}`, or a +# parameter of its query, `?name`. +LOCATED_RE = re.compile(r"^(\{[A-Za-z0-9_]+\}|\?[A-Za-z0-9_.-]+)$") def stem(name: str) -> str: @@ -662,7 +678,7 @@ def request_members(models: dict[str, dict], operation: str) -> dict[str, str]: continue root = model["shapes"][spec["input"]["shape"]] for name, member in root.get("members", {}).items(): - if member.get("location") not in BODY_LOCATIONS: + if member.get("location") not in BODY_LOCATIONS and _located(member) is None: continue shape = model["shapes"][member["shape"]] if _strings(model, shape) is not None: @@ -672,6 +688,34 @@ def request_members(models: dict[str, dict], operation: str) -> dict[str, str]: return found +def located_members(models: dict[str, dict], operation: str) -> dict[str, str]: + """The members of a REST request that its path or its query carries, holding a string, by name, with where: + `{Label}` for a label of its path, `?name` for a parameter of its query. The reader lays them over the request's + body under their names, so a resource reads them as it reads a member of the body.""" + found: dict[str, str] = {} + for client, model in sorted(models.items()): + spec = model["operations"].get(operation) + if spec is None or "input" not in spec or "rest-json" not in _protocols(model): + continue + for name, member in model["shapes"][spec["input"]["shape"]].get("members", {}).items(): + where = _located(member) + if where is None or _strings(model, model["shapes"][member["shape"]]) != "": + continue + if found.setdefault(name, where) != where: + raise ValueError(f"{operation}'s {name} is {found[name]} in one client and {where} in {client}") + return dict(sorted(found.items())) + + +def _located(member: dict) -> str | None: + """Where a REST request carries a member outside its body, as `located_members` writes it; None for its body or a + header.""" + if member.get("location") == "uri": + return "{" + member.get("locationName", "") + "}" + if member.get("location") == "querystring": + return "?" + member.get("locationName", "") + return None + + def _strings(model: dict, shape: dict) -> str | None: """How a path reads a shape that holds a string (``) or a list of strings (`[]`); None for another.""" if shape["type"] == "string": @@ -980,9 +1024,24 @@ def entry_for(operation: str, upstream: dict, formats: dict[str, str], models: d creates = creates_for(operation, types, formats, members) if creates: entry["creates"] = creates + named = _named(resources) | _named(creates) + located = {member: where for member, where in located_members(models, operation.split(":", 1)[1]).items() + if member in named} + if located: + entry["located"] = located return entry +def _named(value: object) -> set[str]: + """The member names an operation's resources read: every key and string they hold, each up to its first `[` or + `.`, a superset that keeps `located` to the members something reads.""" + if isinstance(value, dict): + return set().union(*(_named(key) | _named(item) for key, item in value.items())) if value else set() + if isinstance(value, list): + return set().union(*(_named(item) for item in value)) if value else set() + return {re.split(r"[\[.]", value, maxsplit=1)[0]} if isinstance(value, str) else set() + + def with_found(resources: list[dict], namespace: str, types: list[str], members: dict[str, str]) -> list[dict]: """The resources, a `FOUND_BY` type the action acts on named by the members its service finds it by, when the request has them all, rather than by any it fills: its variables are an id the request does not give.""" @@ -1006,8 +1065,48 @@ def with_through(resources: list[dict], namespace: str, types: list[str], member return resources + through +def rest_operations(data: Path) -> dict[str, set[str]]: + """The operation names of each botocore model whose REST routes Floci reads under a namespace the file reads.""" + return {client: set(model["operations"]) + for client, model in load_models(data, {client for client, namespace in REST_MODELS.items() + if namespace in NAMESPACES}).items()} + + +def with_rest_operations(upstream: dict[str, dict], documents: list[dict], + given: dict[str, set[str]]) -> dict[str, dict]: + """`upstream` with the operations of the models Floci reads REST routes for (`regen_rest_routes.MODELS`), each + given as its operation names: an operation the reference lists gets the model among its clients, and one it lists + for none of them is checked as the action of its own name, or the one the reference maps it to, with that + action's resource types, when the reference has that action; one it does not have is left out, so `--verify` + reports a vendored one as no longer listed. The reference lists the operations of one client of a namespace: + OpenSearch Service's are the `es` client's alone, while the `opensearch` client's are named after `es` actions all + the same.""" + mapped = authorized_actions_from(documents) + actions = {document["Name"]: {action["Name"].lower(): action for action in document.get("Actions", [])} + for document in documents} + found = dict(upstream) + for client, names in sorted(given.items()): + namespace = REST_MODELS[client] + for name in sorted(names): + operation = f"{namespace}:{name}" + if operation in found: + if client not in found[operation]["clients"]: + found[operation] = {**found[operation], "clients": sorted(found[operation]["clients"] + [client])} + continue + action_name = mapped.get(namespace, {}).get(name, operation).split(":", 1)[1] + action = actions.get(namespace, {}).get(action_name.lower()) + if action is None: + continue + found[operation] = { + "action": f"{namespace}:{action['Name']}", + "types": [resource["Name"] for resource in action.get("Resources") or []], + "clients": [client], + } + return found + + def build(documents: list[dict], provenance: str, data: Path, botocore: str) -> dict: - upstream = checked_actions(documents) + upstream = with_rest_operations(checked_actions(documents), documents, rest_operations(data)) covered = {operation: value for operation, value in upstream.items() if reads(operation)} _check_overrides(covered) read_namespaces = set(NAMESPACES) | {namespace_of(operation) for operation in covered} @@ -1182,7 +1281,7 @@ def validate(document: dict) -> list[str]: if not OPERATION_RE.match(operation) or namespace not in namespaces: problems.append(f"{operation!r} is not an operation of a namespace the file reads") continue - if not isinstance(entry, dict) or not {"action", "types", "resources"} <= set(entry) <= {"action", "types", "resources", "creates"}: + if not isinstance(entry, dict) or not {"action", "types", "resources"} <= set(entry) <= {"action", "types", "resources", "creates", "located"}: problems.append(f"{operation} is not an action, its types and its resources") continue if not isinstance(entry["action"], str) or not OPERATION_RE.match(entry["action"]) \ @@ -1196,6 +1295,12 @@ def validate(document: dict) -> list[str]: problems += _resource_problems(operation, resource, set(types), formats.get(namespace, {})) for created in entry.get("creates", []) if isinstance(entry.get("creates", []), list) else [None]: problems += _created_problems(operation, created, set(types), formats.get(namespace, {})) + located = entry.get("located", {}) + if not isinstance(located, dict) or not located and "located" in entry or not all( + isinstance(member, str) and PATH_RE.match(member) and isinstance(where, str) and LOCATED_RE.match(where) + for member, where in located.items()): + problems.append(f"{operation} does not give each member it locates a label of its path or a parameter of " + f"its query") return problems @@ -1375,7 +1480,11 @@ def main(argv: list[str] | None = None) -> int: return 0 try: documents, provenance = fetch_references(args.source_dir) - upstream = checked_actions(documents) + listed = checked_actions(documents) + upstream = with_rest_operations(listed, documents, { + client: {operation.split(":", 1)[1] for operation in document["operations"] + if namespace_of(operation) == namespace and operation not in listed} + for client, namespace in REST_MODELS.items() if client in document["namespaces"].get(namespace, [])}) formats = arn_formats(documents, set(document["namespaces"])) except (OSError, ValueError) as e: print(f"error: could not read the Service Reference ({e})", file=sys.stderr) diff --git a/tools/aws/test_regen_iam_request_resources.py b/tools/aws/test_regen_iam_request_resources.py index 39036a6140..b2f116fcdb 100644 --- a/tools/aws/test_regen_iam_request_resources.py +++ b/tools/aws/test_regen_iam_request_resources.py @@ -761,3 +761,99 @@ def test_measured_callback_correction_retains_action_metadata_and_rejects_unlist assert r._resource_problems("states:SendTaskSuccess", {**resource, "find": ["otherToken"]}, [], formats) assert r._resource_problems("states:OtherOperation", resource, [], formats) assert r._resource_problems("states:SendTaskSuccess", resource, [], {}) + + +# --------------------------------------------------------------------------- # +# REST requests: members in the path and the query, and the REST models' operations +# --------------------------------------------------------------------------- # +def rest_model(operations: dict[str, dict[str, str]], located: dict[str, dict[str, str]]) -> dict: + """A rest-json model whose operations take the members given, `located` giving a member's `location` and + `locationName` as `uri:Name` or `querystring:name`.""" + built = model(operations, protocol="rest-json") + for operation, members in located.items(): + for member, where in members.items(): + location, name = where.split(":", 1) + built["shapes"][operation + "In"]["members"][member].update(location=location, locationName=name) + return built + + +def test_a_rest_request_reads_its_path_and_query_members_and_records_where_the_ones_it_reads_are(corrections, tmp_path): + svc = rest_model({"GetThing": {"ThingName": "String", "Marker": "String"}, "ListThings": {"Marker": "String"}}, + {"GetThing": {"ThingName": "uri:Name", "Marker": "querystring:marker"}, + "ListThings": {"Marker": "querystring:marker"}}) + write_models(tmp_path, {"svc": svc}) + document = r.build(DOCUMENTS, "test", tmp_path, "botocore test") + assert document["operations"]["svc:GetThing"] == { + "action": "svc:GetThing", "types": ["thing"], "resources": [{"type": "thing", "fill": {"ThingName": "ThingName"}}], + "located": {"ThingName": "{Name}"}} + assert "located" not in document["operations"]["svc:ListThings"] + assert r.validate(document) == [] + assert r.derive(document, tmp_path) == [] + + +def test_a_member_two_clients_locate_apart_is_an_error(): + one = rest_model({"GetThing": {"ThingName": "String"}}, {"GetThing": {"ThingName": "uri:ThingName"}}) + two = rest_model({"GetThing": {"ThingName": "String"}}, {"GetThing": {"ThingName": "querystring:thing"}}) + with pytest.raises(ValueError, match="GetThing's ThingName is"): + r.located_members({"one": one, "two": two}, "GetThing") + + +def test_a_located_member_must_be_a_path_label_or_a_query_parameter(corrections, tmp_path): + write_models(tmp_path, {"svc": rest_model({"GetThing": {"ThingName": "String"}, "ListThings": {}}, + {"GetThing": {"ThingName": "uri:ThingName"}})}) + document = r.build(DOCUMENTS, "test", tmp_path, "botocore test") + document["operations"]["svc:GetThing"]["located"] = {"ThingName": "header:x"} + assert any("does not give each member it locates" in problem for problem in r.validate(document)) + + +SPLIT = [reference("svc", {"GetThing": ["thing"], "ListThings": []}, {"thing": FORMATS["thing"]}), + reference("other", {"Op": ["x"]}, {"x": "arn:${Partition}:other:::x"}), + reference("later", {"Op": ["y"]}, {"y": "arn:${Partition}:later:::y"})] +# The reference lists svc's operations for its first client alone: DescribeThing is an action with no operation. +SPLIT[0]["Actions"].append({"Name": "DescribeThing", "Resources": [{"Name": "thing"}]}) + + +def test_a_rest_models_operations_the_reference_lists_for_no_client_take_their_own_actions(corrections): + corrections.setattr(r, "REST_MODELS", {"svc-v2": "svc"}) + found = r.with_rest_operations(r.checked_actions(SPLIT), SPLIT, {"svc-v2": {"GetThing", "DescribeThing", "Gone"}}) + assert found["svc:GetThing"]["clients"] == ["svc", "svc-v2"] + assert found["svc:DescribeThing"] == {"action": "svc:DescribeThing", "types": ["thing"], "clients": ["svc-v2"]} + # An operation whose action the reference does not have is left out, not given no types. + assert "svc:Gone" not in found + + +def test_a_namespace_reads_the_operations_of_the_rest_models_floci_routes_under_it(corrections, tmp_path): + corrections.setattr(r, "REST_MODELS", {"svc-v2": "svc"}) + write_models(tmp_path, {"svc": model({"GetThing": {"ThingName": "String"}, "ListThings": {}}), + "svc-v2": rest_model({"DescribeThing": {"ThingName": "String"}}, + {"DescribeThing": {"ThingName": "uri:ThingName"}})}) + sources = tmp_path / "reference" + sources.mkdir() + for document in SPLIT: + (sources / f"{document['Name']}.json").write_text(json.dumps(document), encoding="utf-8") + output = tmp_path / "table.json" + assert r.main(["--source-dir", str(sources), "--botocore-data", str(tmp_path), "--output", str(output)]) == 0 + document = json.loads(output.read_text()) + assert document["namespaces"]["svc"] == ["svc", "svc-v2"] + assert document["operations"]["svc:DescribeThing"] == { + "action": "svc:DescribeThing", "types": ["thing"], + "resources": [{"type": "thing", "fill": {"ThingName": "ThingName"}}], "located": {"ThingName": "{ThingName}"}} + assert r.main(["--check", "--botocore-data", str(tmp_path), "--output", str(output)]) == 0 + assert r.main(["--verify", "--source-dir", str(sources), "--output", str(output)]) == 0 + + +def test_verify_reports_a_rest_models_operation_whose_action_aws_no_longer_has(corrections, tmp_path): + corrections.setattr(r, "REST_MODELS", {"svc-v2": "svc"}) + write_models(tmp_path, {"svc": model({"GetThing": {"ThingName": "String"}, "ListThings": {}}), + "svc-v2": rest_model({"DescribeThing": {"ThingName": "String"}}, + {"DescribeThing": {"ThingName": "uri:ThingName"}})}) + sources = tmp_path / "reference" + sources.mkdir() + for document in SPLIT: + (sources / f"{document['Name']}.json").write_text(json.dumps(document), encoding="utf-8") + output = tmp_path / "table.json" + assert r.main(["--source-dir", str(sources), "--botocore-data", str(tmp_path), "--output", str(output)]) == 0 + gone = json.loads(json.dumps(SPLIT[0])) + gone["Actions"] = [action for action in gone["Actions"] if action["Name"] != "DescribeThing"] + (sources / "svc.json").write_text(json.dumps(gone), encoding="utf-8") + assert r.main(["--verify", "--source-dir", str(sources), "--output", str(output)]) == 1