Light, fluffy, and always free - The AWS Local Emulator alternative
fix(iam): check five more services on the resources their requests name (#6810)
Priamo Germosen096d336fab09
diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CodePipelineTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CodePipelineTest.javaindex 1bdbc02e92..e608f6212f 100644--- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CodePipelineTest.java+++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/CodePipelineTest.java@@ -85,7 +85,7 @@ class CodePipelineTest {PutWebhookResponse created = codepipeline.putWebhook(r -> r.webhook(definition));assertThat(created.webhook().definition()).isEqualTo(definition);- assertThat(created.webhook().arn()).endsWith(":webhook/sdk-webhook");+ assertThat(created.webhook().arn()).endsWith(":webhook:sdk-webhook");ListWebhooksResponse listed = codepipeline.listWebhooks();assertThat(listed.webhooks()).singleElement()diff --git a/docs/services/iam.md b/docs/services/iam.mdindex 500cf31461..e7926161e2 100644--- a/docs/services/iam.md+++ b/docs/services/iam.md@@ -1503,7 +1503,8 @@ action is denied. The routed protocol determines the status, not just the requesA request is checked against the resources it names. Floci builds their ARNs itself for S3, Lambda,SQS, SNS, DynamoDB, Kinesis, SSM, KMS, IAM, Resource Groups, EventBridge Scheduler, EventBridgePipes, Aurora DSQL, EKS, CloudWatch Logs, Secrets Manager and STS. For Elastic Load Balancing, ECR,-Step Functions, EventBridge and Amazon Cognito user pools they come from a table generated from AWS's Service+Step Functions, EventBridge, Amazon Cognito user pools and identity pools, Amazon Data Firehose, Cloud+Map, ACM and CodePipeline they come from a table generated from AWS's ServiceReference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives eachoperation's action, the resource types that action acts on with their ARN formats, and the requestmembers that name them: a member holding a resource's ARN, which counts when it matches the format@@ -1525,7 +1526,15 @@ selects the registry its handler acts in, so `repository/<name>` is checked in t`registryId` that is no account id names no repository, while a null one is the caller's, as ECRreads it. `StartExecution` and`StartSyncExecution` take Step Functions Local's `<stateMachineArn>#<test case>` and run the-machine before the `#`, so that machine is the one checked. An EventBridge rule is on the event bus+machine before the `#`, so that machine is the one checked. `StartPipelineExecution` and+`GetPipelineState` name their pipeline by a bare `name`, which is read as the pipeline's;+`CreatePipeline` and `UpdatePipeline` by `pipeline.name`, not by `pipeline.roleArn`, which holds the+role CodePipeline assumes; `PutWebhook` names the webhook by `webhook.name` and the pipeline it+connects to by `webhook.targetPipeline`. A CodePipeline webhook is `webhook:<name>`, the ARN AWS+gives it, and a custom action type `actiontype:Custom/<category>/<provider>/<version>`, its owner+being `Custom`, which the request does not give. Cloud Map's `CreateService` is checked on the+namespace its `NamespaceId` names or, when it gives none or a JSON null, the one its+`DnsConfig.NamespaceId` names, as Cloud Map reads them, and on the service it creates. An EventBridge rule is on the event busits request's `EventBusName` names, by name or by ARN, and on the default bus when it names noneor gives a null, whose rules are `rule/<name>`, with no bus; a bus ARN of another account, thedefault bus's included, names that account's rule, checked as given and as the caller's own, which@@ -1889,7 +1898,11 @@ resource, so its tags are checked on that one, built from the parent's ARN with`listener/app/<load balancer name>/<load balancer id>/*`, and `CreateRule`'s on the new`listener-rule/...` under its listener. So the AWS Load Balancer Controller's policy, which allows`AddTags` at creation only on target groups and application and network load balancers, and on-listeners and rules, holds. Where the tagging action takes+listeners and rules, holds. A create that names another resource beside the one it makes tags the+one it makes alone, the resource of the type it is named after: Cloud Map's `CreateService` is+checked on its namespace and on `service/*`, and its tags on `service/*`; CodePipeline's+`PutWebhook` on the webhook and the pipeline it connects to, and its tags on the webhook. Where the+tagging action takesits namespace's `CreateAction` key, as `ec2:CreateTags`, `ecs:TagResource`, CloudFormation's`TagResource` and Elastic Load Balancing's `AddTags` do, the key is the operation's name:`ec2:CreateAction` is `RunInstances` for an instance launched with tags. The operation's own actiondiff --git a/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.java b/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.javaindex c59edf717c..79a6dca2a8 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@@ -1020,8 +1020,8 @@ public class IamEnforcementFilter implements ContainerRequestFilter {/*** A request that tags what it creates also needs the service's tagging action (see {@link TagOnCreate}),* checked as the caller for each set of tags, under any spelling a handler might read: on the resource a- * tag specification names, else on the resource a create makes under a parent its action acts on, else on the- * resources the operation is checked on, with the set's tags as {@code aws:RequestTag/<key>} and+ * tag specification names, else on the resource a create makes, under a parent its action acts on or of the type+ * it is named after where it names others too, else on the resources the operation is checked on, with the set's tags as {@code aws:RequestTag/<key>} and* {@code aws:TagKeys}, the operation as the namespace's {@code CreateAction} key where the tagging action* takes one, and the keys that say who is calling. Returns true when the request was aborted.*/@@ -1030,7 +1030,7 @@ public class IamEnforcementFilter implements ContainerRequestFilter {String operation, TagOnCreate.Tagging tagging,String credentialScope, List<String> resources,String region, String accountId, String akid) {- // A create of a resource under a parent its action acts on tags the new one (see RequestResources).+ // A create tags the resource it makes, not the parent it makes it in (see RequestResources.created).List<String> created = RequestResources.created(operation, ctx, AwsRegions.partitionFor(region), region,accountId);List<String> made = created.isEmpty() ? resources : created;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.javaindex 0f03321381..86e1a6ae84 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@@ -34,8 +34,12 @@ final class RequestResourceMembers {private static final Pattern MEMBER = Pattern.compile("[A-Za-z][A-Za-z0-9_]*(\\[])?");/** A member holding an ARN may also be one level inside a structure or each of a list's structures. */private static final Pattern ARN_MEMBER = Pattern.compile("[A-Za-z][A-Za-z0-9_]*(\\[])?(\\.[A-Za-z][A-Za-z0-9_]*(\\[])?)?");- /** A member filling a variable may also be a field of each of a list's structures, one value for each. */- private static final Pattern FILL_MEMBER = Pattern.compile("[A-Za-z][A-Za-z0-9_]*(\\[]|\\[]\\.[A-Za-z][A-Za-z0-9_]*)?");+ /**+ * A member filling a variable may also be a field of a structure, or of each of a list's structures, one value+ * for each.+ */+ private static final Pattern FILL_MEMBER = Pattern.compile(+ "[A-Za-z][A-Za-z0-9_]*(\\[]|\\[]\\.[A-Za-z][A-Za-z0-9_]*|\\.[A-Za-z][A-Za-z0-9_]*)?");/** An ARN format's leading resource type word, and the rest of its resource. */private static final Pattern RESOURCE_PART = Pattern.compile("^arn:\\$\\{Partition}:[^:]*:[^:]*:[^:]*:([A-Za-z][A-Za-z0-9-]*)(.*)$");@@ -106,7 +110,7 @@ final class RequestResourceMembers {* A resource a request names: by a member holding its ARN, which names a resource of one of {@code types} when* it matches the type's format, or by members filling the variables of one type's format, the others open,* only {@code when} each member named has one of its values and {@code unless} it has one of those, an empty- * one for the member absent, in the account an {@code account} member gives (ECR's {@code registryId}), or else+ * one for the member absent or given a JSON null it is not read as a value for, in the account an {@code account} member gives (ECR's {@code registryId}), or else* the request's. A member {@code absent} from the request, or given a JSON null, is read as the value given for* it (an EventBridge request naming no event bus names {@code default}), and one in {@code arnOf} may give an* ARN of the type named for it instead of its name, read as that type's one variable, the resource then in the@@ -114,12 +118,15 @@ final class RequestResourceMembers {* a variable may be a field of each of a list's structures ({@code Entries[].EventBusName}), which names one* resource for each structure, read as {@code absent} gives for one that lacks it and in the account and Region* of the ARN that structure gives, if any. Such a member is in {@code absent} or {@code arnOf} only when it- * fills a variable. An ARN member's value is read up to the character {@code before}, when there is one, as its- * handler drops the rest.+ * fills a variable. A member filling a variable may also be a field of a structure ({@code pipeline.name}). A+ * variable no member gives may be {@code fixed} to the one value its handler uses (a CodePipeline custom action+ * type's owner, {@code Custom}). An ARN member's value is read up to the character {@code before}, when there+ * is one, as its handler drops the rest. A create naming other resources beside the one it makes marks that one+ * {@code made}, where its tags go (a webhook, not the pipeline it connects to).*/record Resource(List<String> types, Member arn, Map<String, Member> fill, Map<String, List<String>> when,Map<String, List<String>> unless, Map<String, String> absent, Map<String, String> arnOf,- Member account, String before) {+ Member account, String before, Map<String, String> fixed, boolean made) {}/**@@ -222,6 +229,11 @@ final class RequestResourceMembers {}private static Resource resource(String operation, JsonNode resource, Map<String, ArnFormat> formats) {+ if (resource.has("made") && !(resource.path("made").isBoolean() && resource.path("made").booleanValue())) {+ throw new IllegalStateException(RESOURCE_NAME + " marks a resource of " + operation + " made by "+ + resource.path("made") + ", which is not true");+ }+ boolean made = resource.has("made");if (resource.has("arn")) {List<String> types = resource.path("types").valueStream().map(JsonNode::asText).toList();if (types.isEmpty() || !formats.keySet().containsAll(types)) {@@ -234,7 +246,7 @@ final class RequestResourceMembers {+ " before " + before + ", no one character");}return new Resource(types, arnMember(operation, resource.path("arn").asText("")), Map.of(), Map.of(),- Map.of(), Map.of(), Map.of(), null, before);+ Map.of(), Map.of(), Map.of(), null, before, Map.of(), made);}String type = resource.path("type").asText("");ArnFormat format = formats.get(type);@@ -251,6 +263,15 @@ final class RequestResourceMembers {}fill.put(variable.getKey(), fillMember(operation, variable.getValue().asText("")));});+ Map<String, String> fixed = new LinkedHashMap<>();+ resource.path("fixed").properties().forEach(variable -> {+ if (!variables.contains(variable.getKey()) || fill.containsKey(variable.getKey())+ || !variable.getValue().isTextual() || variable.getValue().asText().isEmpty()) {+ throw new IllegalStateException(RESOURCE_NAME + " fixes " + variable.getKey() + " for " + operation+ + ", no variable of " + type + "'s format that no member fills, or to no value");+ }+ fixed.put(variable.getKey(), variable.getValue().asText());+ });if (fill.values().stream().filter(Member::list).count() > 1) {throw new IllegalStateException(RESOURCE_NAME + " fills " + type + " for " + operation+ " from more than one list");@@ -283,7 +304,7 @@ final class RequestResourceMembers {+ " from " + account.name() + ", no member of one account or a type of none");}return new Resource(List.of(type), null, Map.copyOf(fill), when, unless, Map.copyOf(absent), Map.copyOf(arnOf),- account, null);+ account, null, Map.copyOf(fixed), made);}/** The values each member named in {@code when} or {@code unless} may have, an empty one for the member absent. */@@ -324,8 +345,8 @@ final class RequestResourceMembers {}/**- * A member filling a variable: {@code Name}, {@code Name[]}, or a field of each of a list's structures,- * {@code Name[].Field}.+ * A member filling a variable: {@code Name}, {@code Name[]}, or a field of a structure, {@code Name.Field}, or of+ * each of a list's structures, {@code Name[].Field}.*/private static Member fillMember(String operation, String path) {if (!FILL_MEMBER.matcher(path).matches()) {@@ -335,12 +356,15 @@ final class RequestResourceMembers {}/**- * Whether a member gives one value as it is read: a top-level one that is no list, or a field of each of a- * list's structures that fills a variable, one value for each structure.+ * Whether a member gives one value as it is read: one that is no list, top-level or a field of a structure, or a+ * field of each of a list's structures that fills a variable, one value for each structure.*/private static boolean readAsOne(String operation, String path, Set<String> filled) {- return FILL_MEMBER.matcher(path).matches() && path.contains("[].") ? filled.contains(path)- : !member(operation, path).list();+ if (FILL_MEMBER.matcher(path).matches() && path.contains("[].")) {+ return filled.contains(path);+ }+ Member member = path.contains(".") ? fillMember(operation, path) : member(operation, path);+ return !member.list() && (member.field() == null || !member.field().list());}/** A member holding an ARN: {@code Name}, {@code Name[]}, or a field of it, {@code Name.Field} or {@code Name[].Field}. */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.javaindex a3cf056e26..dbfd367569 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@@ -73,7 +73,14 @@ public final class RequestResources {}Map<String, String> form = IamConditionContextResolver.formParameters(ctx);JsonNode body = form.isEmpty() ? PassedRoles.jsonBody(ctx) : null;- Map<String, RequestResourceMembers.ArnFormat> formats = formats(table, operation);+ return named(resources, formats(table, operation), form, body, partition, region, accountId, stored);+ }++ /** The ARNs of the resources the request names, as {@link #of} reads them. */+ private static List<String> named(List<RequestResourceMembers.Resource> resources,+ Map<String, RequestResourceMembers.ArnFormat> formats, Map<String, String> form,+ JsonNode body, String partition, String region, String accountId,+ StoredResourceArns stored) {Set<String> arns = new LinkedHashSet<>();for (RequestResourceMembers.Resource resource : resources) {if (!applies(resource, form, body, formats)) {@@ -95,20 +102,28 @@ public final class RequestResources {/*** The ARNs of the resources a create makes under a parent its action acts on, from the parent's ARN in the- * request, read as the operation's own resource reads that member, their ids open; empty when it makes none,- * so its tags go where the operation is checked. The operation is the one the request is dispatched as, as for- * {@link #of}.+ * request, read as the operation's own resource reads that member, their ids open; for a create making none+ * that way, the ones its request names that the table marks {@code made}, beside others it names (a webhook,+ * not the pipeline it connects to; Cloud Map's {@code service/*}, not the namespace it is created in); empty+ * when it makes neither, so its tags go where the operation is checked. The operation is the one the request+ * is dispatched as, as for {@link #of}.*/public static List<String> created(String operation, ContainerRequestContext ctx, String partition, String region,String accountId) {RequestResourceMembers.Table table = RequestResourceMembers.table();List<RequestResourceMembers.Created> creates = operation == null ? null : table.creates().get(operation);- if (creates == null) {+ List<RequestResourceMembers.Resource> made = operation == null || creates != null ? List.of()+ : table.operations().getOrDefault(operation, List.of()).stream()+ .filter(RequestResourceMembers.Resource::made).toList();+ if (creates == null && made.isEmpty()) {return List.of();}Map<String, String> form = IamConditionContextResolver.formParameters(ctx);JsonNode body = form.isEmpty() ? PassedRoles.jsonBody(ctx) : null;Map<String, RequestResourceMembers.ArnFormat> formats = formats(table, operation);+ if (creates == null) {+ return named(made, formats, form, body, partition, region, accountId, null);+ }Set<String> arns = new LinkedHashSet<>();for (RequestResourceMembers.Created created : creates) {String separator = table.operations().getOrDefault(operation, List.of()).stream()@@ -138,7 +153,8 @@ public final class RequestResources {/*** Whether each member the resource is named {@code when} has one of its values and no member it is named- * {@code unless} has one of those, an empty one for absent.+ * {@code unless} has one of those, an empty one for absent, or given a JSON null that the resource reads as no+ * value of its own, as a handler reading it with {@code asText(null)} does (Cloud Map's {@code NamespaceId}).*/private static boolean applies(RequestResourceMembers.Resource resource, Map<String, String> form, JsonNode body,Map<String, RequestResourceMembers.ArnFormat> formats) {@@ -157,7 +173,11 @@ public final class RequestResources {private static String first(RequestResourceMembers.Resource resource, Map<String, String> form, JsonNode body,String member, Map<String, RequestResourceMembers.ArnFormat> formats) {- List<String> given = given(resource, form, body, new RequestResourceMembers.Member(member, false), formats);+ RequestResourceMembers.Member read = new RequestResourceMembers.Member(member, false);+ if (!resource.absent().containsKey(member) && isNull(body, read)) {+ return "";+ }+ List<String> given = given(resource, form, body, read, formats);return given.isEmpty() ? "" : given.getFirst();}@@ -253,12 +273,14 @@ public final class RequestResources {account = given.isEmpty() ? accountId : given.getFirst();}AwsArnUtils.Arn fromRequest = arnGiven(resource, form, body, formats);- List<Filling> fillings = new ArrayList<>(List.of(new Filling(Map.of(), fromRequest)));+ List<Filling> fillings = new ArrayList<>(List.of(new Filling(resource.fixed(), fromRequest)));+ boolean given = false;for (Map.Entry<String, RequestResourceMembers.Member> variable : resource.fill().entrySet()) {List<String> values = read(resource, form, body, variable.getValue());if (values.isEmpty()) {continue;}+ given = true;RequestResourceMembers.ArnFormat named = arnOf(resource, variable.getValue().path(), formats);if (resource.fill().size() == 1 && fromRequest == null && values.stream().allMatch(value ->!isArnOf(named, value) && format.pattern().matcher(value).matches())) {@@ -275,7 +297,7 @@ public final class RequestResources {}fillings = next;}- if (!resource.fill().isEmpty() && fillings.getFirst().variables().isEmpty()) {+ if (!resource.fill().isEmpty() && !given) {return;}for (Filling filling : fillings) {diff --git a/src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java b/src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.javaindex d15c934f0d..8354f4f7e5 100644--- a/src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java+++ b/src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java@@ -1437,7 +1437,7 @@ public class CodePipelineService {ObjectNode item = mapper.createObjectNode();item.set("definition", webhook.deepCopy());item.put("url", "http://localhost:4566/codepipeline/webhooks/" + name);- item.put("arn", AwsArnUtils.Arn.of("codepipeline", region, account, "webhook/" + name).toString());+ item.put("arn", AwsArnUtils.Arn.of("codepipeline", region, account, "webhook:" + name).toString());if (request.path("tags").isArray() && !request.path("tags").isEmpty()) {item.set("tags", request.path("tags").deepCopy());}diff --git a/src/main/resources/aws/iam-request-resources.json b/src/main/resources/aws/iam-request-resources.jsonindex 89a42354b8..0103139fb0 100644--- a/src/main/resources/aws/iam-request-resources.json+++ b/src/main/resources/aws/iam-request-resources.json@@ -1,14 +1,121 @@{- "_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.113 (installed package)", "retrieved": "2026-10-27", "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": {"cognito-idp": ["cognito-idp"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "events": ["events"], "states": ["stepfunctions"]},+ "_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.113 (installed package)", "retrieved": "2026-10-28", "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"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "events": ["events"], "firehose": ["firehose"], "servicediscovery": ["servicediscovery"], "states": ["stepfunctions"]},"clientsNotRead": {"eventbridgev2": "EventBridge V2, the AWSEventsV2 target over Smithy RPC v2 CBOR on the eventsv2 endpoint, which Floci does not serve; its operations share EventBridge's names and name their resources by other members"},"handBuilt": ["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", "acm": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "airflow": "REST: its requests name their resources in the path, which RequestResources does not read yet", "apigateway": "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", "application-autoscaling": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "athena": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "autoscaling": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "bcm-data-exports": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bcm-pricing-calculator": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bedrock": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources does not read yet", "budgets": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ce": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudtrail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "codebuild": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codedeploy": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources does not read yet", "codepipeline": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cognito-identity": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "cur": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "datasync": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources does not read yet", "elasticmapreduce": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "firehose": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "fis": "REST: its requests name their resources in the path, which RequestResources does not read yet", "globalaccelerator": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "kinesisanalytics": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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-data": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "redshift-serverless": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rekognition": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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: a later batch, with the tests that show its ARNs are the ones its handlers mint", "servicediscovery": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "servicequotas": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "sso-oauth": "REST: its requests name their resources in the path, which RequestResources does not read yet", "swf": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "textract": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "timestream-influxdb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "translate": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "verifiedpermissions": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "apigateway": "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", "application-autoscaling": "not read yet: a scalable target's ARN ends in an id the service mints, `scalable-target/<id>`, while its requests name the target by ServiceNamespace, ResourceId and ScalableDimension, so its resource is the stored ARN those three find, which RequestResources has no lookup for yet; read as a member, ResourceId would fill that id", "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", "athena": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "autoscaling": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "bcm-data-exports": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bcm-pricing-calculator": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bedrock": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources does not read yet", "budgets": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ce": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudtrail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "codebuild": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codedeploy": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "cur": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "datasync": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources does not read yet", "elasticmapreduce": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "globalaccelerator": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "kinesisanalytics": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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-data": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "redshift-serverless": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rekognition": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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: a later batch, with the tests that show its ARNs are the ones its handlers mint", "servicequotas": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "sso-oauth": "REST: its requests name their resources in the path, which RequestResources does not read yet", "swf": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "textract": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "timestream-influxdb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "translate": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "verifiedpermissions": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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", "payment-cryptography", "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": {"cognito-idp": {"userpool": "arn:${Partition}:cognito-idp:${Region}:${Account}:userpool/${UserPoolId}", "webacl": "arn:${Partition}:wafv2:${Region}:${Account}:${Scope}/webacl/${Name}/${Id}"}, "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}"}, "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"}, "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}"}},+ "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}"}, "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}"}, "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}"}, "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}"}, "servicediscovery": {"namespace": "arn:${Partition}:servicediscovery:${Region}:${Account}:namespace/${NamespaceId}", "service": "arn:${Partition}:servicediscovery:${Region}:${Account}:service/${ServiceId}"}, "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}"}},"unqualified": {"states": ["statemachine"]},"mintedIds": {"events": ["api-destination", "connection"]},"operations": {+ "acm:AddTagsToCertificate": {"action": "acm:AddTagsToCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:CreateAcmeDomainValidation": {"action": "acm:CreateAcmeDomainValidation", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:CreateAcmeEndpoint": {"action": "acm:CreateAcmeEndpoint", "types": [], "resources": []},+ "acm:CreateAcmeExternalAccountBinding": {"action": "acm:CreateAcmeExternalAccountBinding", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}, {"types": ["acme-endpoint"], "arn": "RoleArn"}]},+ "acm:DeleteAcmeDomainValidation": {"action": "acm:DeleteAcmeDomainValidation", "types": ["acme-domain-validation"], "resources": [{"types": ["acme-domain-validation"], "arn": "AcmeDomainValidationArn"}]},+ "acm:DeleteAcmeEndpoint": {"action": "acm:DeleteAcmeEndpoint", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:DeleteAcmeExternalAccountBinding": {"action": "acm:DeleteAcmeExternalAccountBinding", "types": ["acme-external-account-binding"], "resources": [{"types": ["acme-external-account-binding"], "arn": "AcmeExternalAccountBindingArn"}]},+ "acm:DeleteCertificate": {"action": "acm:DeleteCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:DescribeAcmeAccount": {"action": "acm:DescribeAcmeAccount", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:DescribeAcmeDomainValidation": {"action": "acm:DescribeAcmeDomainValidation", "types": ["acme-domain-validation"], "resources": [{"types": ["acme-domain-validation"], "arn": "AcmeDomainValidationArn"}]},+ "acm:DescribeAcmeEndpoint": {"action": "acm:DescribeAcmeEndpoint", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:DescribeAcmeExternalAccountBinding": {"action": "acm:DescribeAcmeExternalAccountBinding", "types": ["acme-external-account-binding"], "resources": [{"types": ["acme-external-account-binding"], "arn": "AcmeExternalAccountBindingArn"}]},+ "acm:DescribeCertificate": {"action": "acm:DescribeCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:ExportCertificate": {"action": "acm:ExportCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:GetAccountConfiguration": {"action": "acm:GetAccountConfiguration", "types": [], "resources": []},+ "acm:GetAcmeExternalAccountBindingCredentials": {"action": "acm:GetAcmeExternalAccountBindingCredentials", "types": ["acme-external-account-binding"], "resources": [{"types": ["acme-external-account-binding"], "arn": "AcmeExternalAccountBindingArn"}]},+ "acm:GetCertificate": {"action": "acm:GetCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:ImportCertificate": {"action": "acm:ImportCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:ListAcmeAccounts": {"action": "acm:ListAcmeAccounts", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:ListAcmeDomainValidations": {"action": "acm:ListAcmeDomainValidations", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:ListAcmeEndpoints": {"action": "acm:ListAcmeEndpoints", "types": [], "resources": []},+ "acm:ListAcmeExternalAccountBindings": {"action": "acm:ListAcmeExternalAccountBindings", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:ListCertificateDomainValidations": {"action": "acm:ListCertificateDomainValidations", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:ListCertificates": {"action": "acm:ListCertificates", "types": [], "resources": []},+ "acm:ListTagsForCertificate": {"action": "acm:ListTagsForCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:ListTagsForResource": {"action": "acm:ListTagsForResource", "types": ["acme-domain-validation", "acme-endpoint", "acme-external-account-binding"], "resources": [{"types": ["acme-domain-validation", "acme-endpoint", "acme-external-account-binding"], "arn": "ResourceArn"}]},+ "acm:PutAccountConfiguration": {"action": "acm:PutAccountConfiguration", "types": [], "resources": []},+ "acm:RemoveTagsFromCertificate": {"action": "acm:RemoveTagsFromCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:RenewCertificate": {"action": "acm:RenewCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:RequestCertificate": {"action": "acm:RequestCertificate", "types": [], "resources": []},+ "acm:ResendValidationEmail": {"action": "acm:ResendValidationEmail", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:RevokeAcmeAccount": {"action": "acm:RevokeAcmeAccount", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:RevokeAcmeExternalAccountBinding": {"action": "acm:RevokeAcmeExternalAccountBinding", "types": ["acme-external-account-binding"], "resources": [{"types": ["acme-external-account-binding"], "arn": "AcmeExternalAccountBindingArn"}]},+ "acm:RevokeCertificate": {"action": "acm:RevokeCertificate", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "acm:SearchCertificates": {"action": "acm:SearchCertificates", "types": [], "resources": []},+ "acm:TagResource": {"action": "acm:TagResource", "types": ["acme-domain-validation", "acme-endpoint", "acme-external-account-binding"], "resources": [{"types": ["acme-domain-validation", "acme-endpoint", "acme-external-account-binding"], "arn": "ResourceArn"}]},+ "acm:UntagResource": {"action": "acm:UntagResource", "types": ["acme-domain-validation", "acme-endpoint", "acme-external-account-binding"], "resources": [{"types": ["acme-domain-validation", "acme-endpoint", "acme-external-account-binding"], "arn": "ResourceArn"}]},+ "acm:UpdateAcmeDomainValidation": {"action": "acm:UpdateAcmeDomainValidation", "types": ["acme-domain-validation"], "resources": [{"types": ["acme-domain-validation"], "arn": "AcmeDomainValidationArn"}]},+ "acm:UpdateAcmeEndpoint": {"action": "acm:UpdateAcmeEndpoint", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},+ "acm:UpdateCertificateOptions": {"action": "acm:UpdateCertificateOptions", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},+ "codepipeline:AcknowledgeJob": {"action": "codepipeline:AcknowledgeJob", "types": [], "resources": []},+ "codepipeline:AcknowledgeThirdPartyJob": {"action": "codepipeline:AcknowledgeThirdPartyJob", "types": [], "resources": []},+ "codepipeline:CreateCustomActionType": {"action": "codepipeline:CreateCustomActionType", "types": ["actiontype"], "resources": [{"type": "actiontype", "fill": {"Category": "category", "Provider": "provider", "Version": "version"}, "fixed": {"Owner": "Custom"}}]},+ "codepipeline:CreatePipeline": {"action": "codepipeline:CreatePipeline", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "pipeline.name"}}]},+ "codepipeline:DeleteCustomActionType": {"action": "codepipeline:DeleteCustomActionType", "types": ["actiontype"], "resources": [{"type": "actiontype", "fill": {"Category": "category", "Provider": "provider", "Version": "version"}, "fixed": {"Owner": "Custom"}}]},+ "codepipeline:DeletePipeline": {"action": "codepipeline:DeletePipeline", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "name"}}]},+ "codepipeline:DeleteWebhook": {"action": "codepipeline:DeleteWebhook", "types": ["webhook"], "resources": [{"type": "webhook", "fill": {"WebhookName": "name"}}]},+ "codepipeline:DeregisterWebhookWithThirdParty": {"action": "codepipeline:DeregisterWebhookWithThirdParty", "types": ["webhook"], "resources": [{"type": "webhook", "fill": {"WebhookName": "webhookName"}}]},+ "codepipeline:DisableStageTransition": {"action": "codepipeline:DisableStageTransition", "types": ["stage"], "resources": [{"type": "stage", "fill": {"PipelineName": "pipelineName", "StageName": "stageName"}}]},+ "codepipeline:EnableStageTransition": {"action": "codepipeline:EnableStageTransition", "types": ["stage"], "resources": [{"type": "stage", "fill": {"PipelineName": "pipelineName", "StageName": "stageName"}}]},+ "codepipeline:GetActionType": {"action": "codepipeline:GetActionType", "types": [], "resources": []},+ "codepipeline:GetJobDetails": {"action": "codepipeline:GetJobDetails", "types": [], "resources": []},+ "codepipeline:GetPipeline": {"action": "codepipeline:GetPipeline", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "name"}}]},+ "codepipeline:GetPipelineExecution": {"action": "codepipeline:GetPipelineExecution", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "pipelineName"}}]},+ "codepipeline:GetPipelineState": {"action": "codepipeline:GetPipelineState", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "name"}}]},+ "codepipeline:GetThirdPartyJobDetails": {"action": "codepipeline:GetThirdPartyJobDetails", "types": [], "resources": []},+ "codepipeline:ListActionExecutions": {"action": "codepipeline:ListActionExecutions", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "pipelineName"}}]},+ "codepipeline:ListActionTypes": {"action": "codepipeline:ListActionTypes", "types": [], "resources": []},+ "codepipeline:ListDeployActionExecutionTargets": {"action": "codepipeline:ListDeployActionExecutionTargets", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "pipelineName"}}]},+ "codepipeline:ListPipelineExecutions": {"action": "codepipeline:ListPipelineExecutions", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "pipelineName"}}]},+ "codepipeline:ListPipelines": {"action": "codepipeline:ListPipelines", "types": [], "resources": []},+ "codepipeline:ListRuleExecutions": {"action": "codepipeline:ListRuleExecutions", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "pipelineName"}}]},+ "codepipeline:ListRuleTypes": {"action": "codepipeline:ListRuleTypes", "types": [], "resources": []},+ "codepipeline:ListTagsForResource": {"action": "codepipeline:ListTagsForResource", "types": ["actiontype", "pipeline", "webhook"], "resources": [{"types": ["actiontype", "pipeline", "webhook"], "arn": "resourceArn"}]},+ "codepipeline:ListWebhooks": {"action": "codepipeline:ListWebhooks", "types": ["webhook"], "resources": []},+ "codepipeline:OverrideStageCondition": {"action": "codepipeline:OverrideStageCondition", "types": ["stage"], "resources": [{"type": "stage", "fill": {"PipelineName": "pipelineName", "StageName": "stageName"}}]},+ "codepipeline:PollForJobs": {"action": "codepipeline:PollForJobs", "types": ["actiontype"], "resources": []},+ "codepipeline:PollForThirdPartyJobs": {"action": "codepipeline:PollForThirdPartyJobs", "types": [], "resources": []},+ "codepipeline:PutActionRevision": {"action": "codepipeline:PutActionRevision", "types": ["action"], "resources": [{"type": "action", "fill": {"ActionName": "actionName", "PipelineName": "pipelineName", "StageName": "stageName"}}]},+ "codepipeline:PutApprovalResult": {"action": "codepipeline:PutApprovalResult", "types": ["action"], "resources": [{"type": "action", "fill": {"ActionName": "actionName", "PipelineName": "pipelineName", "StageName": "stageName"}}]},+ "codepipeline:PutJobFailureResult": {"action": "codepipeline:PutJobFailureResult", "types": [], "resources": []},+ "codepipeline:PutJobSuccessResult": {"action": "codepipeline:PutJobSuccessResult", "types": [], "resources": []},+ "codepipeline:PutThirdPartyJobFailureResult": {"action": "codepipeline:PutThirdPartyJobFailureResult", "types": [], "resources": []},+ "codepipeline:PutThirdPartyJobSuccessResult": {"action": "codepipeline:PutThirdPartyJobSuccessResult", "types": [], "resources": []},+ "codepipeline:PutWebhook": {"action": "codepipeline:PutWebhook", "types": ["pipeline", "webhook"], "resources": [{"type": "webhook", "fill": {"WebhookName": "webhook.name"}, "made": true}, {"type": "pipeline", "fill": {"PipelineName": "webhook.targetPipeline"}}]},+ "codepipeline:RegisterWebhookWithThirdParty": {"action": "codepipeline:RegisterWebhookWithThirdParty", "types": ["webhook"], "resources": [{"type": "webhook", "fill": {"WebhookName": "webhookName"}}]},+ "codepipeline:RetryStageExecution": {"action": "codepipeline:RetryStageExecution", "types": ["stage"], "resources": [{"type": "stage", "fill": {"PipelineName": "pipelineName", "StageName": "stageName"}}]},+ "codepipeline:RollbackStage": {"action": "codepipeline:RollbackStage", "types": ["stage"], "resources": [{"type": "stage", "fill": {"PipelineName": "pipelineName", "StageName": "stageName"}}]},+ "codepipeline:StartPipelineExecution": {"action": "codepipeline:StartPipelineExecution", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "name"}}]},+ "codepipeline:StopPipelineExecution": {"action": "codepipeline:StopPipelineExecution", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "pipelineName"}}]},+ "codepipeline:TagResource": {"action": "codepipeline:TagResource", "types": ["actiontype", "pipeline", "webhook"], "resources": [{"types": ["actiontype", "pipeline", "webhook"], "arn": "resourceArn"}]},+ "codepipeline:UntagResource": {"action": "codepipeline:UntagResource", "types": ["actiontype", "pipeline", "webhook"], "resources": [{"types": ["actiontype", "pipeline", "webhook"], "arn": "resourceArn"}]},+ "codepipeline:UpdateActionType": {"action": "codepipeline:UpdateActionType", "types": ["actiontype"], "resources": []},+ "codepipeline:UpdatePipeline": {"action": "codepipeline:UpdatePipeline", "types": ["pipeline"], "resources": [{"type": "pipeline", "fill": {"PipelineName": "pipeline.name"}}]},+ "cognito-identity:CreateIdentityPool": {"action": "cognito-identity:CreateIdentityPool", "types": [], "resources": []},+ "cognito-identity:DeleteIdentities": {"action": "cognito-identity:DeleteIdentities", "types": [], "resources": []},+ "cognito-identity:DeleteIdentityPool": {"action": "cognito-identity:DeleteIdentityPool", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:DescribeIdentity": {"action": "cognito-identity:DescribeIdentity", "types": [], "resources": []},+ "cognito-identity:DescribeIdentityPool": {"action": "cognito-identity:DescribeIdentityPool", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:GetCredentialsForIdentity": {"action": "cognito-identity:GetCredentialsForIdentity", "types": [], "resources": []},+ "cognito-identity:GetId": {"action": "cognito-identity:GetId", "types": [], "resources": []},+ "cognito-identity:GetIdentityPoolRoles": {"action": "cognito-identity:GetIdentityPoolRoles", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:GetOpenIdToken": {"action": "cognito-identity:GetOpenIdToken", "types": [], "resources": []},+ "cognito-identity:GetOpenIdTokenForDeveloperIdentity": {"action": "cognito-identity:GetOpenIdTokenForDeveloperIdentity", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:GetPrincipalTagAttributeMap": {"action": "cognito-identity:GetPrincipalTagAttributeMap", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:ListIdentities": {"action": "cognito-identity:ListIdentities", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:ListIdentityPools": {"action": "cognito-identity:ListIdentityPools", "types": [], "resources": []},+ "cognito-identity:ListTagsForResource": {"action": "cognito-identity:ListTagsForResource", "types": ["identitypool"], "resources": [{"types": ["identitypool"], "arn": "ResourceArn"}]},+ "cognito-identity:LookupDeveloperIdentity": {"action": "cognito-identity:LookupDeveloperIdentity", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:MergeDeveloperIdentities": {"action": "cognito-identity:MergeDeveloperIdentities", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:SetIdentityPoolRoles": {"action": "cognito-identity:SetIdentityPoolRoles", "types": [], "resources": []},+ "cognito-identity:SetPrincipalTagAttributeMap": {"action": "cognito-identity:SetPrincipalTagAttributeMap", "types": [], "resources": []},+ "cognito-identity:TagResource": {"action": "cognito-identity:TagResource", "types": ["identitypool"], "resources": [{"types": ["identitypool"], "arn": "ResourceArn"}]},+ "cognito-identity:UnlinkDeveloperIdentity": {"action": "cognito-identity:UnlinkDeveloperIdentity", "types": ["identitypool"], "resources": [{"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},+ "cognito-identity:UnlinkIdentity": {"action": "cognito-identity:UnlinkIdentity", "types": [], "resources": []},+ "cognito-identity:UntagResource": {"action": "cognito-identity:UntagResource", "types": ["identitypool"], "resources": [{"types": ["identitypool"], "arn": "ResourceArn"}]},+ "cognito-identity:UpdateIdentityPool": {"action": "cognito-identity:UpdateIdentityPool", "types": ["identitypool"], "resources": [{"types": ["identitypool"], "arn": "OpenIdConnectProviderARNs[]"}, {"types": ["identitypool"], "arn": "SamlProviderARNs[]"}, {"type": "identitypool", "fill": {"IdentityPoolId": "IdentityPoolId"}}]},"cognito-idp:AddCustomAttributes": {"action": "cognito-idp:AddCustomAttributes", "types": ["userpool"], "resources": [{"type": "userpool", "fill": {"UserPoolId": "UserPoolId"}}]},"cognito-idp:AddUserPoolClientSecret": {"action": "cognito-idp:AddUserPoolClientSecret", "types": ["userpool"], "resources": [{"type": "userpool", "fill": {"UserPoolId": "UserPoolId"}}]},"cognito-idp:AdminAddUserToGroup": {"action": "cognito-idp:AdminAddUserToGroup", "types": ["userpool"], "resources": [{"type": "userpool", "fill": {"UserPoolId": "UserPoolId"}}]},@@ -345,6 +452,48 @@"events:UpdateEventBus": {"action": "events:UpdateEventBus", "types": ["event-bus", "event-busv2"], "resources": [{"types": ["event-bus", "event-busv2"], "arn": "DeadLetterConfig.Arn"}, {"type": "event-bus", "fill": {"EventBusName": "Name"}}]},"events:UpdateEventSource": {"action": "events:UpdateEventSource", "types": ["event-busv2", "event-sourcev2"], "resources": []},"events:UpdateSubscriber": {"action": "events:UpdateSubscriber", "types": ["event-busv2", "subscriber"], "resources": []},+ "firehose:CreateDeliveryStream": {"action": "firehose:CreateDeliveryStream", "types": ["deliverystream"], "resources": [{"types": ["deliverystream"], "arn": "AmazonOpenSearchServerlessDestinationConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "AmazonopensearchserviceDestinationConfiguration.DomainARN"}, {"types": ["deliverystream"], "arn": "AmazonopensearchserviceDestinationConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "DeliveryStreamEncryptionConfigurationInput.KeyARN"}, {"types": ["deliverystream"], "arn": "ElasticsearchDestinationConfiguration.DomainARN"}, {"types": ["deliverystream"], "arn": "ElasticsearchDestinationConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "ExtendedS3DestinationConfiguration.BucketARN"}, {"types": ["deliverystream"], "arn": "ExtendedS3DestinationConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "HttpEndpointDestinationConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "IcebergDestinationConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "KinesisStreamSourceConfiguration.KinesisStreamARN"}, {"types": ["deliverystream"], "arn": "KinesisStreamSourceConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "MSKSourceConfiguration.MSKClusterARN"}, {"types": ["deliverystream"], "arn": "RedshiftDestinationConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "S3DestinationConfiguration.BucketARN"}, {"types": ["deliverystream"], "arn": "S3DestinationConfiguration.RoleARN"}, {"types": ["deliverystream"], "arn": "SnowflakeDestinationConfiguration.RoleARN"}, {"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:DeleteDeliveryStream": {"action": "firehose:DeleteDeliveryStream", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:DescribeDeliveryStream": {"action": "firehose:DescribeDeliveryStream", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:ListDeliveryStreams": {"action": "firehose:ListDeliveryStreams", "types": [], "resources": []},+ "firehose:ListTagsForDeliveryStream": {"action": "firehose:ListTagsForDeliveryStream", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:PutRecord": {"action": "firehose:PutRecord", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:PutRecordBatch": {"action": "firehose:PutRecordBatch", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:StartDeliveryStreamEncryption": {"action": "firehose:StartDeliveryStreamEncryption", "types": ["deliverystream"], "resources": [{"types": ["deliverystream"], "arn": "DeliveryStreamEncryptionConfigurationInput.KeyARN"}, {"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:StopDeliveryStreamEncryption": {"action": "firehose:StopDeliveryStreamEncryption", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:TagDeliveryStream": {"action": "firehose:TagDeliveryStream", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:UntagDeliveryStream": {"action": "firehose:UntagDeliveryStream", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "firehose:UpdateDestination": {"action": "firehose:UpdateDestination", "types": ["deliverystream"], "resources": [{"types": ["deliverystream"], "arn": "AmazonOpenSearchServerlessDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "AmazonopensearchserviceDestinationUpdate.DomainARN"}, {"types": ["deliverystream"], "arn": "AmazonopensearchserviceDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "ElasticsearchDestinationUpdate.DomainARN"}, {"types": ["deliverystream"], "arn": "ElasticsearchDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "ExtendedS3DestinationUpdate.BucketARN"}, {"types": ["deliverystream"], "arn": "ExtendedS3DestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "HttpEndpointDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "IcebergDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "RedshiftDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "S3DestinationUpdate.BucketARN"}, {"types": ["deliverystream"], "arn": "S3DestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "SnowflakeDestinationUpdate.RoleARN"}, {"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},+ "servicediscovery:CreateHttpNamespace": {"action": "servicediscovery:CreateHttpNamespace", "types": [], "resources": []},+ "servicediscovery:CreatePrivateDnsNamespace": {"action": "servicediscovery:CreatePrivateDnsNamespace", "types": [], "resources": []},+ "servicediscovery:CreatePublicDnsNamespace": {"action": "servicediscovery:CreatePublicDnsNamespace", "types": [], "resources": []},+ "servicediscovery:CreateService": {"action": "servicediscovery:CreateService", "types": ["namespace", "service"], "resources": [{"type": "namespace", "fill": {"NamespaceId": "NamespaceId"}, "unless": {"NamespaceId": [null]}}, {"type": "namespace", "fill": {"NamespaceId": "DnsConfig.NamespaceId"}, "when": {"NamespaceId": [null]}}, {"type": "service", "fill": {}, "made": true}]},+ "servicediscovery:DeleteNamespace": {"action": "servicediscovery:DeleteNamespace", "types": ["namespace"], "resources": [{"type": "namespace", "fill": {"NamespaceId": "Id"}}]},+ "servicediscovery:DeleteService": {"action": "servicediscovery:DeleteService", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "Id"}}]},+ "servicediscovery:DeleteServiceAttributes": {"action": "servicediscovery:DeleteServiceAttributes", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},+ "servicediscovery:DeregisterInstance": {"action": "servicediscovery:DeregisterInstance", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},+ "servicediscovery:DiscoverInstances": {"action": "servicediscovery:DiscoverInstances", "types": ["namespace", "service"], "resources": []},+ "servicediscovery:DiscoverInstancesRevision": {"action": "servicediscovery:DiscoverInstancesRevision", "types": ["namespace", "service"], "resources": []},+ "servicediscovery:GetInstance": {"action": "servicediscovery:GetInstance", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},+ "servicediscovery:GetInstancesHealthStatus": {"action": "servicediscovery:GetInstancesHealthStatus", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},+ "servicediscovery:GetNamespace": {"action": "servicediscovery:GetNamespace", "types": ["namespace"], "resources": [{"type": "namespace", "fill": {"NamespaceId": "Id"}}]},+ "servicediscovery:GetOperation": {"action": "servicediscovery:GetOperation", "types": ["namespace", "service"], "resources": []},+ "servicediscovery:GetService": {"action": "servicediscovery:GetService", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "Id"}}]},+ "servicediscovery:GetServiceAttributes": {"action": "servicediscovery:GetServiceAttributes", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},+ "servicediscovery:ListInstances": {"action": "servicediscovery:ListInstances", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},+ "servicediscovery:ListNamespaces": {"action": "servicediscovery:ListNamespaces", "types": [], "resources": []},+ "servicediscovery:ListOperations": {"action": "servicediscovery:ListOperations", "types": [], "resources": []},+ "servicediscovery:ListServices": {"action": "servicediscovery:ListServices", "types": [], "resources": []},+ "servicediscovery:ListTagsForResource": {"action": "servicediscovery:ListTagsForResource", "types": [], "resources": []},+ "servicediscovery:RegisterInstance": {"action": "servicediscovery:RegisterInstance", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},+ "servicediscovery:TagResource": {"action": "servicediscovery:TagResource", "types": [], "resources": []},+ "servicediscovery:UntagResource": {"action": "servicediscovery:UntagResource", "types": [], "resources": []},+ "servicediscovery:UpdateHttpNamespace": {"action": "servicediscovery:UpdateHttpNamespace", "types": ["namespace"], "resources": [{"type": "namespace", "fill": {"NamespaceId": "Id"}}]},+ "servicediscovery:UpdateInstanceCustomHealthStatus": {"action": "servicediscovery:UpdateInstanceCustomHealthStatus", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},+ "servicediscovery:UpdatePrivateDnsNamespace": {"action": "servicediscovery:UpdatePrivateDnsNamespace", "types": ["namespace"], "resources": [{"type": "namespace", "fill": {"NamespaceId": "Id"}}]},+ "servicediscovery:UpdatePublicDnsNamespace": {"action": "servicediscovery:UpdatePublicDnsNamespace", "types": ["namespace"], "resources": [{"type": "namespace", "fill": {"NamespaceId": "Id"}}]},+ "servicediscovery:UpdateService": {"action": "servicediscovery:UpdateService", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "Id"}}]},+ "servicediscovery:UpdateServiceAttributes": {"action": "servicediscovery:UpdateServiceAttributes", "types": ["service"], "resources": [{"type": "service", "fill": {"ServiceId": "ServiceId"}}]},"states:CreateActivity": {"action": "states:CreateActivity", "types": ["activity"], "resources": [{"type": "activity", "fill": {"ActivityName": "name"}}]},"states:CreateStateMachine": {"action": "states:CreateStateMachine", "types": ["statemachine"], "resources": [{"types": ["statemachine"], "arn": "roleArn"}, {"type": "statemachine", "fill": {"StateMachineName": "name"}}]},"states:CreateStateMachineAlias": {"action": "states:CreateStateMachineAlias", "types": ["statemachine"], "resources": [{"types": ["statemachine"], "arn": "routingConfiguration[].stateMachineVersionArn"}]},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.javaindex 159a462951..67cdc02067 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@@ -100,9 +100,9 @@ class RequestResourceMembersTest {+ "{\"resources\":[],\"creates\":[{\"type\":\"part\",\"parent\":\"thing\",\"arn\":\"ThingArn\"}]}}}"),part);}- // A member past one structure, or filling a variable from a lone structure's member or a list in a list.+ // A member past one structure, or filling a variable from a list in a list.assertThrows(IllegalStateException.class, () -> parse(document(formats, "{\"types\":[\"thing\"],\"arn\":\"A[].B.ThingArn\"}")));- for (String bad : List.of("A.Name", "A[].Names[]", "A[].B.Name")) {+ for (String bad : List.of("A.Names[]", "A[].Names[]", "A[].B.Name")) {assertThrows(IllegalStateException.class, () -> parse(document(formats,"{\"type\":\"thing\",\"fill\":{\"ThingName\":\"" + bad + "\"}}")), bad);}@@ -110,7 +110,7 @@ class RequestResourceMembersTest {// only a member filling a variable is.Member each = new Member("A", true, new Member("Name", false));assertEquals(List.of(new Resource(List.of("thing"), null, Map.of("ThingName", each), Map.of(), Map.of(),- Map.of("A[].Name", "default"), Map.of("A[].Name", "thing"), null, null)),+ Map.of("A[].Name", "default"), Map.of("A[].Name", "thing"), null, null, Map.of(), false)),parseUnchecked(document(formats, "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"A[].Name\"},"+ "\"absent\":{\"A[].Name\":\"default\"},\"arnOf\":{\"A[].Name\":\"thing\"}}")).operations().get("a:Op"));@@ -119,8 +119,36 @@ class RequestResourceMembersTest {assertThrows(IllegalStateException.class, () -> parse(document(formats,"{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Name\"}," + bad + "}")), bad);}+ // A field of a structure fills a variable, as one value.+ Member field = new Member("A", false, new Member("Name", false));+ assertEquals(List.of(new Resource(List.of("thing"), null, Map.of("ThingName", field), Map.of(), Map.of(),+ Map.of("A.Name", "default"), Map.of(), null, null, Map.of(), false)),+ parseUnchecked(document(formats, "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"A.Name\"},"+ + "\"absent\":{\"A.Name\":\"default\"}}")).operations().get("a:Op"));+ assertEquals("A.Name", field.path());+ // A variable fixed to the one value its handler uses, and one fixed that is no variable, that a member fills,+ // or to no value.+ String owned = "\"arnFormats\":{\"a\":{\"thing\":\"arn:${Partition}:a:${Region}:${Account}:thing/${Owner}/${ThingName}\"}}";+ assertEquals(List.of(new Resource(List.of("thing"), null, Map.of("ThingName", new Member("Name", false)), Map.of(),+ Map.of(), Map.of(), Map.of(), null, null, Map.of("Owner", "Custom"), false)),+ parseUnchecked(document(owned, "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Name\"},"+ + "\"fixed\":{\"Owner\":\"Custom\"}}")).operations().get("a:Op"));+ for (String bad : List.of("{\"Other\":\"Custom\"}", "{\"ThingName\":\"Custom\"}", "{\"Owner\":\"\"}",+ "{\"Owner\":1}")) {+ assertThrows(IllegalStateException.class, () -> parse(document(owned,+ "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Name\"},\"fixed\":" + bad + "}")), bad);+ }+ // The resource a create makes, beside others it names, marked made, and a mark that is not true.+ assertTrue(parseUnchecked(document(formats, "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Name\"},"+ + "\"made\":true}")).operations().get("a:Op").getFirst().made());+ assertTrue(parseUnchecked(document(formats, "{\"types\":[\"thing\"],\"arn\":\"ThingArn\",\"made\":true}"))+ .operations().get("a:Op").getFirst().made());+ for (String bad : List.of("false", "\"true\"", "1")) {+ assertThrows(IllegalStateException.class, () -> parse(document(formats,+ "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Name\"},\"made\":" + bad + "}")), bad);+ }assertEquals(List.of(new Resource(List.of("thing"), new Member("A", true, new Member("ThingArns", true)), Map.of(),- Map.of(), Map.of(), Map.of(), Map.of(), null, null)), parseUnchecked(document(formats, "{\"types\":[\"thing\"],\"arn\":\"A[].ThingArns[]\"}"))+ Map.of(), Map.of(), Map.of(), Map.of(), null, null, Map.of(), false)), parseUnchecked(document(formats, "{\"types\":[\"thing\"],\"arn\":\"A[].ThingArns[]\"}")).operations().get("a:Op"));// An ARN read before more than one character.assertThrows(IllegalStateException.class, () -> parse(document(formats,@@ -154,19 +182,21 @@ class RequestResourceMembersTest {"{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Name\"}," + bad + "}")), bad);}assertEquals(List.of(new Resource(List.of("thing"), null, Map.of("ThingName", new Member("Name", false)),- Map.of(), Map.of("Bus", List.of("default")), Map.of("Bus", "default"), Map.of("Bus", "thing"), null, null)),+ Map.of(), Map.of("Bus", List.of("default")), Map.of("Bus", "default"), Map.of("Bus", "thing"), null, null,+ Map.of(), false)),parseUnchecked(document(formats, "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Name\"},"+ "\"unless\":{\"Bus\":[\"default\"]},\"absent\":{\"Bus\":\"default\"},"+ "\"arnOf\":{\"Bus\":\"thing\"}}")).operations().get("a:Op"));assertEquals(List.of(new Resource(List.of("thing"), null, Map.of("ThingName", new Member("Names", true)), Map.of(),- Map.of(), Map.of(), Map.of(), new Member("registryId", false), null)),+ Map.of(), Map.of(), Map.of(), new Member("registryId", false), null, Map.of(), false)),parseUnchecked(document(formats, "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Names[]\"},"+ "\"account\":\"registryId\"}")).operations().get("a:Op"));}/*** Each resource alone, from a request naming it and nothing else, gives exactly its ARN, in the account its- * account member names when it has one.+ * account member names when it has one, with those of the operation's resources every request names, a create's+ * new resource no member names (Cloud Map's {@code CreateService}).*/@TestFactoryStream<DynamicTest> everyResourceOfTheTableIsReadFromAJsonBodyAndAForm() {@@ -197,9 +227,15 @@ class RequestResourceMembersTest {put(body, member, value);form.append('&').append(parameter(member)).append('=').append(encoded(value));});- assertEquals(List.of(expected), RequestResources.of(operation.getKey(), json(body.toString()),+ List<String> named = operation.getValue().stream()+ .filter(other -> other == resource || named(other))+ .map(other -> other == resource ? expected : expected(+ table.formats().get(namespace).get(other.types().getFirst()).format(), other,+ "000000000000"))+ .distinct().toList();+ assertEquals(named, RequestResources.of(operation.getKey(), json(body.toString()),"aws", "us-east-1", "000000000000"), body.toString());- assertEquals(List.of(expected), RequestResources.of(operation.getKey(), form(form.toString()),+ assertEquals(named, RequestResources.of(operation.getKey(), form(form.toString()),"aws", "us-east-1", "000000000000"), form.toString());})));}@@ -230,6 +266,12 @@ class RequestResourceMembersTest {})));}+ /** Whether every request of its operation names the resource: no member names it and no member's value selects it. */+ private static boolean named(Resource resource) {+ return resource.arn() == null && resource.fill().isEmpty() && resource.when().isEmpty()+ && resource.unless().isEmpty();+ }+/** The value at the member's path in a body: in its list's first element, and in its field's structure. */private static void put(ObjectNode body, Member member, String value) {if (member.field() == null) {@@ -262,6 +304,9 @@ class RequestResourceMembersTest {for (String variable : resource.fill().keySet()) {arn = arn.replace("${" + variable + "}", "x");}+ for (Map.Entry<String, String> variable : resource.fixed().entrySet()) {+ arn = arn.replace("${" + variable.getKey() + "}", variable.getValue());+ }return arn.replaceAll("\\$\\{\\w+}", "*");}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.javaindex b6199ee8da..597207b26d 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@@ -364,6 +364,60 @@ class RequestResourcesTest {"{\"repositoryNames\":[\"${Account}\"]}")));}+ /**+ * A pipeline is the one its request's {@code pipeline.name} names; its {@code roleArn}, the role CodePipeline+ * assumes, names none, even when it holds a pipeline's ARN. A webhook is the one {@code webhook.name} names, on+ * the pipeline {@code webhook.targetPipeline} names, and its tags go on the webhook alone.+ */+ @Test+ void aPipelineIsTheOneItsStructuresNameNames() {+ String codePipeline = "arn:aws:codepipeline:us-east-1:000000000000:";+ assertEquals(List.of(codePipeline + "b"), of("codepipeline:UpdatePipeline",+ json("{\"pipeline\":{\"name\":\"b\",\"roleArn\":\"" + codePipeline + "a\"}}")));+ assertEquals(List.of(codePipeline + "b"), of("codepipeline:CreatePipeline", form("Action=CreatePipeline"+ + "&pipeline.name=b&pipeline.roleArn=" + codePipeline + "a")));+ assertEquals(List.of(), of("codepipeline:UpdatePipeline", json("{\"pipeline\":{\"roleArn\":\"" + codePipeline+ + "a\"}}")));+ assertEquals(List.of(codePipeline + "webhook:w", codePipeline + "p"), of("codepipeline:PutWebhook",+ json("{\"webhook\":{\"name\":\"w\",\"targetPipeline\":\"p\"}}")));+ // A webhook's tags go on the webhook, not on the pipeline it connects to.+ assertEquals(List.of(codePipeline + "webhook:w"), created("codepipeline:PutWebhook",+ json("{\"webhook\":{\"name\":\"w\",\"targetPipeline\":\"p\"}}")));+ }++ /** A custom action type is {@code Custom}'s, the owner CodePipeline gives every one, which its request does not. */+ @Test+ void aCustomActionTypeIsCustoms() {+ assertEquals(List.of("arn:aws:codepipeline:us-east-1:000000000000:actiontype:Custom/Build/MyProvider/1"),+ of("codepipeline:CreateCustomActionType",+ json("{\"category\":\"Build\",\"provider\":\"MyProvider\",\"version\":\"1\"}")));+ assertEquals(List.of("arn:aws:codepipeline:us-east-1:000000000000:actiontype:Custom/Build/MyProvider/1"),+ of("codepipeline:DeleteCustomActionType",+ json("{\"category\":\"Build\",\"provider\":\"MyProvider\",\"version\":\"1\"}")));+ assertEquals(List.of(), of("codepipeline:DeleteCustomActionType", json("{}")));+ }++ /**+ * A Cloud Map service is created in the namespace {@code NamespaceId} names, or {@code DnsConfig.NamespaceId}+ * when it names none or gives a JSON null, as the handler reads them, and tags go on the service it creates,+ * not on the namespace.+ */+ @Test+ void aServiceIsCreatedInTheNamespaceItsHandlerReads() {+ String cloudMap = "arn:aws:servicediscovery:us-east-1:000000000000:";+ assertEquals(List.of(cloudMap + "namespace/ns-a", cloudMap + "service/*"), of("servicediscovery:CreateService",+ json("{\"Name\":\"s\",\"NamespaceId\":\"ns-a\"}")));+ assertEquals(List.of(cloudMap + "namespace/ns-b", cloudMap + "service/*"), of("servicediscovery:CreateService",+ json("{\"Name\":\"s\",\"DnsConfig\":{\"NamespaceId\":\"ns-b\"}}")));+ assertEquals(List.of(cloudMap + "namespace/ns-a", cloudMap + "service/*"), of("servicediscovery:CreateService",+ json("{\"Name\":\"s\",\"NamespaceId\":\"ns-a\",\"DnsConfig\":{\"NamespaceId\":\"ns-b\"}}")));+ // A JSON null is no namespace, as the handler reads it, which then takes DnsConfig's.+ assertEquals(List.of(cloudMap + "namespace/ns-b", cloudMap + "service/*"), of("servicediscovery:CreateService",+ json("{\"Name\":\"s\",\"NamespaceId\":null,\"DnsConfig\":{\"NamespaceId\":\"ns-b\"}}")));+ assertEquals(List.of(cloudMap + "service/*"), created("servicediscovery:CreateService",+ json("{\"Name\":\"s\",\"NamespaceId\":\"ns-a\"}")));+ }+@Testvoid aRequestNamingNoResourceOrOfANamespaceTheTableDoesNotReadIsCheckedOnStar() {assertEquals(List.of(), of("ecr:DescribeRepositories", json("{}")));diff --git a/src/test/java/io/github/hectorvent/floci/services/iam/IamRequestResourceEnforcementIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/iam/IamRequestResourceEnforcementIntegrationTest.javaindex a752555824..088cfae9d1 100644--- a/src/test/java/io/github/hectorvent/floci/services/iam/IamRequestResourceEnforcementIntegrationTest.java+++ b/src/test/java/io/github/hectorvent/floci/services/iam/IamRequestResourceEnforcementIntegrationTest.java@@ -18,7 +18,9 @@ import org.junit.jupiter.api.extension.RegisterExtension;import java.io.IOException;import java.net.URI;+import java.util.List;import java.util.Map;+import java.util.UUID;import static io.github.hectorvent.floci.testing.EnforcementFixtures.auth;import static io.restassured.RestAssured.given;@@ -489,6 +491,277 @@ class IamRequestResourceEnforcementIntegrationTest {+ "\",\"tags\":[{\"Key\":\"a\",\"Value\":\"b\"}]}").post("/").then(), "ecr:TagResource");}+ @Test+ void aDeliveryStreamIsCheckedOnTheArnItsNameGives() {+ String name = "res-stream-" + suffix();+ String arn = adminJson("firehose", "Firehose_20150804.CreateDeliveryStream")+ .body("{\"DeliveryStreamName\":\"" + name + "\"}").post("/").then().statusCode(200)+ .extract().path("DeliveryStreamARN");+ cleanup.register(() -> adminJson("firehose", "Firehose_20150804.DeleteDeliveryStream")+ .body("{\"DeliveryStreamName\":\"" + name + "\"}").post("/"));+ assertEquals("arn:aws:firehose:" + REGION + ":" + ACCOUNT + ":deliverystream/" + name, arn);++ User user = user("res-stream");+ user.policy(allowOn("firehose:DescribeDeliveryStream", arn));+ describeDeliveryStream(user, name).statusCode(200);+ refusedJson(describeDeliveryStream(user, name + "-other"), "firehose:DescribeDeliveryStream");+ }++ /** An identity pool is checked on the ARN its id gives, the one Cognito tags it under. */+ @Test+ void anIdentityPoolIsCheckedOnTheArnItsIdGives() {+ String id = adminJson("cognito-identity", "AWSCognitoIdentityService.CreateIdentityPool")+ .body("{\"IdentityPoolName\":\"res pool " + suffix() + "\",\"AllowUnauthenticatedIdentities\":false}")+ .post("/").then().statusCode(200).extract().path("IdentityPoolId");+ cleanup.register(() -> adminJson("cognito-identity", "AWSCognitoIdentityService.DeleteIdentityPool")+ .body("{\"IdentityPoolId\":\"" + id + "\"}").post("/"));+ String arn = "arn:aws:cognito-identity:" + REGION + ":" + ACCOUNT + ":identitypool/" + id;+ adminJson("cognito-identity", "AWSCognitoIdentityService.TagResource")+ .body("{\"ResourceArn\":\"" + arn + "\",\"Tags\":{\"a\":\"b\"}}").post("/").then().statusCode(200);++ User user = user("res-identity-pool");+ user.policy(allowOn("cognito-identity:DescribeIdentityPool", arn));+ describeIdentityPool(user, id).statusCode(200);+ refusedJson(describeIdentityPool(user, REGION + ":" + UUID.randomUUID()), "cognito-identity:DescribeIdentityPool");+ }++ @Test+ void aCloudMapNamespaceAndServiceAreCheckedOnTheArnsTheirIdsGive() {+ String namespaceId = cloudMapNamespace("res-ns-" + suffix());+ String namespaceArn = adminJson("servicediscovery", "Route53AutoNaming_v20170314.GetNamespace")+ .body("{\"Id\":\"" + namespaceId + "\"}").post("/").then().statusCode(200).extract().path("Namespace.Arn");+ assertEquals("arn:aws:servicediscovery:" + REGION + ":" + ACCOUNT + ":namespace/" + namespaceId, namespaceArn);+ Map<String, String> service = adminJson("servicediscovery", "Route53AutoNaming_v20170314.CreateService")+ .body("{\"Name\":\"res-svc\",\"NamespaceId\":\"" + namespaceId + "\"}").post("/").then().statusCode(200)+ .extract().path("Service");+ cleanup.register(() -> adminJson("servicediscovery", "Route53AutoNaming_v20170314.DeleteService")+ .body("{\"Id\":\"" + service.get("Id") + "\"}").post("/"));+ assertEquals("arn:aws:servicediscovery:" + REGION + ":" + ACCOUNT + ":service/" + service.get("Id"),+ service.get("Arn"));++ User user = user("res-cloud-map");+ user.policy(allowOn("servicediscovery:GetNamespace", namespaceArn) + ","+ + allowOn("servicediscovery:GetService", service.get("Arn")));+ cloudMap(user, "GetNamespace", namespaceId).statusCode(200);+ refusedJson(cloudMap(user, "GetNamespace", "ns-" + suffix()), "servicediscovery:GetNamespace");+ cloudMap(user, "GetService", service.get("Id")).statusCode(200);+ refusedJson(cloudMap(user, "GetService", "srv-" + suffix()), "servicediscovery:GetService");+ }++ @Test+ void aCertificateIsCheckedOnItsArn() {+ String arn = adminJson("acm", "CertificateManager.RequestCertificate")+ .body("{\"DomainName\":\"res-" + suffix() + ".example.com\"}").post("/").then().statusCode(200)+ .extract().path("CertificateArn");+ cleanup.register(() -> adminJson("acm", "CertificateManager.DeleteCertificate")+ .body("{\"CertificateArn\":\"" + arn + "\"}").post("/"));+ assertTrue(arn.startsWith("arn:aws:acm:" + REGION + ":" + ACCOUNT + ":certificate/"), arn);++ User user = user("res-certificate");+ user.policy(allowOn("acm:DescribeCertificate", arn));+ describeCertificate(user, arn).statusCode(200);+ refusedJson(describeCertificate(user, "arn:aws:acm:" + REGION + ":" + ACCOUNT + ":certificate/" + UUID.randomUUID()),+ "acm:DescribeCertificate");+ }++ /**+ * A pipeline is checked on the ARN its name gives, a request naming it by a bare {@code name} too, and a webhook+ * on {@code webhook:<name>}, the ARN CodePipeline gives it.+ */+ @Test+ void aPipelineAndAWebhookAreCheckedOnTheArnsTheirNamesGive() {+ String name = "res-pipeline-" + suffix();+ adminJson("codepipeline", "CodePipeline_20150709.CreatePipeline").body(pipeline(name)).post("/")+ .then().statusCode(200);+ cleanup.register(() -> adminJson("codepipeline", "CodePipeline_20150709.DeletePipeline")+ .body("{\"name\":\"" + name + "\"}").post("/"));+ String pipelineArn = adminJson("codepipeline", "CodePipeline_20150709.GetPipeline")+ .body("{\"name\":\"" + name + "\"}").post("/").then().statusCode(200).extract().path("metadata.pipelineArn");+ assertEquals("arn:aws:codepipeline:" + REGION + ":" + ACCOUNT + ":" + name, pipelineArn);++ User user = user("res-pipeline");+ user.policy(allowOn("codepipeline:GetPipeline", pipelineArn) + ","+ + allowOn("codepipeline:GetPipelineState", pipelineArn));+ codePipeline(user, "GetPipeline", "{\"name\":\"" + name + "\"}").statusCode(200);+ codePipeline(user, "GetPipelineState", "{\"name\":\"" + name + "\"}").statusCode(200);+ refusedJson(codePipeline(user, "GetPipelineState", "{\"name\":\"" + name + "-other\"}"),+ "codepipeline:GetPipelineState");++ String hook = "res-hook-" + suffix();+ String hookArn = adminJson("codepipeline", "CodePipeline_20150709.PutWebhook").body("{\"webhook\":{\"name\":\""+ + hook + "\",\"targetPipeline\":\"" + name + "\",\"targetAction\":\"SourceAction\",\"filters\":"+ + "[{\"jsonPath\":\"$.ref\",\"matchEquals\":\"refs/heads/main\"}],\"authentication\":\"UNAUTHENTICATED\"}}")+ .post("/").then().statusCode(200).extract().path("webhook.arn");+ assertEquals("arn:aws:codepipeline:" + REGION + ":" + ACCOUNT + ":webhook:" + hook, hookArn);+ user.policy(allowOn("codepipeline:DeleteWebhook", hookArn));+ refusedJson(codePipeline(user, "DeleteWebhook", "{\"name\":\"" + hook + "-other\"}"), "codepipeline:DeleteWebhook");+ codePipeline(user, "DeleteWebhook", "{\"name\":\"" + hook + "\"}").statusCode(200);+ }++ /** {@code StartPipelineExecution} names its pipeline by a bare {@code name}, on which it is checked. */+ @Test+ void aPipelineExecutionIsCheckedOnThePipelineItsNameGives() {+ String name = "res-pipeline-" + suffix();+ User user = user("res-pipeline-start");+ user.policy(allowOn("codepipeline:StartPipelineExecution",+ "arn:aws:codepipeline:" + REGION + ":" + ACCOUNT + ":" + name));+ codePipeline(user, "StartPipelineExecution", "{\"name\":\"" + name + "\"}").statusCode(400)+ .body(containsString("PipelineNotFoundException"));+ refusedJson(codePipeline(user, "StartPipelineExecution", "{\"name\":\"" + name + "-other\"}"),+ "codepipeline:StartPipelineExecution");+ }++ /**+ * An update is checked on the pipeline its {@code pipeline.name} names, which it changes, not on one its+ * {@code roleArn} holds: a grant on one pipeline does not let a request naming another through by giving the+ * first's ARN as its role.+ */+ @Test+ void anUpdateIsCheckedOnThePipelineItNamesNotOneItsRoleHolds() {+ String allowed = "res-pipeline-" + suffix();+ String other = allowed + "-other";+ for (String name : List.of(allowed, other)) {+ adminJson("codepipeline", "CodePipeline_20150709.CreatePipeline").body(pipeline(name)).post("/")+ .then().statusCode(200);+ cleanup.register(() -> adminJson("codepipeline", "CodePipeline_20150709.DeletePipeline")+ .body("{\"name\":\"" + name + "\"}").post("/"));+ }+ String allowedArn = "arn:aws:codepipeline:" + REGION + ":" + ACCOUNT + ":" + allowed;+ User user = user("res-pipeline-update");+ user.policy(allowOn("codepipeline:UpdatePipeline", allowedArn) + ","+ + allowOn("iam:PassRole", "arn:aws:iam::" + ACCOUNT + ":role/codepipeline-role"));+ refusedJson(codePipeline(user, "UpdatePipeline", pipeline(other).replace(+ "arn:aws:iam::" + ACCOUNT + ":role/codepipeline-role", allowedArn)), "codepipeline:UpdatePipeline");+ codePipeline(user, "UpdatePipeline", pipeline(allowed)).statusCode(200);+ }++ /** A webhook's tags are checked on the webhook, not on the pipeline it connects to, which they do not go on. */+ @Test+ void aWebhooksTagsAreCheckedOnTheWebhookNotItsPipeline() {+ String name = "res-pipeline-" + suffix();+ adminJson("codepipeline", "CodePipeline_20150709.CreatePipeline").body(pipeline(name)).post("/")+ .then().statusCode(200);+ cleanup.register(() -> adminJson("codepipeline", "CodePipeline_20150709.DeletePipeline")+ .body("{\"name\":\"" + name + "\"}").post("/"));+ String hook = "res-hook-" + suffix();+ String codePipeline = "arn:aws:codepipeline:" + REGION + ":" + ACCOUNT + ":";+ User user = user("res-webhook-tags");+ user.policy(allowOn("codepipeline:PutWebhook", codePipeline + "webhook:" + hook) + ","+ + allowOn("codepipeline:PutWebhook", codePipeline + name) + ","+ + allowOn("codepipeline:TagResource", codePipeline + "webhook:*"));+ codePipeline(user, "PutWebhook", "{\"webhook\":{\"name\":\"" + hook + "\",\"targetPipeline\":\"" + name+ + "\",\"targetAction\":\"SourceAction\",\"filters\":[{\"jsonPath\":\"$.ref\",\"matchEquals\":"+ + "\"refs/heads/main\"}],\"authentication\":\"UNAUTHENTICATED\"},\"tags\":[{\"key\":\"a\",\"value\":\"b\"}]}")+ .statusCode(200);+ cleanup.register(() -> adminJson("codepipeline", "CodePipeline_20150709.DeleteWebhook")+ .body("{\"name\":\"" + hook + "\"}").post("/"));+ }++ /**+ * A service is created in the namespace its {@code DnsConfig.NamespaceId} names when the request gives no+ * {@code NamespaceId}, or a JSON null for it, as Cloud Map reads it, so a deny on that namespace holds.+ */+ @Test+ void aServiceIsCheckedOnTheNamespaceItsDnsConfigNames() {+ String namespaceId = cloudMapNamespace("res-ns-dns-" + suffix());+ User user = user("res-cloud-map-dns");+ user.policy(allowOn("servicediscovery:CreateService", "*") + ",{\"Effect\":\"Deny\",\"Action\":"+ + "\"servicediscovery:CreateService\",\"Resource\":\"arn:aws:servicediscovery:" + REGION + ":" + ACCOUNT+ + ":namespace/" + namespaceId + "\"}");+ String dnsConfig = "\"DnsConfig\":{\"NamespaceId\":\"" + namespaceId + "\",\"DnsRecords\":"+ + "[{\"Type\":\"A\",\"TTL\":60}]}";+ refusedJson(user.json("servicediscovery", "Route53AutoNaming_v20170314.CreateService", "1.1")+ .body("{\"Name\":\"res-svc\"," + dnsConfig + "}").post("/").then(), "servicediscovery:CreateService");+ refusedJson(user.json("servicediscovery", "Route53AutoNaming_v20170314.CreateService", "1.1")+ .body("{\"Name\":\"res-svc\",\"NamespaceId\":null," + dnsConfig + "}").post("/").then(),+ "servicediscovery:CreateService");+ }++ /** A service's tags are checked on the service it creates, not on the namespace it creates it in. */+ @Test+ void aServicesTagsAreCheckedOnTheServiceNotItsNamespace() {+ String namespaceId = cloudMapNamespace("res-ns-tags-" + suffix());+ String cloudMap = "arn:aws:servicediscovery:" + REGION + ":" + ACCOUNT + ":";+ User user = user("res-cloud-map-tags");+ user.policy(allowOn("servicediscovery:CreateService", cloudMap + "namespace/" + namespaceId) + ","+ + allowOn("servicediscovery:CreateService", cloudMap + "service/*") + ","+ + allowOn("servicediscovery:TagResource", cloudMap + "service/*"));+ String serviceId = user.json("servicediscovery", "Route53AutoNaming_v20170314.CreateService", "1.1")+ .body("{\"Name\":\"res-svc\",\"NamespaceId\":\"" + namespaceId + "\",\"Tags\":[{\"Key\":\"a\",\"Value\":\"b\"}]}")+ .post("/").then().statusCode(200).extract().path("Service.Id");+ cleanup.register(() -> adminJson("servicediscovery", "Route53AutoNaming_v20170314.DeleteService")+ .body("{\"Id\":\"" + serviceId + "\"}").post("/"));+ }++ /**+ * A custom action type is checked on {@code actiontype:Custom/...}, its owner being {@code Custom}, which the+ * request does not give, so a grant on the ARN CodePipeline gives it allows creating and deleting it.+ */+ @Test+ void aCustomActionTypeIsCheckedAsCustoms() {+ String provider = "Res" + suffix();+ String arn = "arn:aws:codepipeline:" + REGION + ":" + ACCOUNT + ":actiontype:Custom/Build/" + provider + "/1";+ User user = user("res-action-type");+ user.policy(allowOn("codepipeline:CreateCustomActionType", arn) + ","+ + allowOn("codepipeline:DeleteCustomActionType", arn));+ String type = "\"category\":\"Build\",\"provider\":\"" + provider + "\",\"version\":\"1\"";+ codePipeline(user, "CreateCustomActionType", "{" + type + ",\"inputArtifactDetails\":{\"minimumCount\":0,"+ + "\"maximumCount\":1},\"outputArtifactDetails\":{\"minimumCount\":0,\"maximumCount\":1}}")+ .statusCode(200).body("actionType.id.owner", equalTo("Custom"));+ refusedJson(codePipeline(user, "DeleteCustomActionType", "{" + type.replace(provider, provider + "x") + "}"),+ "codepipeline:DeleteCustomActionType");+ codePipeline(user, "DeleteCustomActionType", "{" + type + "}").statusCode(200);+ }++ /** A Cloud Map HTTP namespace, created for the test and deleted after it; its id. */+ private String cloudMapNamespace(String name) {+ adminJson("servicediscovery", "Route53AutoNaming_v20170314.CreateHttpNamespace")+ .body("{\"Name\":\"" + name + "\"}").post("/").then().statusCode(200);+ String id = adminJson("servicediscovery", "Route53AutoNaming_v20170314.ListNamespaces").body("{}")+ .post("/").then().statusCode(200).extract().path("Namespaces.find { it.Name == '" + name + "' }.Id");+ cleanup.register(() -> adminJson("servicediscovery", "Route53AutoNaming_v20170314.DeleteNamespace")+ .body("{\"Id\":\"" + id + "\"}").post("/"));+ return id;+ }++ private static RequestSpecification adminJson(String service, String target) {+ return admin(service).header("X-Amz-Target", target).contentType("application/x-amz-json-1.1");+ }++ private static ValidatableResponse describeDeliveryStream(User user, String name) {+ return user.json("firehose", "Firehose_20150804.DescribeDeliveryStream", "1.1")+ .body("{\"DeliveryStreamName\":\"" + name + "\"}").post("/").then();+ }++ private static ValidatableResponse describeIdentityPool(User user, String id) {+ return user.json("cognito-identity", "AWSCognitoIdentityService.DescribeIdentityPool", "1.1")+ .body("{\"IdentityPoolId\":\"" + id + "\"}").post("/").then();+ }++ private static ValidatableResponse cloudMap(User user, String operation, String id) {+ return user.json("servicediscovery", "Route53AutoNaming_v20170314." + operation, "1.1")+ .body("{\"Id\":\"" + id + "\"}").post("/").then();+ }++ private static ValidatableResponse describeCertificate(User user, String arn) {+ return user.json("acm", "CertificateManager.DescribeCertificate", "1.1")+ .body("{\"CertificateArn\":\"" + arn + "\"}").post("/").then();+ }++ private static ValidatableResponse codePipeline(User user, String operation, String body) {+ return user.json("codepipeline", "CodePipeline_20150709." + operation, "1.1").body(body).post("/").then();+ }++ /** A pipeline with a source and a build stage, the two stages CodePipeline requires. */+ private static String pipeline(String name) {+ return "{\"pipeline\":{\"name\":\"" + name + "\",\"roleArn\":\"arn:aws:iam::" + ACCOUNT + ":role/codepipeline-role\","+ + "\"artifactStore\":{\"type\":\"S3\",\"location\":\"codepipeline-artifacts\"},\"stages\":["+ + "{\"name\":\"Source\",\"actions\":[{\"name\":\"SourceAction\",\"actionTypeId\":{\"category\":\"Source\","+ + "\"owner\":\"AWS\",\"provider\":\"S3\",\"version\":\"1\"},\"runOrder\":1}]},"+ + "{\"name\":\"Build\",\"actions\":[{\"name\":\"BuildAction\",\"actionTypeId\":{\"category\":\"Build\","+ + "\"owner\":\"AWS\",\"provider\":\"CodeBuild\",\"version\":\"1\"},\"runOrder\":1}]}]}}";+ }+private static RequestSpecification tagged(RequestSpecification request) {return request.formParam("Tags.member.1.Key", "elbv2.k8s.aws/cluster").formParam("Tags.member.1.Value", "c");}diff --git a/tools/aws/regen_iam_request_resources.py b/tools/aws/regen_iam_request_resources.pyindex db2d7e397e..dacd9ae7a5 100644--- a/tools/aws/regen_iam_request_resources.py+++ b/tools/aws/regen_iam_request_resources.py@@ -49,7 +49,10 @@ the ARN it gives: `PutEvents`' `Entries[].EventBusName`.An operation that creates a type its action does not act on names the new resource from the ARN of theparent it acts on, when the child's ARN format is the parent's with its resource type word replaced andone id appended (`CreateListener` acts on a load balancer and makes `listener/app/<lb>/<id>/*`); the-tagging action a create's tags need is checked on it, as AWS checks it on the resource being tagged.+tagging action a create's tags need is checked on it, as AWS checks it on the resource being tagged. A create+that names another resource beside the one it makes, the pipeline a webhook connects to or the namespace a+service is made in, marks the one it makes `made`, of a type, or with an ARN format's leading resource word,+related to its name past the verb, so its tags are checked there alone.A type nothing names is not checked: an action lists the optional resources its requests may use(`RunInstances` lists `elastic-gpu`), and checking one a request does not name would refuse a grant@@ -62,10 +65,13 @@ or not. `HAND_BUILT` are the namespaces `ResourceArnBuilder` builds resources fo`RequestResourceNamespacesIntegrationTest` fails for a served namespace in none of the three.`CORRECTIONS` gives an operation's resources where the rule gets them wrong, each with its reason; aresource there may apply only `when` a member has one of some values (`Type` picks the load balancer-v2 `CreateLoadBalancer` creates), or `unless` it has, read as a value when it is `absent` (an-EventBridge request naming no event bus names the default one), a variable may be filled from a field+v2 `CreateLoadBalancer` creates), or `unless` it has, a member given a JSON null counting as absent+(Cloud Map's handler then reads `DnsConfig.NamespaceId`), and a member read as a value when it is+`absent` (an EventBridge request naming no event bus names the default one), a variable may be filled from a fieldof each element of a list of structures, one resource for each element and the `absent` value for an-element lacking it (`PutEvents` publishes each entry to its bus), and an ARN member's value may be read+element lacking it (`PutEvents` publishes each entry to its bus), or from a structure's field (`pipeline.name`),+a variable no member gives may be `fixed` to the one value its handler uses (a CodePipeline custom action+type's owner, `Custom`), and an ARN member's value may be readonly up to a character `before` which its handler drops the rest (`StartExecution`'s`<stateMachineArn>#<test case>`). `CLIENTS_NOT_READ` are SDK clients the reference lists for anamespace's operations whose requests Floci does not serve, each with its reason.@@ -111,7 +117,8 @@ OUTPUT = REPO_ROOT / "src/main/resources/aws/iam-request-resources.json"# The namespaces read, in batches: each moves here from NOT_COVERED with the tests that show its ARNs# are the ones its handlers mint.-NAMESPACES = ("cognito-idp", "ecr", "elasticloadbalancing", "events", "states")+NAMESPACES = ("acm", "codepipeline", "cognito-identity", "cognito-idp", "ecr", "elasticloadbalancing", "events",+ "firehose", "servicediscovery", "states")# SDK clients the reference lists for a namespace's operations whose requests Floci does not serve, and why: their# members are not read.@@ -132,12 +139,15 @@ _REST = "REST: its requests name their resources in the path, which RequestResouNOT_COVERED: dict[str, str] = {"access-analyzer": _REST,"account": _REST,- "acm": _LATER,"airflow": _REST,"apigateway": _REST,"app-integrations": _REST,"appconfig": _REST,- "application-autoscaling": _LATER,+ "application-autoscaling": "not read yet: a scalable target's ARN ends in an id the service mints, "+ "`scalable-target/<id>`, while its requests name the target by ServiceNamespace, "+ "ResourceId and ScalableDimension, so its resource is the stored ARN those three "+ "find, which RequestResources has no lookup for yet; read as a member, ResourceId "+ "would fill that id","appsync": _REST,"aps": _REST,"athena": _LATER,@@ -160,8 +170,6 @@ NOT_COVERED: dict[str, str] = {"codebuild": _LATER,"codedeploy": _LATER,"codeguru-reviewer": _REST,- "codepipeline": _LATER,- "cognito-identity": _LATER,"comprehend": _LATER,"config": _LATER,"connect": _REST,@@ -181,7 +189,6 @@ NOT_COVERED: dict[str, str] = {"emr-serverless": _REST,"es": _REST,"execute-api": _REST,- "firehose": _LATER,"fis": _REST,"globalaccelerator": _LATER,"glue": _LATER,@@ -214,7 +221,6 @@ NOT_COVERED: dict[str, str] = {"sagemaker": _LATER,"securityhub": _REST,"servicecatalog": _LATER,- "servicediscovery": _LATER,"servicequotas": _LATER,"ses": _LATER,"signin": _REST,@@ -240,6 +246,38 @@ CORRECTIONS: dict[str, tuple[list[dict], str]] = {{"type": "loadbalancer/net/", "fill": {"LoadBalancerName": "Name"}, "when": {"Type": ["network"]}},], "the classic API names its load balancer by LoadBalancerName; the v2 API by Name, its type by Type, ""an application load balancer when it gives none, which the rule cannot tell apart"),+ **{f"codepipeline:{operation}": ([{"type": "pipeline", "fill": {"PipelineName": "pipeline.name"}}],+ "the request names the pipeline by its pipeline structure's name, which the "+ "rule does not read inside a structure; its roleArn is the role CodePipeline "+ "assumes, an IAM role's ARN by botocore's pattern, never a pipeline's, so it "+ "names no pipeline")+ for operation in ("CreatePipeline", "UpdatePipeline")},+ "codepipeline:PutWebhook": ([{"type": "webhook", "fill": {"WebhookName": "webhook.name"}},+ {"type": "pipeline", "fill": {"PipelineName": "webhook.targetPipeline"}}],+ "the request names the webhook by its webhook structure's name and the pipeline it "+ "connects to by its targetPipeline ('The name of the pipeline you want to connect to "+ "the webhook'), which the rule does not read inside a structure"),+ **{f"codepipeline:{operation}": ([{"type": "actiontype", "fill": {"Category": "category", "Provider": "provider",+ "Version": "version"},+ "fixed": {"Owner": "Custom"}}],+ "a custom action type's owner is Custom, which the request does not give: the API "+ "Reference's CreateCustomActionType example answers \"owner\": \"Custom\", and "+ "PollForJobs is valid only for action types with Custom in the owner field")+ for operation in ("CreateCustomActionType", "DeleteCustomActionType")},+ "servicediscovery:CreateService": ([+ {"type": "namespace", "fill": {"NamespaceId": "NamespaceId"}, "unless": {"NamespaceId": [None]}},+ {"type": "namespace", "fill": {"NamespaceId": "DnsConfig.NamespaceId"}, "when": {"NamespaceId": [None]}},+ {"type": "service", "fill": {}},+ ], "the request names its namespace by NamespaceId or, when it gives none or a JSON null, by "+ "DnsConfig.NamespaceId, which botocore keeps ('Use NamespaceId in Service instead') and Cloud Map's handler "+ "reads then; the rule does not read a structure's member, and names the service the request creates with "+ "every variable open"),+ **{f"codepipeline:{operation}": ([{"type": "pipeline", "fill": {"PipelineName": "name"}}],+ f"the request names the pipeline by a bare name, '{doc}' in botocore's model, "+ "which the rule reads only for an operation named after the type")+ for operation, doc in (("GetPipelineState", "The name of the pipeline about which you want to get "+ "information"),+ ("StartPipelineExecution", "The name of the pipeline to start"))},**{f"events:{operation}": ([{"type": "rule-on-default-event-bus", "fill": {"RuleName": rule}, "when": {"EventBusName": ["default"]},"absent": {"EventBusName": "default"}},@@ -549,6 +587,28 @@ def resources_for(operation: str, types: list[str], formats: dict[str, str], memRESOURCE_PART_RE = re.compile(r"^arn:\$\{Partition}:[^:]*:[^:]*:[^:]*:([A-Za-z][A-Za-z0-9-]*)(.*)$")+def with_made(resources: list[dict], operation: str, formats: dict[str, str]) -> list[dict]:+ """The resources, those a create makes marked `made` when it names others too (the pipeline a webhook connects+ to, the namespace a service is created in), so that its tags are checked on what it makes alone: of a type, or+ with an ARN format's leading resource word, related to the operation's name past its verb."""+ name = operation.split(":", 1)[1]+ if not CREATING_RE.match(name):+ return resources+ created = stem(CREATING_RE.sub("", name))++ def makes(resource: dict) -> bool:+ for kind in resource.get("types") or [resource.get("type")]:+ word = RESOURCE_PART_RE.match(formats.get(kind, ""))+ if related(created, stem(kind)) or (word is not None and related(created, stem(word.group(1)))):+ return True+ return False++ made = [makes(resource) for resource in resources]+ if all(made) or not any(made):+ return resources+ return [dict(resource, made=True) if is_made else resource for resource, is_made in zip(resources, made)]++def child_id(child: str, parent: str) -> str | None:"""The variable a child type's ARN format adds to its parent's: the parent's with its leading resource type wordreplaced and one id appended (`listener/app/.../${ListenerId}` for `loadbalancer/app/...`); None for any other."""@@ -616,6 +676,7 @@ def entry_for(operation: str, upstream: dict, formats: dict[str, str], models: dresources = resources_for(operation, types, formats, members)resources = with_account(resources, formats, account_members(models, operation.split(":", 1)[1]))resources = with_arn_of(resources, formats, name_or_arn_members(models, operation.split(":", 1)[1]))+ resources = with_made(resources, operation, formats)entry = {"action": upstream["action"], "types": types, "resources": resources}creates = creates_for(operation, types, formats, members)if creates:@@ -729,8 +790,9 @@ def render(document: dict) -> str:# Gates# --------------------------------------------------------------------------- #PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[])?$")-# A member filling a variable may also be a field of each element of a list of structures, one value for each.-FILL_PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[]|\[]\.[A-Za-z][A-Za-z0-9_]*)?$")+# A member filling a variable may also be a field of a structure, or of each element of a list of structures, one+# value for each.+FILL_PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[]|\[]\.[A-Za-z][A-Za-z0-9_]*|\.[A-Za-z][A-Za-z0-9_]*)?$")# An ARN member's path may go one level into a structure or a list's structures.ARN_PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[])?(\.[A-Za-z][A-Za-z0-9_]*(\[])?)?$")# A format's resource that is a literal and one variable, at its end.@@ -796,9 +858,12 @@ def validate(document: dict) -> list[str]:def _resource_problems(operation: str, resource: object, types: set[str], formats: dict[str, str]) -> list[str]:- if not isinstance(resource, dict) or not ({"types", "arn"} <= set(resource) <= {"types", "arn", "before"}- or {"type", "fill"} <= set(resource) <= {"type", "fill", "when", "unless", "absent", "arnOf", "account"}):+ if not isinstance(resource, dict) or not ({"types", "arn"} <= set(resource) <= {"types", "arn", "before", "made"}+ or {"type", "fill"} <= set(resource) <= {"type", "fill", "when", "unless", "absent", "arnOf", "account",+ "fixed", "made"}):return [f"{operation} names {resource!r}, which is neither an ARN member nor a type's variables"]+ if resource.get("made", True) is not True:+ return [f"{operation} marks {resource!r} made by {resource['made']!r}, which is not true"]kinds = resource.get("types") or [resource.get("type")]if not all(isinstance(kind, str) and kind in types and kind in formats for kind in kinds):return [f"{operation} names {kinds}, not resource types its action acts on with an ARN format"]@@ -815,6 +880,10 @@ def _resource_problems(operation: str, resource: object, types: set[str], formatreturn [f"{operation} fills {fill!r}, which are no variables of {kinds[0]}'s ARN by members"]if sum("[]" in path for path in fill.values()) > 1:return [f"{operation} fills {kinds[0]} from more than one list"]+ fixed = resource.get("fixed", {})+ if not isinstance(fixed, dict) or set(fixed) - variables or set(fixed) & set(fill) or not all(+ isinstance(value, str) and value for value in fixed.values()):+ return [f"{operation} fixes {fixed!r}, which are no variables of {kinds[0]}'s ARN no member fills, or no values"]for key in ("when", "unless"):when = resource.get(key, {})if not isinstance(when, dict) or not all(@@ -839,13 +908,13 @@ def _resource_problems(operation: str, resource: object, types: set[str], formatdef _read_as_one(path: object, fill: dict) -> bool:- """Whether a member gives one value as it is read: a top-level one that is no list, or a field of each element- of a list of structures that fills a variable, one value for each element."""+ """Whether a member gives one value as it is read: one that is no list, top-level or a field of a structure, or a+ field of each element of a list of structures that fills a variable, one value for each element."""if not isinstance(path, str):return Falseif "[]." in path:return bool(FILL_PATH_RE.match(path)) and path in fill.values()- return bool(PATH_RE.match(path)) and not path.endswith("[]")+ return bool(FILL_PATH_RE.match(path)) and not path.endswith("[]")def _created_problems(operation: str, created: object, types: set[str], formats: dict[str, str]) -> list[str]:diff --git a/tools/aws/test_regen_iam_request_resources.py b/tools/aws/test_regen_iam_request_resources.pyindex 54599ff367..49e992786a 100644--- a/tools/aws/test_regen_iam_request_resources.py+++ b/tools/aws/test_regen_iam_request_resources.py@@ -127,6 +127,22 @@ def test_an_arn_inside_a_structure_or_a_lists_structures_is_read_by_its_path():assert r.creates_for("svc:CreateThing", ["thing"], FORMATS, {"Parts[].ThingArn": "Parts[].ThingArn"}) == []+def test_a_create_naming_others_marks_what_it_makes():+ formats = {"webhook": "arn:${Partition}:svc:${Region}:${Account}:webhook:${WebhookName}",+ "pipeline": "arn:${Partition}:svc:${Region}:${Account}:${PipelineName}",+ "lb": FORMATS["lb"], "lb/app/": FORMATS["lb/app/"]}+ webhook = {"type": "webhook", "fill": {"WebhookName": "webhook.name"}}+ pipeline = {"type": "pipeline", "fill": {"PipelineName": "webhook.targetPipeline"}}+ assert r.with_made([webhook, pipeline], "svc:PutWebhook", formats) == [dict(webhook, made=True), pipeline]+ # A type made by its ARN format's leading resource word, so every load balancer type is made; with every+ # resource made, or none, or for no create, nothing is marked.+ classic = {"type": "lb", "fill": {"LoadBalancerName": "LoadBalancerName"}}+ app = {"type": "lb/app/", "fill": {"LoadBalancerName": "Name"}}+ assert r.with_made([classic, app], "svc:CreateLoadBalancer", formats) == [classic, app]+ assert r.with_made([pipeline], "svc:PutWebhook", formats) == [pipeline]+ assert r.with_made([webhook, pipeline], "svc:DescribeWebhook", formats) == [webhook, pipeline]++def test_stems_drop_the_suffixes_names_carry():assert r.stem("TargetGroupArns") == "targetgroup"assert r.stem("DBInstanceIdentifier") == "dbinstance"@@ -324,6 +340,12 @@ def test_a_well_formed_document_validates():document["operations"]["svc:B"]["resources"][0].update(fill={"GroupName": "Groups[].Name"}, absent={"Groups[].Name": "default"}, arnOf={"Groups[].Name": "thing"})assert r.validate(document) == []+ # A field of a structure fills a variable, read as one value, and a variable no member fills may be fixed.+ document = good_document()+ document["operations"]["svc:B"]["resources"][0].update(+ fill={"GroupName": "Group.Name"}, absent={"Group.Name": "default"}, fixed={"GroupId": "g-1"}, made=True)+ document["operations"]["svc:A"]["resources"][0]["made"] = True+ assert r.validate(document) == []def with_a_create() -> dict:@@ -337,7 +359,16 @@ def with_a_create() -> dict:(lambda d: d["operations"]["svc:A"]["resources"][0].update(types=["pool"]), "not resource types"),(lambda d: d["operations"]["svc:A"]["resources"][0].update(arn="a.b.c"), "no member"),(lambda d: d["operations"]["svc:A"]["resources"][0].update(arn="a[][]"), "no member"),- (lambda d: d["operations"]["svc:B"]["resources"][0]["fill"].update(GroupName="Group.Name"), "no variables"),+ (lambda d: d["operations"]["svc:B"]["resources"][0]["fill"].update(GroupName="Group.Names[]"), "no variables"),+ (lambda d: d["operations"]["svc:B"]["resources"][0]["fill"].update(GroupName="A.B.Name"), "no variables"),+ (lambda d: d["operations"]["svc:B"]["resources"][0].update(fixed={"Other": "x"}), "fixes"),+ (lambda d: d["operations"]["svc:B"]["resources"][0].update(fixed={"GroupName": "x"}), "fixes"),+ (lambda d: d["operations"]["svc:B"]["resources"][0].update(fixed={"GroupId": ""}), "fixes"),+ (lambda d: d["operations"]["svc:B"]["resources"][0].update(fixed={"GroupId": 1}), "fixes"),+ (lambda d: d["operations"]["svc:B"]["resources"][0].update(fixed=["GroupId"]), "fixes"),+ (lambda d: d["operations"]["svc:A"]["resources"][0].update(fixed={"GroupId": "x"}), "neither an ARN member"),+ (lambda d: d["operations"]["svc:B"]["resources"][0].update(made=False), "not true"),+ (lambda d: d["operations"]["svc:A"]["resources"][0].update(made="true"), "not true"),(lambda d: d["operations"]["svc:B"]["resources"][0]["fill"].update(GroupName="Groups[].Names[]"), "no variables"),(lambda d: d["operations"]["svc:B"]["resources"][0]["fill"].update(GroupId="Groups[].Id"), "more than one list"),(lambda d: d["operations"]["svc:B"]["resources"][0].update(absent={"Groups[].Name": "default"}), "absent members"),@@ -413,8 +444,9 @@ def test_every_correction_is_the_vendored_entry_of_an_operation_the_file_reads()assert r.CORRECTIONSfor operation, (resources, reason) in r.CORRECTIONS.items():assert operation in operations and reason, operation- # A resource's account and the ARNs its members may give are botocore's, on top of the correction.- assert [{key: value for key, value in resource.items() if key not in ("account", "arnOf")}+ # A resource's account and the ARNs its members may give are botocore's, and whether a create makes it the+ # rule's, on top of the correction.+ assert [{key: value for key, value in resource.items() if key not in ("account", "arnOf", "made")}for resource in operations[operation]["resources"]] == resources, operation