From 39c29de6353b247e88e4731338d090b241036df3 Mon Sep 17 00:00:00 2001 From: Tyler Webb <85189637+T-Webb1@users.noreply.github.com> Date: Fri, 13 Nov 2026 13:15:17 -0800 Subject: [PATCH] feat(ssm): generate the IAM request resources for SSM (#8203) * feat(ssm): generate the IAM request resources for SSM * test(ssm): enforce IAM on parameter reads, deletes and tagging * refactor(ssm): derive the SSM request resources without corrections * fix(iam): read a Parameter Store name as its parameter's ARN holds it * fix(ssm): refuse tagging a resource type other than a parameter * test(ssm): read an unslashed parameter by its ARN under a grant on it * test(iam): expect ssm parameter in the vendored unqualified types * fix(ssm): keep tagging documents and associations * refactor(iam): drop the SSM operations read in the hand-built namespaces * chore(iam): resync Route 53 record set protection resource types --- .../aws/core/common/RequestResources.java | 30 +- .../aws/services/iam/ResourceArnBuilder.java | 31 -- .../aws/services/ssm/SsmJsonHandler.java | 29 ++ .../io/floci/aws/services/ssm/SsmService.java | 26 +- .../resources/aws/iam-request-resources.json | 161 +++++++++- .../common/RequestResourceMembersTest.java | 4 +- .../aws/core/common/RequestResourcesTest.java | 58 ++++ .../services/iam/ResourceArnBuilderTest.java | 31 +- ...rametersIamEnforcementIntegrationTest.java | 107 +++++++ .../aws/services/ssm/SsmIntegrationTest.java | 67 ++++ ...eterReadIamEnforcementIntegrationTest.java | 301 ++++++++++++++++++ ...mTaggingIamEnforcementIntegrationTest.java | 191 +++++++++++ tools/aws/regen_iam_request_resources.py | 65 ++-- tools/aws/test_regen_iam_request_resources.py | 13 +- 14 files changed, 1021 insertions(+), 93 deletions(-) create mode 100644 src/test/java/io/floci/aws/services/ssm/SsmDeleteParametersIamEnforcementIntegrationTest.java create mode 100644 src/test/java/io/floci/aws/services/ssm/SsmParameterReadIamEnforcementIntegrationTest.java create mode 100644 src/test/java/io/floci/aws/services/ssm/SsmTaggingIamEnforcementIntegrationTest.java diff --git a/src/main/java/io/floci/aws/core/common/RequestResources.java b/src/main/java/io/floci/aws/core/common/RequestResources.java index eefffbffcf..2b7d57cc29 100644 --- a/src/main/java/io/floci/aws/core/common/RequestResources.java +++ b/src/main/java/io/floci/aws/core/common/RequestResources.java @@ -44,6 +44,7 @@ public final class RequestResources { private static final Pattern VARIABLE = Pattern.compile("\\$\\{(\\w+)}"); private static final Pattern ACCOUNT_ID = Pattern.compile("\\d{12}"); + private static final String WITHOUT_LEADING_SLASH = "WithoutLeadingSlash"; /** Values for a type's variables, and the ARN whose account and Region the resource they name is in, if any. */ private record Filling(Map variables, AwsArnUtils.Arn from) { @@ -490,7 +491,9 @@ public final class RequestResources { * structure gives, the request's for a name (a {@code PutEvents} entry, on the bus it names). Each value is read * up to the resource's {@code before} character, when it has one (a CodeBuild build id's project), and without the * type's own path when it begins with one, as Route 53 returns its ids ({@code /hostedzone/Z1} names hosted zone - * {@code Z1}). A type + * {@code Z1}). A value filling a {@code ...WithoutLeadingSlash} variable is a Parameter Store name instead, read + * as {@link #asVariable} reads it. A value rendered past a type's format, when its service checks the + * type without a qualifier, is cut where the format ends, as an ARN given is. A type * whose service mints an id after its name is the caller's resource {@code stored} finds under that name, or * else has that id open. */ @@ -508,8 +511,10 @@ public final class RequestResources { boolean given = false; for (Map.Entry variable : resource.fill().entrySet()) { List values = read(resource, form, body, variable.getValue()).stream() - .map(value -> withoutTypePath(before(value, resource.before()), resource.types().getFirst())) - .map(value -> asVariable(variable.getKey(), value)) + .map(value -> before(value, resource.before())) + .map(value -> variable.getKey().endsWith(WITHOUT_LEADING_SLASH) + ? asVariable(variable.getKey(), value) + : withoutTypePath(value, resource.types().getFirst())) .toList(); if (values.isEmpty()) { continue; @@ -543,13 +548,14 @@ public final class RequestResources { for (Filling filling : fillings) { AwsArnUtils.Arn from = filling.from(); if (from == null) { - arns.add(withId(render(format.format(), filling.variables(), partition, region, account), format, + arns.add(withId(format.checked(render(format.format(), filling.variables(), partition, region, + account)), format, resource.types().getFirst(), filling.variables(), account.equals(accountId) ? stored : null, region)); } else { - addNamed(arns, withId(render(format.format(), filling.variables(), from.partition(), + addNamed(arns, withId(format.checked(render(format.format(), filling.variables(), from.partition(), from.region().isEmpty() ? region : from.region(), - from.accountId().isEmpty() ? accountId : from.accountId()), format, + from.accountId().isEmpty() ? accountId : from.accountId())), format, resource.types().getFirst(), filling.variables(), null, region), format.awsOwned(), partition, region, accountId, null); } @@ -557,11 +563,17 @@ public final class RequestResources { } /** - * The value as the variable takes it: without the leading {@code /} a variable named for leaving it out drops, - * as an SSM parameter's ARN names {@code /team/x} as {@code parameter/team/x}. + * The value as the variable takes it: a variable named for leaving out the leading {@code /} takes a Parameter + * Store name without the whitespace around it, which a put drops, and without one leading {@code /}, as an SSM + * parameter's ARN names {@code /team/x} as {@code parameter/team/x}. A name of two leading slashes keeps the + * second, and a name beginning {@code /parameter/} keeps that, being no type path. */ static String asVariable(String variable, String value) { - return variable.endsWith("WithoutLeadingSlash") && value.startsWith("/") ? value.substring(1) : value; + if (!variable.endsWith(WITHOUT_LEADING_SLASH)) { + return value; + } + String name = value.strip(); + return name.startsWith("/") ? name.substring(1) : name; } /** The value without a leading {@code //}, the path a service may return an id of that type under. */ diff --git a/src/main/java/io/floci/aws/services/iam/ResourceArnBuilder.java b/src/main/java/io/floci/aws/services/iam/ResourceArnBuilder.java index e8463d4494..3f8c5ddcd0 100644 --- a/src/main/java/io/floci/aws/services/iam/ResourceArnBuilder.java +++ b/src/main/java/io/floci/aws/services/iam/ResourceArnBuilder.java @@ -89,10 +89,6 @@ public class ResourceArnBuilder { /** The route of Bedrock's resource-policy actions, which the ARN of the resource they act on may follow. */ private static final String BEDROCK_RESOURCE_POLICY_ROUTE = "/resource-policy"; - /** The SSM actions whose {@code ResourceArn} names the parameter they act on, in place of {@code Name}. */ - private static final Set SSM_RESOURCE_POLICY_ACTIONS = - Set.of("PutResourcePolicy", "GetResourcePolicies", "DeleteResourcePolicy"); - private final ObjectMapper objectMapper; /** * Looked up lazily through a provider: this builder is constructed by the enforcement filter, @@ -232,7 +228,6 @@ public class ResourceArnBuilder { case "sns" -> List.of(buildSnsArn(ctx, region, accountId)); case "dynamodb" -> buildDynamoDbArns(ctx, region, accountId); case "kinesis" -> List.of(buildKinesisArn(ctx, region, accountId)); - case "ssm" -> List.of(buildSsmArn(ctx, region, accountId)); case "iam" -> buildIamArns(ctx, region, accountId); case "resource-groups" -> List.of(buildResourceGroupArn(ctx, region, accountId)); case "scheduler" -> List.of(buildSchedulerArn(path, ctx, region, accountId, partition)); @@ -1890,32 +1885,6 @@ public class ResourceArnBuilder { return new AwsArnUtils.Arn(partition, "secretsmanager", region, accountId, "secret:" + name).toString(); } - // ── SSM ────────────────────────────────────────────────────────────────────── - private String buildSsmArn(ContainerRequestContext ctx, String region, String accountId) { - JsonNode json = readJsonBody(ctx); - if (json != null && json.isObject()) { - String operation = IamActionRegistry.targetOperation(ctx); - if (operation != null && SSM_RESOURCE_POLICY_ACTIONS.contains(operation) - && json.hasNonNull("ResourceArn")) { - String resourceArn = json.get("ResourceArn").asText().trim(); - if (AwsArnUtils.isArnFor(resourceArn, "ssm")) { - return resourceArn; - } - } - if (json.hasNonNull("Name")) { - String name = json.get("Name").asText().trim(); - if (!name.isEmpty()) { - if (AwsArnUtils.isArnFor(name, "ssm")) { - return name; - } - String paramResource = name.startsWith("/") ? "parameter" + name : "parameter/" + name; - return AwsArnUtils.Arn.of("ssm", region, accountId, paramResource).toString(); - } - } - } - return AwsArnUtils.Arn.of("ssm", region, accountId, "parameter/*").toString(); - } - // ── KMS ────────────────────────────────────────────────────────────────────── /** diff --git a/src/main/java/io/floci/aws/services/ssm/SsmJsonHandler.java b/src/main/java/io/floci/aws/services/ssm/SsmJsonHandler.java index f12b18247b..51c60ce873 100644 --- a/src/main/java/io/floci/aws/services/ssm/SsmJsonHandler.java +++ b/src/main/java/io/floci/aws/services/ssm/SsmJsonHandler.java @@ -236,6 +236,9 @@ public class SsmJsonHandler { } private Response handleGetParametersByPath(JsonNode request, String region) { + if (!request.path("Path").isTextual()) { + throw SmithyValidationErrors.validationException(SmithyValidationErrors.notNull("path")); + } PageRequest pageRequest = pageRequest(request, GET_PARAMETERS_BY_PATH_MAX_RESULTS); String path = request.path("Path").asText(); boolean recursive = request.path("Recursive").asBoolean(false); @@ -1202,12 +1205,14 @@ public class SsmJsonHandler { } private Response handleAddTagsToResource(JsonNode request, String region) { + requireTaggedResourceType(request); ssmService.addTagsToResource(request.path("ResourceType").asText(), request.path("ResourceId").asText(), requestTags(request), region); return Response.ok(objectMapper.createObjectNode()).build(); } private Response handleListTagsForResource(JsonNode request, String region) { + requireTaggedResourceType(request); Map tags = ssmService.listTagsForResource(request.path("ResourceType").asText(), request.path("ResourceId").asText(), region); ObjectNode response = objectMapper.createObjectNode(); @@ -1216,6 +1221,7 @@ public class SsmJsonHandler { } private Response handleRemoveTagsFromResource(JsonNode request, String region) { + requireTaggedResourceType(request); List tagKeys = new ArrayList<>(); request.path("TagKeys").forEach(k -> tagKeys.add(k.asText())); ssmService.removeTagsFromResource(request.path("ResourceType").asText(), request.path("ResourceId").asText(), @@ -1236,6 +1242,29 @@ public class SsmJsonHandler { return list; } + /** + * Refuses a tagging request whose {@code ResourceType} is missing, outside the model's enum, or a type whose tags + * this service does not keep, so the request acts on the type IAM checked. + */ + private static void requireTaggedResourceType(JsonNode request) { + JsonNode resourceType = request.path("ResourceType"); + if (!resourceType.isTextual()) { + throw SmithyValidationErrors.validationException(SmithyValidationErrors.notNull("resourceType")); + } + if (!RESOURCE_TYPES_FOR_TAGGING.contains(resourceType.asText())) { + throw SmithyValidationErrors.validationException(SmithyValidationErrors.notInEnum(resourceType.asText(), + "resourceType", RESOURCE_TYPES_FOR_TAGGING)); + } + if (!TAGGED_RESOURCE_TYPES.contains(resourceType.asText())) { + throw new AwsException("InvalidResourceType", "The resource type isn't valid.", 400); + } + } + + private static final List RESOURCE_TYPES_FOR_TAGGING = List.of("Document", "ManagedInstance", + "MaintenanceWindow", "Parameter", "PatchBaseline", "OpsItem", "OpsMetadata", "Automation", "Association", + "CloudConnector"); + private static final Set TAGGED_RESOURCE_TYPES = Set.of("Parameter", "Document", "Association"); + private static final int GET_RESOURCE_POLICIES_MAX_RESULTS = 50; private static final String GET_RESOURCE_POLICIES_TOKEN = "GetResourcePolicies:"; private static final String POLICY_PATTERN = "^(?!\\s*$).+"; diff --git a/src/main/java/io/floci/aws/services/ssm/SsmService.java b/src/main/java/io/floci/aws/services/ssm/SsmService.java index 2c06c28cc3..cc861e2d7b 100644 --- a/src/main/java/io/floci/aws/services/ssm/SsmService.java +++ b/src/main/java/io/floci/aws/services/ssm/SsmService.java @@ -15,6 +15,7 @@ import io.floci.aws.core.common.DeadlineCharSequence; import io.floci.aws.core.common.Digests; import io.floci.aws.core.common.RegionResolver; import io.floci.aws.core.common.SmithyValidationErrors; +import io.floci.aws.core.common.StoredResourceArns; import io.floci.aws.core.resource.ExplorerResource; import io.floci.aws.core.resource.ResourceProvider; import io.floci.aws.core.resource.SupportedResourceType; @@ -51,7 +52,7 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @ApplicationScoped -public class SsmService implements ResourceProvider { +public class SsmService implements ResourceProvider, StoredResourceArns { private static final Logger LOG = Logger.getLogger(SsmService.class); @@ -1123,7 +1124,7 @@ public class SsmService implements ResourceProvider { /** * {@code AddTagsToResource} on the resource of {@code resourceType}: a document by its name, an - * association by its ID, and a parameter, or any type Floci does not tag yet, as before. + * association by its ID, and a parameter by its name or ARN. */ public synchronized void addTagsToResource(String resourceType, String resourceId, Map tags, String region) { @@ -2023,4 +2024,25 @@ public class SsmService implements ResourceProvider { public Set getSupportedResourceTypes() { return Set.of(new SupportedResourceType("ssm:parameter", "ssm", true)); } + + @Override + public String namespace() { + return "ssm"; + } + + /** + * The {@code parameter/} ARN a legacy {@code parameter} ARN of the caller's partition, Region and + * account names, which the tagging operations act on as {@link #parameterTagName} reads it; empty for any other + * value, whose ARN is the one its name renders. + */ + @Override + public Optional find(String type, List names, String region) { + if (!"parameter".equals(type) || names.size() != 1) { + return Optional.empty(); + } + String name = names.getFirst(); + String arn = withLegacyParameterSlash(name, regionResolver.partitionForRegion(region), region, + regionResolver.getAccountId()); + return arn == null || arn.equals(name) ? Optional.empty() : Optional.of(arn); + } } diff --git a/src/main/resources/aws/iam-request-resources.json b/src/main/resources/aws/iam-request-resources.json index 36c2c01567..bbd4bf15a6 100644 --- a/src/main/resources/aws/iam-request-resources.json +++ b/src/main/resources/aws/iam-request-resources.json @@ -2,12 +2,12 @@ "_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-13", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."}, "namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "guardduty": ["guardduty"], "inspector2": ["inspector2"], "kinesisanalytics": ["kinesisanalyticsv2"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "ram": ["ram"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "route53": ["route53"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]}, "clientsNotRead": {"kinesisanalytics": "Kinesis Data Analytics v1, SQL applications on the KinesisAnalytics_20150814 target, which Floci does not serve (it serves v2, kinesisanalyticsv2); its operations share v2's names and name their resources by other members"}, - "handBuilt": ["apigateway", "bedrock", "dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "lambda", "logs", "pipes", "resource-groups", "s3", "scheduler", "secretsmanager", "sns", "sqs", "ssm", "sts"], + "handBuilt": ["apigateway", "bedrock", "dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "lambda", "logs", "pipes", "resource-groups", "s3", "scheduler", "secretsmanager", "sns", "sqs", "sts"], "notCovered": {"airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "aps": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup::autoScalingGroupName/`, while Floci mints `autoScalingGroup:`, which other services (ECS capacity providers) read back; the mint is fixed first", "aws-marketplace": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "backup": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "batch": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rule does not fill a name from, so nearly every operation needs a correction", "cloudwatch": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/_, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "comprehend": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "config": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dlm": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2-instance-connect": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ecs": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticache": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment//`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "execute-api": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "glue": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "identitystore": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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 reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "lightsail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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 reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "network-firewall": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "organizations": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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 reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model 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 reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "s3tables": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "s3vectors": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "sagemaker": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "servicecatalog": "not read yet: CreatePortfolioShare, UpdatePortfolioShare and DeletePortfolioShare give in AccountId the account a portfolio is shared with, which the rule reads as the portfolio's; a portfolio or product imported from another account keeps its owner's account in its ARN while requests name it by its id alone; and AppRegistry's applications and attribute groups are named in the path", "ses": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "signin": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "sso-oauth": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "swf": "not read yet: the Service Reference gives a domain's ARN no Region, `swf:::/domain/`, while the SWF Developer Guide gives it as arn:aws:swf:Region:AccountID:/domain/DomainName, as Floci mints it; reading it needs that format corrected", "transcribe": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "transfer": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "verifiedpermissions": "not read yet: a policyStoreId may name its store by an alias, `policy-store-alias/`, which AWS authorizes as the action on the store the alias points to and GetPolicyStoreAlias on the alias, and an aliasName carries the `policy-store-alias/` its format already gives; reading it needs both", "wafv2": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint"}, "otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "appfabric", "appflow", "application-signals", "application-signals-mcp", "appmesh", "appmesh-preview", "apprunner", "appstream", "apptest", "arc-region-switch", "arc-zonal-shift", "artifact", "assurance", "auditmanager", "aws-external-anthropic", "b2bi", "backup-gateway", "backup-search", "bedrock-mantle", "bedrock-websearch", "billing", "billingconductor", "braket", "bugbust", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "clouddirectory", "cloudsearch", "cloudshell", "cloudtrail-data", "codecatalyst", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "codewhisperer", "cognito-sync", "connect-campaigns", "consoleapp", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "devops-guru", "directconnect", "docdb-elastic", "drs", "ds", "ds-data", "ebs", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "emr-containers", "end-user-messaging", "entityresolution", "evs", "finspace", "finspace-api", "fms", "forecast", "frauddetector", "freertos", "fsx", "gamelift", "gameliftstreams", "geo", "geo-maps", "geo-places", "geo-routes", "glacier", "grafana", "greengrass", "groundstation", "health", "health-agent", "healthlake", "honeycode", "identity-sync", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotanalytics", "iotdeviceadvisor", "iotfleethub", "iotfleetwise", "iotjobsdata", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "iq", "iq-permission", "ivs", "ivschat", "kafka-cluster", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "lookoutmetrics", "lookoutvision", "m2", "machinelearning", "managedblockchain", "mapcredits", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgh", "mgn", "migrationhub-orchestrator", "mobiletargeting", "monitron", "mpa", "neptune-db", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "nimble", "notifications", "notifications-contacts", "nova-act", "observabilityadmin", "odb", "omics", "one", "opensearch", "opsworks", "osis", "outposts", "panorama", "partnercentral", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "rbin", "rds-db", "refactor-spaces", "repostspace", "resiliencehub", "robomaker", "rolesanywhere", "route53-recovery-cluster", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3-object-lambda", "s3-outposts", "s3express", "s3files", "sagemaker-geospatial", "sagemaker-mlflow", "savingsplans", "schemas", "scn", "sdb", "security-ir", "securityagent", "securitylake", "serverlessrepo", "shield", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "ssmmessages", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "tnb", "transform", "transform-custom", "trustedadvisor", "ts", "vendor-insights", "voiceid", "vpc-lattice", "vpc-lattice-svcs", "vpce", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workdocs", "worklink", "workmail", "workmailmessageflow", "workspaces", "workspaces-instances", "workspaces-web"], "arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudfront": {"anycast-ip-list": "arn:${Partition}:cloudfront::${Account}:anycast-ip-list/${Id}", "cache-policy": "arn:${Partition}:cloudfront::${Account}:cache-policy/${Id}", "connection-function": "arn:${Partition}:cloudfront::${Account}:connection-function/${Id}", "connection-group": "arn:${Partition}:cloudfront::${Account}:connection-group/${Id}", "continuous-deployment-policy": "arn:${Partition}:cloudfront::${Account}:continuous-deployment-policy/${Id}", "distribution": "arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}", "distribution-tenant": "arn:${Partition}:cloudfront::${Account}:distribution-tenant/${Id}", "field-level-encryption-config": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-config/${Id}", "field-level-encryption-profile": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-profile/${Id}", "function": "arn:${Partition}:cloudfront::${Account}:function/${Name}", "key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${Name}", "origin-access-control": "arn:${Partition}:cloudfront::${Account}:origin-access-control/${Id}", "origin-access-identity": "arn:${Partition}:cloudfront::${Account}:origin-access-identity/${Id}", "origin-request-policy": "arn:${Partition}:cloudfront::${Account}:origin-request-policy/${Id}", "realtime-log-config": "arn:${Partition}:cloudfront::${Account}:realtime-log-config/${Name}", "response-headers-policy": "arn:${Partition}:cloudfront::${Account}:response-headers-policy/${Id}", "streaming-distribution": "arn:${Partition}:cloudfront::${Account}:streaming-distribution/${DistributionId}", "trust-store": "arn:${Partition}:cloudfront::${Account}:trust-store/${Id}", "vpcorigin": "arn:${Partition}:cloudfront::${Account}:vpcorigin/${Id}"}, "cloudfront-keyvaluestore": {"key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${ResourceId}"}, "cloudtrail": {"channel": "arn:${Partition}:cloudtrail:${Region}:${Account}:channel/${ChannelId}", "dashboard": "arn:${Partition}:cloudtrail:${Region}:${Account}:dashboard/${DashboardName}", "eventdatastore": "arn:${Partition}:cloudtrail:${Region}:${Account}:eventdatastore/${EventDataStoreId}", "trail": "arn:${Partition}:cloudtrail:${Region}:${Account}:trail/${TrailName}"}, "codebuild": {"build": "arn:${Partition}:codebuild:${Region}:${Account}:build/${BuildId}", "build-batch": "arn:${Partition}:codebuild:${Region}:${Account}:build-batch/${BuildBatchId}", "fleet": "arn:${Partition}:codebuild:${Region}:${Account}:fleet/${FleetName}:${FleetId}", "project": "arn:${Partition}:codebuild:${Region}:${Account}:project/${ProjectName}", "report": "arn:${Partition}:codebuild:${Region}:${Account}:report/${ReportGroupName}:${ReportId}", "report-group": "arn:${Partition}:codebuild:${Region}:${Account}:report-group/${ReportGroupName}", "sandbox": "arn:${Partition}:codebuild:${Region}:${Account}:sandbox/${SandboxId}"}, "codepipeline": {"action": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}/${ActionName}", "actiontype": "arn:${Partition}:codepipeline:${Region}:${Account}:actiontype:${Owner}/${Category}/${Provider}/${Version}", "pipeline": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}", "stage": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}", "webhook": "arn:${Partition}:codepipeline:${Region}:${Account}:webhook:${WebhookName}"}, "cognito-identity": {"identitypool": "arn:${Partition}:cognito-identity:${Region}:${Account}:identitypool/${IdentityPoolId}"}, "cognito-idp": {"userpool": "arn:${Partition}:cognito-idp:${Region}:${Account}:userpool/${UserPoolId}", "webacl": "arn:${Partition}:wafv2:${Region}:${Account}:${Scope}/webacl/${Name}/${Id}"}, "controlcatalog": {"common-control": "arn:${Partition}:controlcatalog:::common-control/${CommonControlId}", "control": "arn:${Partition}:controlcatalog:::control/${ControlId}", "domain": "arn:${Partition}:controlcatalog:::domain/${DomainId}", "objective": "arn:${Partition}:controlcatalog:::objective/${ObjectiveId}"}, "controltower": {"Baseline": "arn:${Partition}:controltower:${Region}::baseline/${BaselineId}", "EnabledBaseline": "arn:${Partition}:controltower:${Region}:${Account}:enabledbaseline/${EnabledBaselineId}", "EnabledControl": "arn:${Partition}:controltower:${Region}:${Account}:enabledcontrol/${EnabledControlId}", "LandingZone": "arn:${Partition}:controltower:${Region}:${Account}:landingzone/${LandingZoneId}"}, "cur": {"cur": "arn:${Partition}:cur:${Region}:${Account}:definition/${ReportName}"}, "datasync": {"agent": "arn:${Partition}:datasync:${Region}:${Account}:agent/${AgentId}", "discoveryjob": "arn:${Partition}:datasync:${Region}:${Account}:system/${StorageSystemId}/job/${DiscoveryJobId}", "location": "arn:${Partition}:datasync:${Region}:${Account}:location/${LocationId}", "storagesystem": "arn:${Partition}:datasync:${Region}:${Account}:system/${StorageSystemId}", "task": "arn:${Partition}:datasync:${Region}:${Account}:task/${TaskId}", "taskexecution": "arn:${Partition}:datasync:${Region}:${Account}:task/${TaskId}/execution/${ExecutionId}"}, "dynamodb": {"backup": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/backup/${BackupName}", "bulk-operation": "arn:${Partition}:dynamodb:${Region}:${Account}:bulk-operation/${BulkOperationId}", "export": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/export/${ExportName}", "global-table": "arn:${Partition}:dynamodb::${Account}:global-table/${GlobalTableName}", "import": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/import/${ImportName}", "index": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/index/${IndexName}", "stream": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/stream/${StreamLabel}", "table": "arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}"}, "ec2": {"application-status-check": "arn:${Partition}:ec2:${Region}:${Account}:application-status-check/${ApplicationStatusCheckId}", "capacity-block": "arn:${Partition}:ec2:${Region}:${Account}:capacity-block/${CapacityBlockId}", "capacity-manager-data-export": "arn:${Partition}:ec2:${Region}:${Account}:capacity-manager-data-export/${CapacityManagerDataExportId}", "capacity-reservation": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation/${CapacityReservationId}", "capacity-reservation-cancellation-quote": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-cancellation-quote/${CapacityReservationCancellationQuoteId}", "capacity-reservation-fleet": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-fleet/${CapacityReservationFleetId}", "capacity-reservation-modification-quote": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-modification-quote/${CapacityReservationModificationQuoteId}", "carrier-gateway": "arn:${Partition}:ec2:${Region}:${Account}:carrier-gateway/${CarrierGatewayId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}", "client-vpn-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:client-vpn-endpoint/${ClientVpnEndpointId}", "coip-pool": "arn:${Partition}:ec2:${Region}:${Account}:coip-pool/${Ipv4PoolCoipId}", "customer-gateway": "arn:${Partition}:ec2:${Region}:${Account}:customer-gateway/${CustomerGatewayId}", "declarative-policies-report": "arn:${Partition}:ec2:${Region}:${Account}:declarative-policies-report/${DeclarativePoliciesReportId}", "dedicated-host": "arn:${Partition}:ec2:${Region}:${Account}:dedicated-host/${DedicatedHostId}", "dhcp-options": "arn:${Partition}:ec2:${Region}:${Account}:dhcp-options/${DhcpOptionsId}", "egress-only-internet-gateway": "arn:${Partition}:ec2:${Region}:${Account}:egress-only-internet-gateway/${EgressOnlyInternetGatewayId}", "elastic-gpu": "arn:${Partition}:ec2:${Region}:${Account}:elastic-gpu/${ElasticGpuId}", "elastic-inference": "arn:${Partition}:elastic-inference:${Region}:${Account}:elastic-inference-accelerator/${AcceleratorId}", "elastic-ip": "arn:${Partition}:ec2:${Region}:${Account}:elastic-ip/${AllocationId}", "export-image-task": "arn:${Partition}:ec2:${Region}:${Account}:export-image-task/${ExportImageTaskId}", "export-instance-task": "arn:${Partition}:ec2:${Region}:${Account}:export-instance-task/${ExportTaskId}", "fleet": "arn:${Partition}:ec2:${Region}:${Account}:fleet/${FleetId}", "fpga-image": "arn:${Partition}:ec2:${Region}:${Account}:fpga-image/${FpgaImageId}", "group": "arn:${Partition}:resource-groups:${Region}:${Account}:group/${GroupName}", "host-reservation": "arn:${Partition}:ec2:${Region}:${Account}:host-reservation/${HostReservationId}", "image": "arn:${Partition}:ec2:${Region}::image/${ImageId}", "image-usage-report": "arn:${Partition}:ec2:${Region}:${Account}:image-usage-report/${ImageUsageReportId}", "import-image-task": "arn:${Partition}:ec2:${Region}:${Account}:import-image-task/${ImportImageTaskId}", "import-snapshot-task": "arn:${Partition}:ec2:${Region}:${Account}:import-snapshot-task/${ImportSnapshotTaskId}", "instance": "arn:${Partition}:ec2:${Region}:${Account}:instance/${InstanceId}", "instance-connect-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:instance-connect-endpoint/${InstanceConnectEndpointId}", "instance-event-window": "arn:${Partition}:ec2:${Region}:${Account}:instance-event-window/${InstanceEventWindowId}", "internet-gateway": "arn:${Partition}:ec2:${Region}:${Account}:internet-gateway/${InternetGatewayId}", "ipam": "arn:${Partition}:ec2::${Account}:ipam/${IpamId}", "ipam-external-resource-verification-token": "arn:${Partition}:ec2::${Account}:ipam-external-resource-verification-token/${IpamExternalResourceVerificationTokenId}", "ipam-internet-registry-association": "arn:${Partition}:ec2::${Account}:ipam-internet-registry-association/${IpamInternetRegistryAssociationId}", "ipam-policy": "arn:${Partition}:ec2::${Account}:ipam-policy/${IpamPolicyId}", "ipam-pool": "arn:${Partition}:ec2::${Account}:ipam-pool/${IpamPoolId}", "ipam-pool-allocation": "arn:${Partition}:ec2:${Region}:${Account}:ipam-pool-allocation/${IpamPoolAllocationId}", "ipam-prefix-list-resolver": "arn:${Partition}:ec2::${Account}:ipam-prefix-list-resolver/${IpamPrefixListResolverId}", "ipam-prefix-list-resolver-target": "arn:${Partition}:ec2::${Account}:ipam-prefix-list-resolver-target/${IpamPrefixListResolverTargetId}", "ipam-resource-discovery": "arn:${Partition}:ec2::${Account}:ipam-resource-discovery/${IpamResourceDiscoveryId}", "ipam-resource-discovery-association": "arn:${Partition}:ec2::${Account}:ipam-resource-discovery-association/${IpamResourceDiscoveryAssociationId}", "ipam-scope": "arn:${Partition}:ec2::${Account}:ipam-scope/${IpamScopeId}", "ipv4pool-ec2": "arn:${Partition}:ec2:${Region}:${Account}:ipv4pool-ec2/${Ipv4PoolEc2Id}", "ipv6pool-ec2": "arn:${Partition}:ec2:${Region}:${Account}:ipv6pool-ec2/${Ipv6PoolEc2Id}", "key-pair": "arn:${Partition}:ec2:${Region}:${Account}:key-pair/${KeyPairName}", "launch-template": "arn:${Partition}:ec2:${Region}:${Account}:launch-template/${LaunchTemplateId}", "license-configuration": "arn:${Partition}:license-manager:${Region}:${Account}:license-configuration:${LicenseConfigurationId}", "local-gateway": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway/${LocalGatewayId}", "local-gateway-route-table": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table/${LocalGatewayRoutetableId}", "local-gateway-route-table-virtual-interface-group-association": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table-virtual-interface-group-association/${LocalGatewayRouteTableVirtualInterfaceGroupAssociationId}", "local-gateway-route-table-vpc-association": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table-vpc-association/${LocalGatewayRouteTableVpcAssociationId}", "local-gateway-virtual-interface": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-virtual-interface/${LocalGatewayVirtualInterfaceId}", "local-gateway-virtual-interface-group": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-virtual-interface-group/${LocalGatewayVirtualInterfaceGroupId}", "mac-modification-task": "arn:${Partition}:ec2:${Region}:${Account}:mac-modification-task/${MacModificationTaskId}", "natgateway": "arn:${Partition}:ec2:${Region}:${Account}:natgateway/${NatGatewayId}", "network-acl": "arn:${Partition}:ec2:${Region}:${Account}:network-acl/${NaclId}", "network-insights-access-scope": "arn:${Partition}:ec2:${Region}:${Account}:network-insights-access-scope/${NetworkInsightsAccessScopeId}", "network-insights-access-scope-analysis": "arn:${Partition}:ec2:${Region}:${Account}:network-insights-access-scope-analysis/${NetworkInsightsAccessScopeAnalysisId}", "network-insights-analysis": "arn:${Partition}:ec2:${Region}:${Account}:network-insights-analysis/${NetworkInsightsAnalysisId}", "network-insights-path": "arn:${Partition}:ec2:${Region}:${Account}:network-insights-path/${NetworkInsightsPathId}", "network-interface": "arn:${Partition}:ec2:${Region}:${Account}:network-interface/${NetworkInterfaceId}", "outpost-lag": "arn:${Partition}:ec2:${Region}:${Account}:outpost-lag/${OutpostLagId}", "placement-group": "arn:${Partition}:ec2:${Region}:${Account}:placement-group/${PlacementGroupName}", "prefix-list": "arn:${Partition}:ec2:${Region}:${Account}:prefix-list/${PrefixListId}", "replace-root-volume-task": "arn:${Partition}:ec2:${Region}:${Account}:replace-root-volume-task/${ReplaceRootVolumeTaskId}", "reserved-instances": "arn:${Partition}:ec2:${Region}:${Account}:reserved-instances/${ReservationId}", "role": "arn:${Partition}:iam::${Account}:role/${RoleNameWithPath}", "route-server": "arn:${Partition}:ec2:${Region}:${Account}:route-server/${RouteServerId}", "route-server-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:route-server-endpoint/${RouteServerEndpointId}", "route-server-peer": "arn:${Partition}:ec2:${Region}:${Account}:route-server-peer/${RouteServerPeerId}", "route-table": "arn:${Partition}:ec2:${Region}:${Account}:route-table/${RouteTableId}", "secondary-interface": "arn:${Partition}:ec2:${Region}:${Account}:secondary-interface/${SecondaryInterfaceId}", "secondary-network": "arn:${Partition}:ec2:${Region}:${Account}:secondary-network/${SecondaryNetworkId}", "secondary-subnet": "arn:${Partition}:ec2:${Region}:${Account}:secondary-subnet/${SecondarySubnetId}", "security-group": "arn:${Partition}:ec2:${Region}:${Account}:security-group/${SecurityGroupId}", "security-group-rule": "arn:${Partition}:ec2:${Region}:${Account}:security-group-rule/${SecurityGroupRuleId}", "snapshot": "arn:${Partition}:ec2:${Region}::snapshot/${SnapshotId}", "spot-fleet-request": "arn:${Partition}:ec2:${Region}:${Account}:spot-fleet-request/${SpotFleetRequestId}", "spot-instances-request": "arn:${Partition}:ec2:${Region}:${Account}:spot-instances-request/${SpotInstanceRequestId}", "subnet": "arn:${Partition}:ec2:${Region}:${Account}:subnet/${SubnetId}", "subnet-cidr-reservation": "arn:${Partition}:ec2:${Region}:${Account}:subnet-cidr-reservation/${SubnetCidrReservationId}", "traffic-mirror-filter": "arn:${Partition}:ec2:${Region}:${Account}:traffic-mirror-filter/${TrafficMirrorFilterId}", "traffic-mirror-filter-rule": "arn:${Partition}:ec2:${Region}:${Account}:traffic-mirror-filter-rule/${TrafficMirrorFilterRuleId}", "traffic-mirror-session": "arn:${Partition}:ec2:${Region}:${Account}:traffic-mirror-session/${TrafficMirrorSessionId}", "traffic-mirror-target": "arn:${Partition}:ec2:${Region}:${Account}:traffic-mirror-target/${TrafficMirrorTargetId}", "transit-gateway": "arn:${Partition}:ec2:${Region}:${Account}:transit-gateway/${TransitGatewayId}", "transit-gateway-attachment": "arn:${Partition}:ec2:${Region}:${Account}:transit-gateway-attachment/${TransitGatewayAttachmentId}", "transit-gateway-connect-peer": "arn:${Partition}:ec2:${Region}:${Account}:transit-gateway-connect-peer/${TransitGatewayConnectPeerId}", "transit-gateway-metering-policy": "arn:${Partition}:ec2:${Region}:${Account}:transit-gateway-metering-policy/${TransitGatewayMeteringPolicyId}", "transit-gateway-multicast-domain": "arn:${Partition}:ec2:${Region}:${Account}:transit-gateway-multicast-domain/${TransitGatewayMulticastDomainId}", "transit-gateway-policy-table": "arn:${Partition}:ec2:${Region}:${Account}:transit-gateway-policy-table/${TransitGatewayPolicyTableId}", "transit-gateway-route-table": "arn:${Partition}:ec2:${Region}:${Account}:transit-gateway-route-table/${TransitGatewayRouteTableId}", "transit-gateway-route-table-announcement": "arn:${Partition}:ec2:${Region}:${Account}:transit-gateway-route-table-announcement/${TransitGatewayRouteTableAnnouncementId}", "verified-access-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:verified-access-endpoint/${VerifiedAccessEndpointId}", "verified-access-endpoint-target": "arn:${Partition}:ec2:${Region}:${Account}:verified-access-endpoint-target/${VerifiedAccessEndpointTargetId}", "verified-access-group": "arn:${Partition}:ec2:${Region}:${Account}:verified-access-group/${VerifiedAccessGroupId}", "verified-access-instance": "arn:${Partition}:ec2:${Region}:${Account}:verified-access-instance/${VerifiedAccessInstanceId}", "verified-access-policy": "arn:${Partition}:ec2:${Region}:${Account}:verified-access-policy/${VerifiedAccessPolicyId}", "verified-access-trust-provider": "arn:${Partition}:ec2:${Region}:${Account}:verified-access-trust-provider/${VerifiedAccessTrustProviderId}", "volume": "arn:${Partition}:ec2:${Region}:${Account}:volume/${VolumeId}", "vpc": "arn:${Partition}:ec2:${Region}:${Account}:vpc/${VpcId}", "vpc-block-public-access-exclusion": "arn:${Partition}:ec2:${Region}:${Account}:vpc-block-public-access-exclusion/${VpcBlockPublicAccessExclusionId}", "vpc-encryption-control": "arn:${Partition}:ec2:${Region}:${Account}:vpc-encryption-control/${VpcEncryptionControlId}", "vpc-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:vpc-endpoint/${VpcEndpointId}", "vpc-endpoint-connection": "arn:${Partition}:ec2:${Region}:${Account}:vpc-endpoint-connection/${VpcEndpointConnectionId}", "vpc-endpoint-service": "arn:${Partition}:ec2:${Region}:${Account}:vpc-endpoint-service/${VpcEndpointServiceId}", "vpc-endpoint-service-permission": "arn:${Partition}:ec2:${Region}:${Account}:vpc-endpoint-service-permission/${VpcEndpointServicePermissionId}", "vpc-flow-log": "arn:${Partition}:ec2:${Region}:${Account}:vpc-flow-log/${VpcFlowLogId}", "vpc-peering-connection": "arn:${Partition}:ec2:${Region}:${Account}:vpc-peering-connection/${VpcPeeringConnectionId}", "vpn-concentrator": "arn:${Partition}:ec2:${Region}:${Account}:vpn-concentrator/${VpnConcentratorId}", "vpn-connection": "arn:${Partition}:ec2:${Region}:${Account}:vpn-connection/${VpnConnectionId}", "vpn-connection-device-type": "arn:${Partition}:ec2:${Region}:${Account}:vpn-connection-device-type/${VpnConnectionDeviceTypeId}", "vpn-gateway": "arn:${Partition}:ec2:${Region}:${Account}:vpn-gateway/${VpnGatewayId}"}, "ecr": {"repository": "arn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName}"}, "elasticloadbalancing": {"listener-rule/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener-rule/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/gwy": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/gwy/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "loadbalancer": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/${LoadBalancerName}", "loadbalancer/app/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/gwy/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/gwy/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/net/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/net/${LoadBalancerName}/${LoadBalancerId}", "targetgroup": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:targetgroup/${TargetGroupName}/${TargetGroupId}", "truststore": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:truststore/${TrustStoreName}/${TrustStoreId}"}, "elasticmapreduce": {"cluster": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:cluster/${ClusterId}", "editor": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:editor/${EditorId}", "notebook-execution": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:notebook-execution/${NotebookExecutionId}", "session": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:cluster/${ClusterId}/session/${SessionId}", "studio": "arn:${Partition}:elasticmapreduce:${Region}:${Account}:studio/${StudioId}"}, "emr-serverless": {"application": "arn:${Partition}:emr-serverless:${Region}:${Account}:/applications/${ApplicationId}", "jobRun": "arn:${Partition}:emr-serverless:${Region}:${Account}:/applications/${ApplicationId}/jobruns/${JobRunId}", "session": "arn:${Partition}:emr-serverless:${Region}:${Account}:/applications/${ApplicationId}/sessions/${SessionId}"}, "es": {"application": "arn:${Partition}:opensearch:${Region}:${Account}:application/${AppId}", "datasource": "arn:${Partition}:opensearch:${Region}:${Account}:datasource/${DataSourceName}", "domain": "arn:${Partition}:es:${Region}:${Account}:domain/${DomainName}", "es_role": "arn:${Partition}:iam::${Account}:role/aws-service-role/es.amazonaws.com/AWSServiceRoleForAmazonOpenSearchService", "opensearchservice_role": "arn:${Partition}:iam::${Account}:role/aws-service-role/opensearchservice.amazonaws.com/AWSServiceRoleForAmazonOpenSearchService"}, "events": {"alias": "arn:${Partition}:kms:${Region}:${Account}:alias/${Alias}", "api-destination": "arn:${Partition}:events:${Region}:${Account}:api-destination/${ApiDestinationName}", "archive": "arn:${Partition}:events:${Region}:${Account}:archive/${ArchiveName}", "connection": "arn:${Partition}:events:${Region}:${Account}:connection/${ConnectionName}", "create-snapshot": "arn:${Partition}:events:${Region}:${Account}:target/create-snapshot", "endpoint": "arn:${Partition}:events:${Region}:${Account}:endpoint/${EndpointName}", "event-bus": "arn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName}", "event-busv2": "arn:${Partition}:events:${Region}:${Account}:event-busv2/${EventBusName}/${OpaqueId}", "event-source": "arn:${Partition}:events:${Region}::event-source/${EventSourceName}", "event-sourcev2": "arn:${Partition}:events:${Region}:${Account}:event-sourcev2/${SourceType}/${EventSourceName}/${OpaqueId}", "key": "arn:${Partition}:kms:${Region}:${Account}:key/${KeyId}", "reboot-instance": "arn:${Partition}:events:${Region}:${Account}:target/reboot-instance", "replay": "arn:${Partition}:events:${Region}:${Account}:replay/${ReplayName}", "rule-on-custom-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName}", "rule-on-default-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${RuleName}", "stop-instance": "arn:${Partition}:events:${Region}:${Account}:target/stop-instance", "subscriber": "arn:${Partition}:events:${Region}:${Account}:subscriber/${SubscriberName}/${OpaqueId}", "terminate-instance": "arn:${Partition}:events:${Region}:${Account}:target/terminate-instance"}, "firehose": {"deliverystream": "arn:${Partition}:firehose:${Region}:${Account}:deliverystream/${DeliveryStreamName}"}, "fis": {"action": "arn:${Partition}:fis:${Region}:${Account}:action/${Id}", "experiment": "arn:${Partition}:fis:${Region}:${Account}:experiment/${Id}", "experiment-template": "arn:${Partition}:fis:${Region}:${Account}:experiment-template/${Id}", "safety-lever": "arn:${Partition}:fis:${Region}:${Account}:safety-lever/${Id}"}, "globalaccelerator": {"accelerator": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}", "attachment": "arn:${Partition}:globalaccelerator::${Account}:attachment/${ResourceId}", "endpointgroup": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}/listener/${ListenerId}/endpoint-group/${EndpointGroupId}", "listener": "arn:${Partition}:globalaccelerator::${Account}:accelerator/${ResourceId}/listener/${ListenerId}"}, "guardduty": {"customdetectionrule": "arn:${Partition}:guardduty::aws:detection-rule/custom/${RuleId}", "customdetectionruleassociation": "arn:${Partition}:guardduty:${Region}:${Account}:detection-rule/custom/${RuleId}/association/${AssociationId}", "detector": "arn:${Partition}:guardduty:${Region}:${Account}:detector/${DetectorId}", "filter": "arn:${Partition}:guardduty:${Region}:${Account}:detector/${DetectorId}/filter/${FilterName}", "ipset": "arn:${Partition}:guardduty:${Region}:${Account}:detector/${DetectorId}/ipset/${IPSetId}", "malwareprotectionplan": "arn:${Partition}:guardduty:${Region}:${Account}:malware-protection-plan/${MalwareProtectionPlanId}", "publishingDestination": "arn:${Partition}:guardduty:${Region}:${Account}:detector/${DetectorId}/publishingdestination/${PublishingDestinationId}", "threatentityset": "arn:${Partition}:guardduty:${Region}:${Account}:detector/${DetectorId}/threatentityset/${ThreatEntitySetId}", "threatintelset": "arn:${Partition}:guardduty:${Region}:${Account}:detector/${DetectorId}/threatintelset/${ThreatIntelSetId}", "trustedentityset": "arn:${Partition}:guardduty:${Region}:${Account}:detector/${DetectorId}/trustedentityset/${TrustedEntitySetId}"}, "inspector2": {"CIS Scan Configuration": "arn:${Partition}:inspector2:${Region}:${Account}:owner/${OwnerId}/cis-configuration/${CISScanConfigurationId}", "Code Security Integration": "arn:${Partition}:inspector2:${Region}:${Account}:codesecurity-integration/${CodeSecurityIntegrationId}", "Code Security Scan Configuration": "arn:${Partition}:inspector2:${Region}:${Account}:owner/${OwnerId}/codesecurity-configuration/${CodeSecurityScanConfigurationId}", "Connector": "arn:${Partition}:inspector2:${Region}:${Account}:connector/${ConnectorId}", "Filter": "arn:${Partition}:inspector2:${Region}:${Account}:owner/${OwnerId}/filter/${FilterId}", "Finding": "arn:${Partition}:inspector2:${Region}:${Account}:finding/${FindingId}"}, "kinesisanalytics": {"application": "arn:${Partition}:kinesisanalytics:${Region}:${Account}:application/${ApplicationName}"}, "logs": {"anomaly-detector": "arn:${Partition}:logs:${Region}:${Account}:anomaly-detector:${DetectorId}", "delivery": "arn:${Partition}:logs:${Region}:${Account}:delivery:${DeliveryName}", "delivery-destination": "arn:${Partition}:logs:${Region}:${Account}:delivery-destination:${DeliveryDestinationName}", "delivery-source": "arn:${Partition}:logs:${Region}:${Account}:delivery-source:${DeliverySourceName}", "destination": "arn:${Partition}:logs:${Region}:${Account}:destination:${DestinationName}", "log-group": "arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}", "log-stream": "arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}", "lookup-table": "arn:${Partition}:logs:${Region}:${Account}:lookup-table:${LookupTableName}", "scheduled-query": "arn:${Partition}:logs:${Region}:${Account}:scheduled-query:${ScheduledQueryId}"}, "macie2": {"AllowList": "arn:${Partition}:macie2:${Region}:${Account}:allow-list/${ResourceId}", "ClassificationJob": "arn:${Partition}:macie2:${Region}:${Account}:classification-job/${ResourceId}", "CustomDataIdentifier": "arn:${Partition}:macie2:${Region}:${Account}:custom-data-identifier/${ResourceId}", "FindingsFilter": "arn:${Partition}:macie2:${Region}:${Account}:findings-filter/${ResourceId}", "Member": "arn:${Partition}:macie2:${Region}:${Account}:member/${ResourceId}"}, "oam": {"Link": "arn:${Partition}:oam:${Region}:${Account}:link/${ResourceId}", "Sink": "arn:${Partition}:oam:${Region}:${Account}:sink/${ResourceId}"}, "payment-cryptography": {"alias": "arn:${Partition}:payment-cryptography:${Region}:${Account}:alias/${Alias}", "approval-team": "arn:${Partition}:mpa:${Region}:${Account}:approval-team/${ApprovalTeamId}", "key": "arn:${Partition}:payment-cryptography:${Region}:${Account}:key/${KeyId}"}, "quicksight": {"accessControlApplication": "arn:${Partition}:quicksight:${Region}:${Account}:access-control-application/${ResourceId}", "account": "arn:${Partition}:quicksight:${Region}:${Account}:account/${ResourceId}", "actionconnector": "arn:${Partition}:quicksight:${Region}:${Account}:action-connector/${ResourceId}", "agent": "arn:${Partition}:quicksight:${Region}:${Account}:agent/${ResourceId}", "analysis": "arn:${Partition}:quicksight:${Region}:${Account}:analysis/${ResourceId}", "app": "arn:${Partition}:quicksight:${Region}:${Account}:app/${ResourceId}", "approvalPolicy": "arn:${Partition}:quicksight:${Region}:${Account}:approval-policy/${ResourceId}", "assetBundleExportJob": "arn:${Partition}:quicksight:${Region}:${Account}:asset-bundle-export-job/${ResourceId}", "assetBundleImportJob": "arn:${Partition}:quicksight:${Region}:${Account}:asset-bundle-import-job/${ResourceId}", "assignment": "arn:${Partition}:quicksight::${Account}:assignment/${ResourceId}", "automation": "arn:${Partition}:quicksight:${Region}:${Account}:automation-group/${AutomationGroupId}/automation/${ResourceId}", "automationGroup": "arn:${Partition}:quicksight:${Region}:${Account}:automation-group/${ResourceId}", "automationJob": "arn:${Partition}:quicksight:${Region}:${Account}:automation-group/${AutomationGroupId}/automation/${AutomationId}/job/${ResourceId}", "brand": "arn:${Partition}:quicksight:${Region}:${Account}:brand/${ResourceId}", "customization": "arn:${Partition}:quicksight:${Region}:${Account}:customization/${ResourceId}", "custompermissions": "arn:${Partition}:quicksight:${Region}:${Account}:custompermissions/${ResourceId}", "dashboard": "arn:${Partition}:quicksight:${Region}:${Account}:dashboard/${ResourceId}", "dashboardSnapshotJob": "arn:${Partition}:quicksight:${Region}:${Account}:dashboard/${DashboardId}/snapshot-job/${ResourceId}", "dataset": "arn:${Partition}:quicksight:${Region}:${Account}:dataset/${ResourceId}", "datasource": "arn:${Partition}:quicksight:${Region}:${Account}:datasource/${ResourceId}", "dlpSetting": "arn:${Partition}:quicksight:${Region}:${Account}:dlpsetting/${ResourceId}", "emailCustomizationTemplate": "arn:${Partition}:quicksight:${Region}:${Account}:email-customization-template/${ResourceId}", "extension": "arn:${Partition}:quicksight:${Region}:${Account}:extension/${ResourceId}", "extensionaccess": "arn:${Partition}:quicksight:${Region}:${Account}:extension-access/${ResourceId}", "flow": "arn:${Partition}:quicksight:${Region}:${Account}:flow/${ResourceId}", "folder": "arn:${Partition}:quicksight:${Region}:${Account}:folder/${ResourceId}", "group": "arn:${Partition}:quicksight:${Region}:${Account}:group/${ResourceId}", "inboundConnector": "arn:${Partition}:quicksight:${Region}:${Account}:inbound-connector/${ResourceId}", "ingestion": "arn:${Partition}:quicksight:${Region}:${Account}:dataset/${DatasetId}/ingestion/${ResourceId}", "knowledgeBase": "arn:${Partition}:quicksight:${Region}:${Account}:knowledge-base/${ResourceId}", "limitsProfile": "arn:${Partition}:quicksight:${Region}:${Account}:limits-profile/${ResourceId}", "namespace": "arn:${Partition}:quicksight:${Region}:${Account}:namespace/${ResourceId}", "oauthClientApplication": "arn:${Partition}:quicksight:${Region}:${Account}:oauthClientApplication/${ResourceId}", "refreshschedule": "arn:${Partition}:quicksight:${Region}:${Account}:dataset/${DatasetId}/refresh-schedule/${ResourceId}", "space": "arn:${Partition}:quicksight:${Region}:${Account}:space/${ResourceId}", "template": "arn:${Partition}:quicksight:${Region}:${Account}:template/${ResourceId}", "theme": "arn:${Partition}:quicksight:${Region}:${Account}:theme/${ResourceId}", "topic": "arn:${Partition}:quicksight:${Region}:${Account}:topic/${ResourceId}", "user": "arn:${Partition}:quicksight:${Region}:${Account}:user/${ResourceId}", "vpcconnection": "arn:${Partition}:quicksight:${Region}:${Account}:vpcConnection/${ResourceId}"}, "ram": {"customer-managed-permission": "arn:${Partition}:ram:${Region}:${Account}:permission/${ResourcePath}", "permission": "arn:${Partition}:ram::aws:permission/${ResourcePath}", "resource-share": "arn:${Partition}:ram:${Region}:${Account}:resource-share/${ResourcePath}", "resource-share-invitation": "arn:${Partition}:ram:${Region}:${Account}:resource-share-invitation/${ResourcePath}"}, "redshift": {"cluster": "arn:${Partition}:redshift:${Region}:${Account}:cluster:${ClusterName}", "datashare": "arn:${Partition}:redshift:${Region}:${Account}:datashare:${ProducerClusterNamespace}/${DataShareName}", "dbgroup": "arn:${Partition}:redshift:${Region}:${Account}:dbgroup:${ClusterName}/${DbGroup}", "dbname": "arn:${Partition}:redshift:${Region}:${Account}:dbname:${ClusterName}/${DbName}", "dbuser": "arn:${Partition}:redshift:${Region}:${Account}:dbuser:${ClusterName}/${DbUser}", "eventsubscription": "arn:${Partition}:redshift:${Region}:${Account}:eventsubscription:${EventSubscriptionName}", "hsmclientcertificate": "arn:${Partition}:redshift:${Region}:${Account}:hsmclientcertificate:${HSMClientCertificateId}", "hsmconfiguration": "arn:${Partition}:redshift:${Region}:${Account}:hsmconfiguration:${HSMConfigurationId}", "integration": "arn:${Partition}:redshift:${Region}:${Account}:integration:${IntegrationIdentifier}", "namespace": "arn:${Partition}:redshift:${Region}:${Account}:namespace:${ClusterNamespace}", "parametergroup": "arn:${Partition}:redshift:${Region}:${Account}:parametergroup:${ParameterGroupName}", "qev2idcapplication": "arn:${Partition}:redshift:${Region}:${Account}:qev2idcapplication:${Qev2IdcApplicationId}", "redshiftidcapplication": "arn:${Partition}:redshift:${Region}:${Account}:redshiftidcapplication:${RedshiftIdcApplicationId}", "securitygroup": "arn:${Partition}:redshift:${Region}:${Account}:securitygroup:${SecurityGroupName}/ec2securitygroup/${Owner}/${Ec2SecurityGroupId}", "securitygroupingress-cidr": "arn:${Partition}:redshift:${Region}:${Account}:securitygroupingress:${SecurityGroupName}/cidrip/${IpRange}", "securitygroupingress-ec2securitygroup": "arn:${Partition}:redshift:${Region}:${Account}:securitygroupingress:${SecurityGroupName}/ec2securitygroup/${Owner}/${Ece2SecuritygroupId}", "snapshot": "arn:${Partition}:redshift:${Region}:${Account}:snapshot:${ClusterName}/${SnapshotName}", "snapshotcopygrant": "arn:${Partition}:redshift:${Region}:${Account}:snapshotcopygrant:${SnapshotCopyGrantName}", "snapshotschedule": "arn:${Partition}:redshift:${Region}:${Account}:snapshotschedule:${ScheduleIdentifier}", "subnetgroup": "arn:${Partition}:redshift:${Region}:${Account}:subnetgroup:${SubnetGroupName}", "usagelimit": "arn:${Partition}:redshift:${Region}:${Account}:usagelimit:${UsageLimitId}"}, "redshift-data": {"cluster": "arn:${Partition}:redshift:${Region}:${Account}:cluster:${ClusterName}", "managed-workgroup": "arn:${Partition}:redshift-serverless:${Region}:${Account}:managed-workgroup/${ManagedWorkgroupId}", "workgroup": "arn:${Partition}:redshift-serverless:${Region}:${Account}:workgroup/${WorkgroupId}"}, "redshift-serverless": {"endpointAccess": "arn:${Partition}:redshift-serverless:${Region}:${Account}:managedvpcendpoint/${EndpointAccessId}", "managed-workgroup": "arn:${Partition}:redshift-serverless:${Region}:${Account}:managed-workgroup/${ManagedWorkgroupName}", "namespace": "arn:${Partition}:redshift-serverless:${Region}:${Account}:namespace/${NamespaceId}", "recoveryPoint": "arn:${Partition}:redshift-serverless:${Region}:${Account}:recoverypoint/${RecoveryPointId}", "snapshot": "arn:${Partition}:redshift-serverless:${Region}:${Account}:snapshot/${SnapshotId}", "workgroup": "arn:${Partition}:redshift-serverless:${Region}:${Account}:workgroup/${WorkgroupId}"}, "rekognition": {"collection": "arn:${Partition}:rekognition:${Region}:${Account}:collection/${CollectionId}", "dataset": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/dataset/${DatasetType}/${CreationTimestamp}", "project": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/${CreationTimestamp}", "projectversion": "arn:${Partition}:rekognition:${Region}:${Account}:project/${ProjectName}/version/${VersionName}/${CreationTimestamp}", "streamprocessor": "arn:${Partition}:rekognition:${Region}:${Account}:streamprocessor/${StreamprocessorId}"}, "resource-explorer-2": {"index": "arn:${Partition}:resource-explorer-2:${Region}:${Account}:index/${IndexUuid}", "managed-view": "arn:${Partition}:resource-explorer-2:${Region}:${Account}:managed-view/${ManagedViewName}/${ManagedViewUuid}", "view": "arn:${Partition}:resource-explorer-2:${Region}:${Account}:view/${ViewName}/${ViewUuid}"}, "route53": {"change": "arn:${Partition}:route53:::change/${Id}", "cidrcollection": "arn:${Partition}:route53:::cidrcollection/${Id}", "delegationset": "arn:${Partition}:route53:::delegationset/${Id}", "healthcheck": "arn:${Partition}:route53:::healthcheck/${Id}", "hostedzone": "arn:${Partition}:route53:::hostedzone/${Id}", "queryloggingconfig": "arn:${Partition}:route53:::queryloggingconfig/${Id}", "trafficpolicy": "arn:${Partition}:route53:::trafficpolicy/${Id}", "trafficpolicyinstance": "arn:${Partition}:route53:::trafficpolicyinstance/${Id}", "vpc": "arn:${Partition}:ec2:${Region}:${Account}:vpc/${VpcId}"}, "securityhub": {"aggregatorv2": "arn:${Partition}:securityhub:${Region}:${Account}:aggregatorv2/${AggregatorV2Id}", "automation-rule": "arn:${Partition}:securityhub:${Region}:${Account}:automation-rule/${AutomationRuleId}", "automation-rulev2": "arn:${Partition}:securityhub:${Region}:${Account}:automation-rulev2/${AutomationRuleV2Id}", "configuration-policy": "arn:${Partition}:securityhub:${Region}:${Account}:configuration-policy/${ConfigurationPolicyId}", "connector": "arn:${Partition}:securityhub:${Region}:${Account}:connector/${ConnectorId}", "connectorv2": "arn:${Partition}:securityhub:${Region}:${Account}:connectorv2/${ConnectorV2Id}", "finding-aggregator": "arn:${Partition}:securityhub:${Region}:${Account}:finding-aggregator/${FindingAggregatorId}", "hub": "arn:${Partition}:securityhub:${Region}:${Account}:hub/default", "hubv2": "arn:${Partition}:securityhub:${Region}:${Account}:hubv2/${HubV2Id}", "product": "arn:${Partition}:securityhub:${Region}:${Account}:product/${Company}/${ProductId}"}, "servicediscovery": {"namespace": "arn:${Partition}:servicediscovery:${Region}:${Account}:namespace/${NamespaceId}", "service": "arn:${Partition}:servicediscovery:${Region}:${Account}:service/${ServiceId}"}, "servicequotas": {"quota": "arn:${Partition}:servicequotas:${Region}:${Account}:${ServiceCode}/${QuotaCode}"}, "signer": {"signing-job": "arn:${Partition}:signer:${Region}:${Account}:/signing-jobs/${JobId}", "signing-profile": "arn:${Partition}:signer:${Region}:${Account}:/signing-profiles/${ProfileName}"}, "ssm": {"association": "arn:${Partition}:ssm:${Region}:${Account}:association/${AssociationId}", "automation-definition": "arn:${Partition}:ssm:${Region}:${Account}:automation-definition/${AutomationDefinitionName}:${VersionId}", "automation-execution": "arn:${Partition}:ssm:${Region}:${Account}:automation-execution/${AutomationExecutionId}", "bucket": "arn:${Partition}:s3:::${BucketName}", "cloud-connector": "arn:${Partition}:ssm:${Region}:${Account}:cloud-connector/${CloudConnectorId}", "document": "arn:${Partition}:ssm:${Region}:${Account}:document/${DocumentName}", "iam-role": "arn:${Partition}:iam::${Account}:role/${RoleName}", "instance": "arn:${Partition}:ec2:${Region}:${Account}:instance/${InstanceId}", "maintenancewindow": "arn:${Partition}:ssm:${Region}:${Account}:maintenancewindow/${ResourceId}", "managed-instance": "arn:${Partition}:ssm:${Region}:${Account}:managed-instance/${InstanceId}", "managed-instance-inventory": "arn:${Partition}:ssm:${Region}:${Account}:managed-instance-inventory/${InstanceId}", "opsitem": "arn:${Partition}:ssm:${Region}:${Account}:opsitem/${ResourceId}", "opsitemgroup": "arn:${Partition}:ssm:${Region}:${Account}:opsitemgroup/default", "opsmetadata": "arn:${Partition}:ssm:${Region}:${Account}:opsmetadata/${ResourceId}", "parameter": "arn:${Partition}:ssm:${Region}:${Account}:parameter/${ParameterNameWithoutLeadingSlash}", "patchbaseline": "arn:${Partition}:ssm:${Region}:${Account}:patchbaseline/${PatchBaselineIdResourceId}", "resourcedatasync": "arn:${Partition}:ssm:${Region}:${Account}:resource-data-sync/${SyncName}", "servicesetting": "arn:${Partition}:ssm:${Region}:${Account}:servicesetting/${ResourceId}", "session": "arn:${Partition}:ssm:${Region}:${Account}:session/${SessionId}", "task": "arn:${Partition}:ecs:${Region}:${Account}:task/${TaskId}", "windowtarget": "arn:${Partition}:ssm:${Region}:${Account}:windowtarget/${WindowTargetId}", "windowtask": "arn:${Partition}:ssm:${Region}:${Account}:windowtask/${WindowTaskId}"}, "sso": {"Account": "arn:${Partition}:sso:::account/${AccountId}", "Application": "arn:${Partition}:sso::${Account}:application/${InstanceId}/${ApplicationId}", "ApplicationProvider": "arn:${Partition}:sso::aws:applicationProvider/${ApplicationProviderId}", "Instance": "arn:${Partition}:sso:::instance/${InstanceId}", "PermissionSet": "arn:${Partition}:sso:::permissionSet/${InstanceId}/${PermissionSetId}", "TrustedTokenIssuer": "arn:${Partition}:sso::${Account}:trustedTokenIssuer/${InstanceId}/${TrustedTokenIssuerId}"}, "states": {"activity": "arn:${Partition}:states:${Region}:${Account}:activity:${ActivityName}", "execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}:${ExecutionId}", "express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}:${ExecutionId}:${ExpressId}", "labelled execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}/${MapRunLabel}:${ExecutionId}", "labelled express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}/${MapRunLabel}:${ExecutionId}:${ExpressId}", "maprun": "arn:${Partition}:states:${Region}:${Account}:mapRun:${StateMachineName}/${MapRunLabel}:${MapRunId}", "statemachine": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}", "statemachinealias": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineAliasName}", "statemachineversion": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineVersionId}"}, "textract": {"adapter": "arn:${Partition}:textract:${Region}:${Account}:/adapters/${AdapterId}", "adapterversion": "arn:${Partition}:textract:${Region}:${Account}:/adapters/${AdapterId}/versions/${AdapterVersion}"}, "timestream-influxdb": {"db-backup": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-backup/${DbBackupId}", "db-cluster": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-cluster/${DbClusterId}", "db-instance": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-instance/${DbInstanceIdentifier}", "db-parameter-group": "arn:${Partition}:timestream-influxdb:${Region}:${Account}:db-parameter-group/${DbParameterGroupIdentifier}"}, "translate": {"parallel-data": "arn:${Partition}:translate:${Region}:${Account}:parallel-data/${ResourceName}", "terminology": "arn:${Partition}:translate:${Region}:${Account}:terminology/${ResourceName}"}, "xray": {"group": "arn:${Partition}:xray:${Region}:${Account}:group/${GroupName}/${Id}", "sampling-rule": "arn:${Partition}:xray:${Region}:${Account}:sampling-rule/${SamplingRuleName}"}}, "resourceTagKeys": {"ec2": {"instance": ["aws:ResourceTag/", "ec2:ResourceTag/"]}}, - "unqualified": {"states": ["statemachine"]}, + "unqualified": {"ssm": ["parameter"], "states": ["statemachine"]}, "mintedIds": {"events": ["api-destination", "connection"]}, "operations": { "access-analyzer:ApplyArchiveRule": {"action": "access-analyzer:ApplyArchiveRule", "types": ["Analyzer"], "resources": [{"types": ["Analyzer"], "arn": "analyzerArn"}]}, @@ -3294,7 +3294,7 @@ "route53:CreateHostedZone": {"action": "route53:CreateHostedZone", "types": [], "resources": [], "makes": [{"type": "hostedzone", "fill": {}}]}, "route53:CreateKeySigningKey": {"action": "route53:CreateKeySigningKey", "types": ["hostedzone"], "resources": []}, "route53:CreateQueryLoggingConfig": {"action": "route53:CreateQueryLoggingConfig", "types": ["hostedzone"], "resources": []}, - "route53:CreateResourceRecordSetProtections": {"action": "route53:CreateResourceRecordSetProtections", "types": [], "resources": []}, + "route53:CreateResourceRecordSetProtections": {"action": "route53:CreateResourceRecordSetProtections", "types": ["hostedzone"], "resources": []}, "route53:CreateReusableDelegationSet": {"action": "route53:CreateReusableDelegationSet", "types": [], "resources": [], "makes": [{"type": "delegationset", "fill": {}}]}, "route53:CreateTrafficPolicy": {"action": "route53:CreateTrafficPolicy", "types": [], "resources": [], "makes": [{"type": "trafficpolicy", "fill": {}}]}, "route53:CreateTrafficPolicyInstance": {"action": "route53:CreateTrafficPolicyInstance", "types": ["hostedzone", "trafficpolicy"], "resources": []}, @@ -3306,7 +3306,7 @@ "route53:DeleteHostedZone": {"action": "route53:DeleteHostedZone", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}}, "route53:DeleteKeySigningKey": {"action": "route53:DeleteKeySigningKey", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{HostedZoneId}"}}, "route53:DeleteQueryLoggingConfig": {"action": "route53:DeleteQueryLoggingConfig", "types": ["queryloggingconfig"], "resources": [{"type": "queryloggingconfig", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}}, - "route53:DeleteResourceRecordSetProtections": {"action": "route53:DeleteResourceRecordSetProtections", "types": [], "resources": []}, + "route53:DeleteResourceRecordSetProtections": {"action": "route53:DeleteResourceRecordSetProtections", "types": ["hostedzone"], "resources": []}, "route53:DeleteReusableDelegationSet": {"action": "route53:DeleteReusableDelegationSet", "types": ["delegationset"], "resources": [{"type": "delegationset", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}}, "route53:DeleteTrafficPolicy": {"action": "route53:DeleteTrafficPolicy", "types": ["trafficpolicy"], "resources": [{"type": "trafficpolicy", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}}, "route53:DeleteTrafficPolicyInstance": {"action": "route53:DeleteTrafficPolicyInstance", "types": ["trafficpolicyinstance"], "resources": [{"type": "trafficpolicyinstance", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}}, @@ -3341,7 +3341,7 @@ "route53:ListHostedZonesByName": {"action": "route53:ListHostedZonesByName", "types": [], "resources": []}, "route53:ListHostedZonesByVPC": {"action": "route53:ListHostedZonesByVPC", "types": [], "resources": []}, "route53:ListQueryLoggingConfigs": {"action": "route53:ListQueryLoggingConfigs", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "?hostedzoneid"}}, - "route53:ListResourceRecordSetProtections": {"action": "route53:ListResourceRecordSetProtections", "types": [], "resources": []}, + "route53:ListResourceRecordSetProtections": {"action": "route53:ListResourceRecordSetProtections", "types": ["hostedzone"], "resources": []}, "route53:ListResourceRecordSets": {"action": "route53:ListResourceRecordSets", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}}, "route53:ListReusableDelegationSets": {"action": "route53:ListReusableDelegationSets", "types": [], "resources": []}, "route53:ListTagsForResource": {"action": "route53:ListTagsForResource", "types": ["healthcheck", "hostedzone"], "resources": [{"type": "healthcheck", "fill": {"Id": "ResourceId"}, "when": {"ResourceType": ["healthcheck"]}}, {"type": "hostedzone", "fill": {"Id": "ResourceId"}, "when": {"ResourceType": ["hostedzone"]}}], "located": {"ResourceId": "{ResourceId}", "ResourceType": "{ResourceType}"}}, @@ -3560,10 +3560,159 @@ "signer:TagResource": {"action": "signer:TagResource", "types": ["signing-profile"], "resources": [{"types": ["signing-profile"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}}, "signer:UntagResource": {"action": "signer:UntagResource", "types": ["signing-profile"], "resources": [{"types": ["signing-profile"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}}, "ssm:AddTagsToResource": {"action": "ssm:AddTagsToResource", "types": ["association", "automation-execution", "cloud-connector", "document", "instance", "maintenancewindow", "managed-instance", "opsitem", "opsmetadata", "parameter", "patchbaseline", "task"], "resources": [{"type": "association", "fill": {"AssociationId": "ResourceId"}, "when": {"ResourceType": ["Association"]}}, {"type": "cloud-connector", "fill": {"CloudConnectorId": "ResourceId"}, "when": {"ResourceType": ["CloudConnector"]}}, {"type": "document", "fill": {"DocumentName": "ResourceId"}, "when": {"ResourceType": ["Document"]}}, {"type": "maintenancewindow", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["MaintenanceWindow"]}}, {"type": "managed-instance", "fill": {"InstanceId": "ResourceId"}, "when": {"ResourceType": ["ManagedInstance"]}}, {"type": "opsitem", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["OpsItem"]}}, {"type": "opsmetadata", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["OpsMetadata"]}}, {"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "ResourceId"}, "when": {"ResourceType": ["Parameter"]}}, {"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "ResourceId"}, "when": {"ResourceType": ["PatchBaseline"]}}]}, - "ssm:CreateAssociation": {"action": "ssm:CreateAssociation", "types": ["association", "document", "instance", "managed-instance"], "resources": [{"type": "association", "fill": {}}]}, + "ssm:AssociateOpsItemRelatedItem": {"action": "ssm:AssociateOpsItemRelatedItem", "types": ["opsitem"], "resources": [{"type": "opsitem", "fill": {"ResourceId": "OpsItemId"}}]}, + "ssm:CancelCommand": {"action": "ssm:CancelCommand", "types": [], "resources": []}, + "ssm:CancelMaintenanceWindowExecution": {"action": "ssm:CancelMaintenanceWindowExecution", "types": ["maintenancewindow"], "resources": []}, + "ssm:CreateActivation": {"action": "ssm:CreateActivation", "types": [], "resources": []}, + "ssm:CreateAssociation": {"action": "ssm:CreateAssociation", "types": ["association", "document", "instance", "managed-instance"], "resources": [{"type": "association", "fill": {}, "made": true}, {"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:CreateAssociationBatch": {"action": "ssm:CreateAssociationBatch", "types": ["document", "instance", "managed-instance"], "resources": []}, + "ssm:CreateCloudConnector": {"action": "ssm:CreateCloudConnector", "types": ["cloud-connector"], "resources": [{"types": ["cloud-connector"], "arn": "ConfigConnectorArn"}, {"types": ["cloud-connector"], "arn": "RoleArn"}, {"type": "cloud-connector", "fill": {}}]}, "ssm:CreateDocument": {"action": "ssm:CreateDocument", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:CreateMaintenanceWindow": {"action": "ssm:CreateMaintenanceWindow", "types": [], "resources": [], "makes": [{"type": "maintenancewindow", "fill": {}}]}, + "ssm:CreateOpsItem": {"action": "ssm:CreateOpsItem", "types": [], "resources": [], "makes": [{"type": "opsitem", "fill": {"ResourceId": "Source"}}]}, + "ssm:CreateOpsMetadata": {"action": "ssm:CreateOpsMetadata", "types": [], "resources": [], "makes": [{"type": "opsmetadata", "fill": {"ResourceId": "ResourceId"}}]}, + "ssm:CreatePatchBaseline": {"action": "ssm:CreatePatchBaseline", "types": [], "resources": [], "makes": [{"type": "patchbaseline", "fill": {}}]}, + "ssm:CreateResourceDataSync": {"action": "ssm:CreateResourceDataSync", "types": ["resourcedatasync"], "resources": [{"types": ["resourcedatasync"], "arn": "S3Destination.AWSKMSKeyARN"}, {"type": "resourcedatasync", "fill": {"SyncName": "SyncName"}}]}, + "ssm:DeleteActivation": {"action": "ssm:DeleteActivation", "types": [], "resources": []}, + "ssm:DeleteAssociation": {"action": "ssm:DeleteAssociation", "types": ["association"], "resources": [{"type": "association", "fill": {"AssociationId": "AssociationId"}}]}, + "ssm:DeleteCloudConnector": {"action": "ssm:DeleteCloudConnector", "types": ["cloud-connector"], "resources": [{"type": "cloud-connector", "fill": {"CloudConnectorId": "CloudConnectorId"}}]}, + "ssm:DeleteDocument": {"action": "ssm:DeleteDocument", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:DeleteInventory": {"action": "ssm:DeleteInventory", "types": [], "resources": []}, + "ssm:DeleteMaintenanceWindow": {"action": "ssm:DeleteMaintenanceWindow", "types": ["maintenancewindow"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, + "ssm:DeleteOpsItem": {"action": "ssm:DeleteOpsItem", "types": ["opsitem"], "resources": [{"type": "opsitem", "fill": {"ResourceId": "OpsItemId"}}]}, + "ssm:DeleteOpsMetadata": {"action": "ssm:DeleteOpsMetadata", "types": ["opsmetadata"], "resources": [{"types": ["opsmetadata"], "arn": "OpsMetadataArn"}]}, + "ssm:DeleteParameter": {"action": "ssm:DeleteParameter", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Name"}}]}, + "ssm:DeleteParameters": {"action": "ssm:DeleteParameters", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Names[]"}}]}, + "ssm:DeletePatchBaseline": {"action": "ssm:DeletePatchBaseline", "types": ["patchbaseline"], "resources": [{"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "BaselineId"}}]}, + "ssm:DeleteResourceDataSync": {"action": "ssm:DeleteResourceDataSync", "types": ["resourcedatasync"], "resources": [{"type": "resourcedatasync", "fill": {"SyncName": "SyncName"}}]}, + "ssm:DeleteResourcePolicy": {"action": "ssm:DeleteResourcePolicy", "types": ["document", "opsitemgroup", "parameter"], "resources": [{"types": ["document", "opsitemgroup", "parameter"], "arn": "ResourceArn"}]}, + "ssm:DeregisterDefaultHostManagementConfiguration": {"action": "ssm:DeregisterDefaultHostManagementConfiguration", "types": [], "resources": []}, + "ssm:DeregisterManagedInstance": {"action": "ssm:DeregisterManagedInstance", "types": ["managed-instance"], "resources": [{"type": "managed-instance", "fill": {"InstanceId": "InstanceId"}}]}, + "ssm:DeregisterPatchBaselineForPatchGroup": {"action": "ssm:DeregisterPatchBaselineForPatchGroup", "types": ["patchbaseline"], "resources": [{"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "BaselineId"}}]}, + "ssm:DeregisterTargetFromMaintenanceWindow": {"action": "ssm:DeregisterTargetFromMaintenanceWindow", "types": ["maintenancewindow", "windowtarget"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}, {"type": "windowtarget", "fill": {"WindowTargetId": "WindowTargetId"}}]}, + "ssm:DeregisterTaskFromMaintenanceWindow": {"action": "ssm:DeregisterTaskFromMaintenanceWindow", "types": ["maintenancewindow", "windowtask"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}, {"type": "windowtask", "fill": {"WindowTaskId": "WindowTaskId"}}]}, + "ssm:DescribeActivations": {"action": "ssm:DescribeActivations", "types": [], "resources": []}, + "ssm:DescribeAssociation": {"action": "ssm:DescribeAssociation", "types": ["association"], "resources": [{"type": "association", "fill": {"AssociationId": "AssociationId"}}]}, + "ssm:DescribeAssociationExecutionTargets": {"action": "ssm:DescribeAssociationExecutionTargets", "types": ["association"], "resources": [{"type": "association", "fill": {"AssociationId": "AssociationId"}}]}, + "ssm:DescribeAssociationExecutions": {"action": "ssm:DescribeAssociationExecutions", "types": ["association"], "resources": [{"type": "association", "fill": {"AssociationId": "AssociationId"}}]}, + "ssm:DescribeAutomationExecutions": {"action": "ssm:DescribeAutomationExecutions", "types": [], "resources": []}, + "ssm:DescribeAutomationStepExecutions": {"action": "ssm:DescribeAutomationStepExecutions", "types": ["automation-execution"], "resources": [{"type": "automation-execution", "fill": {"AutomationExecutionId": "AutomationExecutionId"}}]}, + "ssm:DescribeAvailablePatches": {"action": "ssm:DescribeAvailablePatches", "types": [], "resources": []}, + "ssm:DescribeDocument": {"action": "ssm:DescribeDocument", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:DescribeDocumentPermission": {"action": "ssm:DescribeDocumentPermission", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:DescribeEffectiveInstanceAssociations": {"action": "ssm:DescribeEffectiveInstanceAssociations", "types": ["instance", "managed-instance"], "resources": []}, + "ssm:DescribeEffectivePatchesForPatchBaseline": {"action": "ssm:DescribeEffectivePatchesForPatchBaseline", "types": ["patchbaseline"], "resources": [{"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "BaselineId"}}]}, + "ssm:DescribeInstanceAssociationsStatus": {"action": "ssm:DescribeInstanceAssociationsStatus", "types": ["instance", "managed-instance"], "resources": []}, + "ssm:DescribeInstanceInformation": {"action": "ssm:DescribeInstanceInformation", "types": [], "resources": []}, + "ssm:DescribeInstancePatchStates": {"action": "ssm:DescribeInstancePatchStates", "types": ["instance", "managed-instance"], "resources": []}, + "ssm:DescribeInstancePatchStatesForPatchGroup": {"action": "ssm:DescribeInstancePatchStatesForPatchGroup", "types": [], "resources": []}, + "ssm:DescribeInstancePatches": {"action": "ssm:DescribeInstancePatches", "types": ["instance", "managed-instance"], "resources": []}, + "ssm:DescribeInstanceProperties": {"action": "ssm:DescribeInstanceProperties", "types": [], "resources": []}, + "ssm:DescribeInventoryDeletions": {"action": "ssm:DescribeInventoryDeletions", "types": [], "resources": []}, + "ssm:DescribeMaintenanceWindowExecutionTaskInvocations": {"action": "ssm:DescribeMaintenanceWindowExecutionTaskInvocations", "types": [], "resources": []}, + "ssm:DescribeMaintenanceWindowExecutionTasks": {"action": "ssm:DescribeMaintenanceWindowExecutionTasks", "types": [], "resources": []}, + "ssm:DescribeMaintenanceWindowExecutions": {"action": "ssm:DescribeMaintenanceWindowExecutions", "types": ["maintenancewindow"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, + "ssm:DescribeMaintenanceWindowSchedule": {"action": "ssm:DescribeMaintenanceWindowSchedule", "types": [], "resources": []}, + "ssm:DescribeMaintenanceWindowTargets": {"action": "ssm:DescribeMaintenanceWindowTargets", "types": ["maintenancewindow"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, + "ssm:DescribeMaintenanceWindowTasks": {"action": "ssm:DescribeMaintenanceWindowTasks", "types": ["maintenancewindow"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, + "ssm:DescribeMaintenanceWindows": {"action": "ssm:DescribeMaintenanceWindows", "types": [], "resources": []}, + "ssm:DescribeMaintenanceWindowsForTarget": {"action": "ssm:DescribeMaintenanceWindowsForTarget", "types": [], "resources": []}, + "ssm:DescribeOpsItems": {"action": "ssm:DescribeOpsItems", "types": [], "resources": []}, + "ssm:DescribeParameters": {"action": "ssm:DescribeParameters", "types": [], "resources": []}, + "ssm:DescribePatchBaselines": {"action": "ssm:DescribePatchBaselines", "types": [], "resources": []}, + "ssm:DescribePatchGroupState": {"action": "ssm:DescribePatchGroupState", "types": [], "resources": []}, + "ssm:DescribePatchGroups": {"action": "ssm:DescribePatchGroups", "types": [], "resources": []}, + "ssm:DescribePatchProperties": {"action": "ssm:DescribePatchProperties", "types": [], "resources": []}, + "ssm:DescribeSessions": {"action": "ssm:DescribeSessions", "types": [], "resources": []}, + "ssm:DisassociateOpsItemRelatedItem": {"action": "ssm:DisassociateOpsItemRelatedItem", "types": ["opsitem"], "resources": [{"type": "opsitem", "fill": {"ResourceId": "OpsItemId"}}]}, + "ssm:GetAccessToken": {"action": "ssm:GetAccessToken", "types": ["opsitem"], "resources": []}, + "ssm:GetAutomationExecution": {"action": "ssm:GetAutomationExecution", "types": ["automation-execution"], "resources": [{"type": "automation-execution", "fill": {"AutomationExecutionId": "AutomationExecutionId"}}]}, + "ssm:GetCalendarState": {"action": "ssm:GetCalendarState", "types": ["document"], "resources": []}, + "ssm:GetCloudConnector": {"action": "ssm:GetCloudConnector", "types": ["cloud-connector"], "resources": [{"type": "cloud-connector", "fill": {"CloudConnectorId": "CloudConnectorId"}}]}, + "ssm:GetCommandInvocation": {"action": "ssm:GetCommandInvocation", "types": [], "resources": []}, + "ssm:GetConnectionStatus": {"action": "ssm:GetConnectionStatus", "types": ["instance", "managed-instance", "task"], "resources": []}, + "ssm:GetDefaultPatchBaseline": {"action": "ssm:GetDefaultPatchBaseline", "types": ["patchbaseline"], "resources": []}, + "ssm:GetDeployablePatchSnapshotForInstance": {"action": "ssm:GetDeployablePatchSnapshotForInstance", "types": [], "resources": []}, + "ssm:GetDocument": {"action": "ssm:GetDocument", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:GetExecutionPreview": {"action": "ssm:GetExecutionPreview", "types": [], "resources": []}, + "ssm:GetInventory": {"action": "ssm:GetInventory", "types": [], "resources": []}, + "ssm:GetInventorySchema": {"action": "ssm:GetInventorySchema", "types": [], "resources": []}, + "ssm:GetMaintenanceWindow": {"action": "ssm:GetMaintenanceWindow", "types": ["maintenancewindow"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, + "ssm:GetMaintenanceWindowExecution": {"action": "ssm:GetMaintenanceWindowExecution", "types": [], "resources": []}, + "ssm:GetMaintenanceWindowExecutionTask": {"action": "ssm:GetMaintenanceWindowExecutionTask", "types": [], "resources": []}, + "ssm:GetMaintenanceWindowExecutionTaskInvocation": {"action": "ssm:GetMaintenanceWindowExecutionTaskInvocation", "types": [], "resources": []}, + "ssm:GetMaintenanceWindowTask": {"action": "ssm:GetMaintenanceWindowTask", "types": ["maintenancewindow"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, + "ssm:GetOpsItem": {"action": "ssm:GetOpsItem", "types": ["opsitem"], "resources": [{"types": ["opsitem"], "arn": "OpsItemArn"}, {"type": "opsitem", "fill": {"ResourceId": "OpsItemId"}}]}, + "ssm:GetOpsMetadata": {"action": "ssm:GetOpsMetadata", "types": ["opsmetadata"], "resources": [{"types": ["opsmetadata"], "arn": "OpsMetadataArn"}]}, + "ssm:GetOpsSummary": {"action": "ssm:GetOpsSummary", "types": ["resourcedatasync"], "resources": [{"type": "resourcedatasync", "fill": {"SyncName": "SyncName"}}]}, + "ssm:GetParameter": {"action": "ssm:GetParameter", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Name"}}]}, + "ssm:GetParameterHistory": {"action": "ssm:GetParameterHistory", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Name"}}]}, + "ssm:GetParameters": {"action": "ssm:GetParameters", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Names[]"}}]}, + "ssm:GetParametersByPath": {"action": "ssm:GetParametersByPath", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Path"}}]}, + "ssm:GetPatchBaseline": {"action": "ssm:GetPatchBaseline", "types": ["patchbaseline"], "resources": [{"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "BaselineId"}}]}, + "ssm:GetPatchBaselineForPatchGroup": {"action": "ssm:GetPatchBaselineForPatchGroup", "types": [], "resources": []}, + "ssm:GetResourcePolicies": {"action": "ssm:GetResourcePolicies", "types": ["document", "opsitemgroup", "parameter"], "resources": [{"types": ["document", "opsitemgroup", "parameter"], "arn": "ResourceArn"}]}, + "ssm:GetServiceSetting": {"action": "ssm:GetServiceSetting", "types": ["servicesetting"], "resources": [{"type": "servicesetting", "fill": {"ResourceId": "SettingId"}}]}, + "ssm:LabelParameterVersion": {"action": "ssm:LabelParameterVersion", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Name"}}]}, + "ssm:ListAssociationVersions": {"action": "ssm:ListAssociationVersions", "types": ["association"], "resources": [{"type": "association", "fill": {"AssociationId": "AssociationId"}}]}, + "ssm:ListAssociations": {"action": "ssm:ListAssociations", "types": [], "resources": []}, + "ssm:ListCloudConnectors": {"action": "ssm:ListCloudConnectors", "types": [], "resources": []}, + "ssm:ListCommandInvocations": {"action": "ssm:ListCommandInvocations", "types": [], "resources": []}, + "ssm:ListCommands": {"action": "ssm:ListCommands", "types": [], "resources": []}, + "ssm:ListComplianceItems": {"action": "ssm:ListComplianceItems", "types": [], "resources": []}, + "ssm:ListComplianceSummaries": {"action": "ssm:ListComplianceSummaries", "types": [], "resources": []}, + "ssm:ListDocumentMetadataHistory": {"action": "ssm:ListDocumentMetadataHistory", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:ListDocumentVersions": {"action": "ssm:ListDocumentVersions", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:ListDocuments": {"action": "ssm:ListDocuments", "types": [], "resources": []}, + "ssm:ListInventoryEntries": {"action": "ssm:ListInventoryEntries", "types": [], "resources": []}, + "ssm:ListNodes": {"action": "ssm:ListNodes", "types": ["resourcedatasync"], "resources": [{"type": "resourcedatasync", "fill": {"SyncName": "SyncName"}}]}, + "ssm:ListNodesSummary": {"action": "ssm:ListNodesSummary", "types": ["resourcedatasync"], "resources": [{"type": "resourcedatasync", "fill": {"SyncName": "SyncName"}}]}, + "ssm:ListOpsItemEvents": {"action": "ssm:ListOpsItemEvents", "types": [], "resources": []}, + "ssm:ListOpsItemRelatedItems": {"action": "ssm:ListOpsItemRelatedItems", "types": [], "resources": []}, + "ssm:ListOpsMetadata": {"action": "ssm:ListOpsMetadata", "types": [], "resources": []}, + "ssm:ListResourceComplianceSummaries": {"action": "ssm:ListResourceComplianceSummaries", "types": [], "resources": []}, + "ssm:ListResourceDataSync": {"action": "ssm:ListResourceDataSync", "types": [], "resources": []}, "ssm:ListTagsForResource": {"action": "ssm:ListTagsForResource", "types": ["association", "automation-execution", "cloud-connector", "document", "maintenancewindow", "managed-instance", "opsitem", "opsmetadata", "parameter", "patchbaseline"], "resources": [{"type": "association", "fill": {"AssociationId": "ResourceId"}, "when": {"ResourceType": ["Association"]}}, {"type": "cloud-connector", "fill": {"CloudConnectorId": "ResourceId"}, "when": {"ResourceType": ["CloudConnector"]}}, {"type": "document", "fill": {"DocumentName": "ResourceId"}, "when": {"ResourceType": ["Document"]}}, {"type": "maintenancewindow", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["MaintenanceWindow"]}}, {"type": "managed-instance", "fill": {"InstanceId": "ResourceId"}, "when": {"ResourceType": ["ManagedInstance"]}}, {"type": "opsitem", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["OpsItem"]}}, {"type": "opsmetadata", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["OpsMetadata"]}}, {"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "ResourceId"}, "when": {"ResourceType": ["Parameter"]}}, {"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "ResourceId"}, "when": {"ResourceType": ["PatchBaseline"]}}]}, + "ssm:ModifyDocumentPermission": {"action": "ssm:ModifyDocumentPermission", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:PutComplianceItems": {"action": "ssm:PutComplianceItems", "types": ["instance", "managed-instance"], "resources": []}, + "ssm:PutInventory": {"action": "ssm:PutInventory", "types": [], "resources": [], "makes": [{"type": "managed-instance-inventory", "fill": {"InstanceId": "InstanceId"}}]}, + "ssm:PutParameter": {"action": "ssm:PutParameter", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Name"}}]}, + "ssm:PutResourcePolicy": {"action": "ssm:PutResourcePolicy", "types": ["document", "opsitemgroup", "parameter"], "resources": [{"types": ["document", "opsitemgroup", "parameter"], "arn": "ResourceArn"}]}, + "ssm:RegisterDefaultHostManagementConfiguration": {"action": "ssm:RegisterDefaultHostManagementConfiguration", "types": [], "resources": []}, + "ssm:RegisterDefaultPatchBaseline": {"action": "ssm:RegisterDefaultPatchBaseline", "types": ["patchbaseline"], "resources": [{"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "BaselineId"}}]}, + "ssm:RegisterPatchBaselineForPatchGroup": {"action": "ssm:RegisterPatchBaselineForPatchGroup", "types": ["patchbaseline"], "resources": [{"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "BaselineId"}}]}, + "ssm:RegisterTargetWithMaintenanceWindow": {"action": "ssm:RegisterTargetWithMaintenanceWindow", "types": ["maintenancewindow"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, + "ssm:RegisterTaskWithMaintenanceWindow": {"action": "ssm:RegisterTaskWithMaintenanceWindow", "types": ["maintenancewindow"], "resources": [{"types": ["maintenancewindow"], "arn": "ServiceRoleArn"}, {"types": ["maintenancewindow"], "arn": "TaskArn"}, {"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, "ssm:RemoveTagsFromResource": {"action": "ssm:RemoveTagsFromResource", "types": ["association", "automation-execution", "cloud-connector", "document", "instance", "maintenancewindow", "managed-instance", "opsitem", "opsmetadata", "parameter", "patchbaseline", "task"], "resources": [{"type": "association", "fill": {"AssociationId": "ResourceId"}, "when": {"ResourceType": ["Association"]}}, {"type": "cloud-connector", "fill": {"CloudConnectorId": "ResourceId"}, "when": {"ResourceType": ["CloudConnector"]}}, {"type": "document", "fill": {"DocumentName": "ResourceId"}, "when": {"ResourceType": ["Document"]}}, {"type": "maintenancewindow", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["MaintenanceWindow"]}}, {"type": "managed-instance", "fill": {"InstanceId": "ResourceId"}, "when": {"ResourceType": ["ManagedInstance"]}}, {"type": "opsitem", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["OpsItem"]}}, {"type": "opsmetadata", "fill": {"ResourceId": "ResourceId"}, "when": {"ResourceType": ["OpsMetadata"]}}, {"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "ResourceId"}, "when": {"ResourceType": ["Parameter"]}}, {"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "ResourceId"}, "when": {"ResourceType": ["PatchBaseline"]}}]}, + "ssm:ResetServiceSetting": {"action": "ssm:ResetServiceSetting", "types": ["servicesetting"], "resources": [{"type": "servicesetting", "fill": {"ResourceId": "SettingId"}}]}, + "ssm:ResumeSession": {"action": "ssm:ResumeSession", "types": ["session"], "resources": [{"type": "session", "fill": {"SessionId": "SessionId"}}]}, + "ssm:SendAutomationSignal": {"action": "ssm:SendAutomationSignal", "types": ["automation-execution"], "resources": [{"type": "automation-execution", "fill": {"AutomationExecutionId": "AutomationExecutionId"}}]}, + "ssm:SendCommand": {"action": "ssm:SendCommand", "types": ["bucket", "document", "instance", "managed-instance"], "resources": [{"types": ["bucket", "document", "instance", "managed-instance"], "arn": "NotificationConfig.NotificationArn"}, {"types": ["bucket", "document", "instance", "managed-instance"], "arn": "ServiceRoleArn"}, {"type": "bucket", "fill": {"BucketName": "OutputS3BucketName"}}, {"type": "document", "fill": {"DocumentName": "DocumentName"}}]}, + "ssm:StartAccessRequest": {"action": "ssm:StartAccessRequest", "types": ["instance", "managed-instance"], "resources": []}, + "ssm:StartAssociationsOnce": {"action": "ssm:StartAssociationsOnce", "types": ["association"], "resources": [{"type": "association", "fill": {"AssociationId": "AssociationIds[]"}}]}, + "ssm:StartAutomationExecution": {"action": "ssm:StartAutomationExecution", "types": ["automation-definition", "automation-execution", "document"], "resources": [{"type": "automation-definition", "fill": {"VersionId": "DocumentVersion"}}, {"type": "automation-execution", "fill": {}, "made": true}, {"type": "document", "fill": {"DocumentName": "DocumentName"}}]}, + "ssm:StartChangeRequestExecution": {"action": "ssm:StartChangeRequestExecution", "types": ["automation-definition", "automation-execution", "document"], "resources": [{"type": "automation-definition", "fill": {"VersionId": "DocumentVersion"}}, {"type": "document", "fill": {"DocumentName": "DocumentName"}}]}, + "ssm:StartExecutionPreview": {"action": "ssm:StartExecutionPreview", "types": [], "resources": []}, + "ssm:StartSession": {"action": "ssm:StartSession", "types": ["document", "instance", "managed-instance", "task"], "resources": [{"type": "document", "fill": {"DocumentName": "DocumentName"}}]}, + "ssm:StopAutomationExecution": {"action": "ssm:StopAutomationExecution", "types": ["automation-execution"], "resources": [{"type": "automation-execution", "fill": {"AutomationExecutionId": "AutomationExecutionId"}}]}, + "ssm:TerminateSession": {"action": "ssm:TerminateSession", "types": ["session"], "resources": [{"type": "session", "fill": {"SessionId": "SessionId"}}]}, + "ssm:UnlabelParameterVersion": {"action": "ssm:UnlabelParameterVersion", "types": ["parameter"], "resources": [{"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "Name"}}]}, + "ssm:UpdateAssociation": {"action": "ssm:UpdateAssociation", "types": ["association", "document", "instance", "managed-instance"], "resources": [{"type": "association", "fill": {"AssociationId": "AssociationId"}}, {"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:UpdateAssociationStatus": {"action": "ssm:UpdateAssociationStatus", "types": ["document", "instance", "managed-instance"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:UpdateCloudConnector": {"action": "ssm:UpdateCloudConnector", "types": ["cloud-connector"], "resources": [{"type": "cloud-connector", "fill": {"CloudConnectorId": "CloudConnectorId"}}]}, + "ssm:UpdateDocument": {"action": "ssm:UpdateDocument", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:UpdateDocumentDefaultVersion": {"action": "ssm:UpdateDocumentDefaultVersion", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:UpdateDocumentMetadata": {"action": "ssm:UpdateDocumentMetadata", "types": ["document"], "resources": [{"type": "document", "fill": {"DocumentName": "Name"}}]}, + "ssm:UpdateMaintenanceWindow": {"action": "ssm:UpdateMaintenanceWindow", "types": ["maintenancewindow"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}]}, + "ssm:UpdateMaintenanceWindowTarget": {"action": "ssm:UpdateMaintenanceWindowTarget", "types": ["maintenancewindow", "windowtarget"], "resources": [{"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}, {"type": "windowtarget", "fill": {"WindowTargetId": "WindowTargetId"}}]}, + "ssm:UpdateMaintenanceWindowTask": {"action": "ssm:UpdateMaintenanceWindowTask", "types": ["maintenancewindow", "windowtask"], "resources": [{"types": ["maintenancewindow", "windowtask"], "arn": "ServiceRoleArn"}, {"types": ["maintenancewindow", "windowtask"], "arn": "TaskArn"}, {"type": "maintenancewindow", "fill": {"ResourceId": "WindowId"}}, {"type": "windowtask", "fill": {"WindowTaskId": "WindowTaskId"}}]}, + "ssm:UpdateManagedInstanceRole": {"action": "ssm:UpdateManagedInstanceRole", "types": ["iam-role", "managed-instance"], "resources": [{"type": "iam-role", "fill": {"RoleName": "IamRole"}}, {"type": "managed-instance", "fill": {"InstanceId": "InstanceId"}}]}, + "ssm:UpdateOpsItem": {"action": "ssm:UpdateOpsItem", "types": ["opsitem"], "resources": [{"types": ["opsitem"], "arn": "Notifications[].Arn"}, {"types": ["opsitem"], "arn": "OpsItemArn"}, {"type": "opsitem", "fill": {"ResourceId": "OpsItemId"}}]}, + "ssm:UpdateOpsMetadata": {"action": "ssm:UpdateOpsMetadata", "types": ["opsmetadata"], "resources": [{"types": ["opsmetadata"], "arn": "OpsMetadataArn"}]}, + "ssm:UpdatePatchBaseline": {"action": "ssm:UpdatePatchBaseline", "types": ["patchbaseline"], "resources": [{"type": "patchbaseline", "fill": {"PatchBaselineIdResourceId": "BaselineId"}}]}, + "ssm:UpdateResourceDataSync": {"action": "ssm:UpdateResourceDataSync", "types": ["resourcedatasync"], "resources": [{"type": "resourcedatasync", "fill": {"SyncName": "SyncName"}}]}, + "ssm:UpdateServiceSetting": {"action": "ssm:UpdateServiceSetting", "types": ["servicesetting"], "resources": [{"type": "servicesetting", "fill": {"ResourceId": "SettingId"}}]}, + "ssm:ValidateCloudConnector": {"action": "ssm:ValidateCloudConnector", "types": ["cloud-connector"], "resources": [{"type": "cloud-connector", "fill": {"CloudConnectorId": "CloudConnectorId"}}]}, "sso:AddRegion": {"action": "sso:AddRegion", "types": ["Instance"], "resources": [{"types": ["Instance"], "arn": "InstanceArn"}]}, "sso:AttachCustomerManagedPolicyReferenceToPermissionSet": {"action": "sso:AttachCustomerManagedPolicyReferenceToPermissionSet", "types": ["Instance", "PermissionSet"], "resources": [{"types": ["Instance", "PermissionSet"], "arn": "InstanceArn"}, {"types": ["Instance", "PermissionSet"], "arn": "PermissionSetArn"}]}, "sso:AttachManagedPolicyToPermissionSet": {"action": "sso:AttachManagedPolicyToPermissionSet", "types": ["Instance", "PermissionSet"], "resources": [{"types": ["Instance", "PermissionSet"], "arn": "InstanceArn"}, {"types": ["Instance", "PermissionSet"], "arn": "ManagedPolicyArn"}, {"types": ["Instance", "PermissionSet"], "arn": "PermissionSetArn"}]}, diff --git a/src/test/java/io/floci/aws/core/common/RequestResourceMembersTest.java b/src/test/java/io/floci/aws/core/common/RequestResourceMembersTest.java index f3a3ed4951..6b3b3cf024 100644 --- a/src/test/java/io/floci/aws/core/common/RequestResourceMembersTest.java +++ b/src/test/java/io/floci/aws/core/common/RequestResourceMembersTest.java @@ -91,7 +91,7 @@ class RequestResourceMembersTest { RequestResourceMembers.Table table = RequestResourceMembers.table(); assertTrue(table.namespaces().containsAll(List.of("cognito-idp", "ecr", "elasticloadbalancing", "states"))); assertTrue(table.handBuilt().contains("lambda")); - assertEquals(Set.of("dynamodb", "logs", "ssm"), table.namespaces().stream().filter(table.handBuilt()::contains) + assertEquals(Set.of("dynamodb", "logs"), table.namespaces().stream().filter(table.handBuilt()::contains) .collect(Collectors.toSet())); Set logsDelivery = Stream.of("PutDeliverySource", "GetDeliverySource", "DeleteDeliverySource", "DescribeDeliverySources", "PutDeliveryDestination", "GetDeliveryDestination", @@ -101,8 +101,6 @@ class RequestResourceMembersTest { Set expected = new HashSet<>(logsDelivery); expected.add("dynamodb:ListTables"); expected.add("logs:PutDestination"); - Stream.of("AddTagsToResource", "ListTagsForResource", "RemoveTagsFromResource", "CreateDocument", - "CreateAssociation").forEach(operation -> expected.add("ssm:" + operation)); assertEquals(expected, table.operations().keySet().stream() .filter(operation -> table.handBuilt().contains(operation.substring(0, operation.indexOf(':')))) .collect(Collectors.toSet()), diff --git a/src/test/java/io/floci/aws/core/common/RequestResourcesTest.java b/src/test/java/io/floci/aws/core/common/RequestResourcesTest.java index 8d189f7888..393f49d7d7 100644 --- a/src/test/java/io/floci/aws/core/common/RequestResourcesTest.java +++ b/src/test/java/io/floci/aws/core/common/RequestResourcesTest.java @@ -1065,6 +1065,64 @@ class RequestResourcesTest { assertEquals(List.of(project + "a"), of("codebuild:RetryBuild", form("Action=RetryBuild&id=a:1"))); } + /** + * A Parameter Store parameter is {@code parameter/} whether its name starts with a slash or not, without the + * whitespace around it, a name of two leading slashes keeping the second and one beginning {@code /parameter/} + * keeping that; a version or a label after its name, or after its ARN, is checked on the parameter; a path is + * checked as given; and the tagging operations act on the resource of the type their {@code ResourceType} picks, + * a parameter by its name or its ARN, a legacy {@code parameter} ARN being the one the service finds for it, + * and on none without one. + */ + @Test + void aParameterIsNamedWithOrWithoutItsLeadingSlash() { + String parameter = "arn:aws:ssm:us-east-1:000000000000:parameter/"; + for (String name : List.of("/a", "a")) { + assertEquals(List.of(parameter + "a"), of("ssm:GetParameter", json("{\"Name\":\"" + name + "\"}")), name); + assertEquals(List.of(parameter + "a"), of("ssm:GetParameterHistory", json("{\"Name\":\"" + name + "\"}"))); + assertEquals(List.of(parameter + "a"), of("ssm:LabelParameterVersion", + json("{\"Name\":\"" + name + "\",\"Labels\":[\"l\"]}"))); + } + assertEquals(List.of(parameter + "/x"), of("ssm:GetParameter", json("{\"Name\":\"//x\"}"))); + assertEquals(List.of(parameter + "parameter/x"), of("ssm:GetParameter", + json("{\"Name\":\"/parameter/x\"}"))); + assertEquals(List.of(parameter + "x"), of("ssm:GetParameter", json("{\"Name\":\"x:1\"}"))); + assertEquals(List.of(parameter + "x"), of("ssm:GetParameter", json("{\"Name\":\"/x:prod\"}"))); + assertEquals(List.of(parameter + "x"), of("ssm:GetParameter", json("{\"Name\":\"" + parameter + "x:1\"}"))); + assertEquals(List.of(parameter + "a", parameter + "b"), of("ssm:GetParameters", + json("{\"Names\":[\"/a\",\"b:2\"]}"))); + assertEquals(List.of(parameter + "a/"), of("ssm:GetParametersByPath", json("{\"Path\":\"/a/\"}"))); + assertEquals(List.of(parameter + "a"), of("ssm:GetParametersByPath", json("{\"Path\":\"/a\"}"))); + assertEquals(List.of(parameter), of("ssm:GetParametersByPath", json("{\"Path\":\"/\"}"))); + assertEquals(List.of(), of("ssm:GetParametersByPath", json("{}"))); + assertEquals(List.of(parameter + "x"), of("ssm:PutParameter", json("{\"Name\":\" x \",\"Value\":\"v\"}"))); + assertEquals(List.of(parameter + "x"), of("ssm:UnlabelParameterVersion", + json("{\"Name\":\" /x \",\"Labels\":[\"l\"]}"))); + assertEquals(List.of(parameter + "x"), of("ssm:GetParameter", json("{\"Name\":\" x \"}"))); + assertEquals(List.of(parameter + "x"), of("ssm:AddTagsToResource", + json("{\"ResourceType\":\"Parameter\",\"ResourceId\":\"/x\",\"Tags\":[]}"))); + assertEquals(List.of(parameter + "x"), of("ssm:ListTagsForResource", + json("{\"ResourceType\":\"Parameter\",\"ResourceId\":\"" + parameter + "x\"}"))); + assertEquals(List.of("arn:aws:ssm:us-east-1:000000000000:document/x"), of("ssm:ListTagsForResource", + json("{\"ResourceType\":\"Document\",\"ResourceId\":\"x\"}"))); + assertEquals(List.of(), of("ssm:ListTagsForResource", json("{\"ResourceId\":\"x\"}"))); + + String legacy = "arn:aws:ssm:us-east-1:000000000000:parameterx"; + StoredResourceArns stored = new StoredResourceArns() { + @Override + public String namespace() { + return "ssm"; + } + + @Override + public Optional find(String type, List names, String region) { + return List.of(legacy).equals(names) ? Optional.of(parameter + "x") : Optional.empty(); + } + }; + assertEquals(List.of(parameter + "x"), RequestResources.of("ssm:RemoveTagsFromResource", + json("{\"ResourceType\":\"Parameter\",\"ResourceId\":\"" + legacy + "\",\"TagKeys\":[\"k\"]}"), "aws", + "us-east-1", "000000000000", stored)); + } + /** A list taking a name or an ARN for each value names each value's resource, whichever it gives. */ @Test void aListMixingNamesAndArnsNamesEachValuesResource() { diff --git a/src/test/java/io/floci/aws/services/iam/ResourceArnBuilderTest.java b/src/test/java/io/floci/aws/services/iam/ResourceArnBuilderTest.java index 80b00c4f86..529f177705 100644 --- a/src/test/java/io/floci/aws/services/iam/ResourceArnBuilderTest.java +++ b/src/test/java/io/floci/aws/services/iam/ResourceArnBuilderTest.java @@ -1711,34 +1711,23 @@ class ResourceArnBuilderTest { // ── SSM ────────────────────────────────────────────────────────────────────── @Test - void ssmBuildsArnFromNameWithLeadingSlash() { - setJsonBody("{\"Name\":\"/config/env\"}"); - String arn = builder.build("ssm", ctx, "us-east-1", "000000000000"); - assertEquals("arn:aws:ssm:us-east-1:000000000000:parameter/config/env", arn); - } - - @Test - void ssmBuildsArnFromNameWithoutLeadingSlash() { - setJsonBody("{\"Name\":\"config-key\"}"); - String arn = builder.build("ssm", ctx, "us-east-1", "000000000000"); - assertEquals("arn:aws:ssm:us-east-1:000000000000:parameter/config-key", arn); + void ssmNamesTheParameterItsNameNamesWithOrWithoutALeadingSlash() { + for (String name : List.of("/config/env", "config/env")) { + setJsonBody("{\"Name\":\"" + name + "\"}"); + assertEquals(List.of("arn:aws:ssm:us-east-1:000000000000:parameter/config/env"), + builder.buildResources("ssm", "ssm:GetParameter", ctx, "us-east-1", ACCOUNT, "aws"), name); + } } @Test void ssmResourcePolicyActionsActOnTheParameterTheirResourceArnNames() { - when(ctx.getHeaderString("X-Amz-Target")).thenReturn("AmazonSSM.PutResourcePolicy"); setJsonBody("{\"ResourceArn\":\"arn:aws:ssm:us-east-1:000000000000:parameter/prod/db\",\"Policy\":\"{}\"}"); - assertEquals("arn:aws:ssm:us-east-1:000000000000:parameter/prod/db", - builder.build("ssm", ctx, "us-east-1", "000000000000")); + assertEquals(List.of("arn:aws:ssm:us-east-1:000000000000:parameter/prod/db"), + builder.buildResources("ssm", "ssm:PutResourcePolicy", ctx, "us-east-1", ACCOUNT, "aws")); - // Any other action acts on the parameter its handler reads, its Name, whatever else the body carries. - when(ctx.getHeaderString("X-Amz-Target")).thenReturn("AmazonSSM.GetParameter"); setJsonBody("{\"Name\":\"/prod/db\",\"ResourceArn\":\"arn:aws:ssm:us-east-1:000000000000:parameter/dev/db\"}"); - assertEquals("arn:aws:ssm:us-east-1:000000000000:parameter/prod/db", - builder.build("ssm", ctx, "us-east-1", "000000000000")); - when(ctx.getHeaderString("X-Amz-Target")).thenReturn(null); - assertEquals("arn:aws:ssm:us-east-1:000000000000:parameter/prod/db", - builder.build("ssm", ctx, "us-east-1", "000000000000")); + assertEquals(List.of("arn:aws:ssm:us-east-1:000000000000:parameter/prod/db"), + builder.buildResources("ssm", "ssm:GetParameter", ctx, "us-east-1", ACCOUNT, "aws")); } // ── SQS ───────────────────────────────────────────────────────────────────── diff --git a/src/test/java/io/floci/aws/services/ssm/SsmDeleteParametersIamEnforcementIntegrationTest.java b/src/test/java/io/floci/aws/services/ssm/SsmDeleteParametersIamEnforcementIntegrationTest.java new file mode 100644 index 0000000000..e14d65ddbf --- /dev/null +++ b/src/test/java/io/floci/aws/services/ssm/SsmDeleteParametersIamEnforcementIntegrationTest.java @@ -0,0 +1,107 @@ +package io.floci.aws.services.ssm; + +import io.floci.aws.testing.AwsTestClients; +import io.floci.aws.testing.EnforcementFixtures; +import io.floci.aws.testing.IamEnforcementProfile; +import io.floci.aws.testing.PartitionCleanup; +import io.floci.aws.testing.RestAssuredJsonUtils; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.TestProfile; +import io.restassured.RestAssured; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.ssm.SsmClient; +import software.amazon.awssdk.services.ssm.model.DeleteParametersResponse; +import software.amazon.awssdk.services.ssm.model.ParameterType; +import software.amazon.awssdk.services.ssm.model.SsmException; + +import java.util.List; +import java.util.UUID; + +import static io.floci.aws.testing.EnforcementFixtures.auth; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +/** + * {@code DeleteParameters} is checked against each parameter its {@code Names} give, before any of them is + * deleted. + */ +@QuarkusTest +@TestProfile(IamEnforcementProfile.class) +class SsmDeleteParametersIamEnforcementIntegrationTest { + + private static final String ACCOUNT = "000000000000"; + + @RegisterExtension + final PartitionCleanup cleanup = new PartitionCleanup(); + + @BeforeAll + static void configureRestAssured() { + RestAssuredJsonUtils.configureAwsContentTypes(); + } + + @Test + void grantsOnEveryNamedParameterAllowTheBatchDeletion() { + String prefix = "/iam-names-delete-" + UUID.randomUUID(); + String first = prefix + "/a"; + String second = prefix + "/b"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(first).type(ParameterType.STRING).value("v")); + root.putParameter(r -> r.name(second).type(ParameterType.STRING).value("v")); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ssm:DeleteParameters", + "Resource":["arn:aws:ssm:us-east-1:000000000000:parameter%s", + "arn:aws:ssm:us-east-1:000000000000:parameter%s"]}]}""" + .formatted(first, second)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + DeleteParametersResponse deleted = user.deleteParameters(r -> r.names(first, second)); + assertEquals(List.of(first, second), deleted.deletedParameters()); + } + assertEquals(List.of(first, second), + root.getParameters(r -> r.names(first, second)).invalidParameters()); + } finally { + root.deleteParameters(r -> r.names(first, second)); + } + } + } + + @Test + void aDenyOnOneNamedParameterRefusesTheBatchAndDeletesNeither() { + String prefix = "/iam-names-delete-" + UUID.randomUUID(); + String allowed = prefix + "/allowed"; + String denied = prefix + "/denied"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(allowed).type(ParameterType.STRING).value("v")); + root.putParameter(r -> r.name(denied).type(ParameterType.STRING).value("v")); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[ + {"Effect":"Allow","Action":"ssm:DeleteParameters", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter/*"}, + {"Effect":"Deny","Action":"ssm:DeleteParameters", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(denied)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + SsmException refused = assertThrows(SsmException.class, + () -> user.deleteParameters(r -> r.names(allowed, denied))); + assertEquals("AccessDeniedException", refused.awsErrorDetails().errorCode()); + } + assertEquals(2, root.getParameters(r -> r.names(allowed, denied)).parameters().size()); + } finally { + root.deleteParameters(r -> r.names(allowed, denied)); + } + } + } + + private EnforcementFixtures.UserCredentials user(String policy) { + String userName = "ssm-delete-" + UUID.randomUUID(); + EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser( + cleanup, RestAssured.port, auth(ACCOUNT, "iam"), userName); + EnforcementFixtures.putUserPolicy(RestAssured.port, auth(ACCOUNT, "iam"), userName, "p", policy); + return credentials; + } +} diff --git a/src/test/java/io/floci/aws/services/ssm/SsmIntegrationTest.java b/src/test/java/io/floci/aws/services/ssm/SsmIntegrationTest.java index c14caa8649..6d6bae596f 100644 --- a/src/test/java/io/floci/aws/services/ssm/SsmIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/ssm/SsmIntegrationTest.java @@ -1771,6 +1771,73 @@ class SsmIntegrationTest { .body("DeletedParameters", hasSize(2)); } + @Test + void taggingRefusesAResourceTypeWhoseTagsAreNotKept() { + String name = "tag-type-" + System.nanoTime(); + putFilterFixture(name, "String", ""); + + given() + .header("X-Amz-Target", "AmazonSSM.AddTagsToResource") + .contentType(SSM_CONTENT_TYPE) + .body(""" + { "ResourceType": "MaintenanceWindow", "ResourceId": "%s", "Tags": [{"Key": "env", "Value": "dev"}] } + """.formatted(name)) + .when() + .post("/") + .then() + .statusCode(400) + .body("__type", equalTo("InvalidResourceType")); + + given() + .header("X-Amz-Target", "AmazonSSM.ListTagsForResource") + .contentType(SSM_CONTENT_TYPE) + .body(""" + { "ResourceType": "Bucket", "ResourceId": "%s" } + """.formatted(name)) + .when() + .post("/") + .then() + .statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", containsString("'resourceType'")); + + given() + .header("X-Amz-Target", "AmazonSSM.RemoveTagsFromResource") + .contentType(SSM_CONTENT_TYPE) + .body(""" + { "ResourceId": "%s", "TagKeys": ["env"] } + """.formatted(name)) + .when() + .post("/") + .then() + .statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", containsString("'resourceType'")); + + given() + .header("X-Amz-Target", "AmazonSSM.DeleteParameter") + .contentType(SSM_CONTENT_TYPE) + .body("{ \"Name\": \"" + name + "\" }") + .when() + .post("/") + .then() + .statusCode(200); + } + + @Test + void getParametersByPathRefusesARequestWithoutAPath() { + given() + .header("X-Amz-Target", "AmazonSSM.GetParametersByPath") + .contentType(SSM_CONTENT_TYPE) + .body("{ \"Recursive\": true }") + .when() + .post("/") + .then() + .statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", containsString("'path'")); + } + private String parameterArn(String name, String expectedArnSuffix) { return given() .header("X-Amz-Target", "AmazonSSM.GetParameter") diff --git a/src/test/java/io/floci/aws/services/ssm/SsmParameterReadIamEnforcementIntegrationTest.java b/src/test/java/io/floci/aws/services/ssm/SsmParameterReadIamEnforcementIntegrationTest.java new file mode 100644 index 0000000000..3f999a2a6a --- /dev/null +++ b/src/test/java/io/floci/aws/services/ssm/SsmParameterReadIamEnforcementIntegrationTest.java @@ -0,0 +1,301 @@ +package io.floci.aws.services.ssm; + +import io.floci.aws.testing.AwsTestClients; +import io.floci.aws.testing.EnforcementFixtures; +import io.floci.aws.testing.IamEnforcementProfile; +import io.floci.aws.testing.PartitionCleanup; +import io.floci.aws.testing.RestAssuredJsonUtils; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.TestProfile; +import io.restassured.RestAssured; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.ssm.SsmClient; +import software.amazon.awssdk.services.ssm.model.GetParametersByPathResponse; +import software.amazon.awssdk.services.ssm.model.GetParametersResponse; +import software.amazon.awssdk.services.ssm.model.ParameterType; +import software.amazon.awssdk.services.ssm.model.SsmException; + +import java.util.List; +import java.util.UUID; + +import static io.floci.aws.testing.EnforcementFixtures.auth; +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.containsString; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +/** + * {@code GetParametersByPath} is checked against the parameter its {@code Path} names, and {@code GetParameters} + * against each parameter its {@code Names} give, without the version or label selector a name may carry. + */ +@QuarkusTest +@TestProfile(IamEnforcementProfile.class) +class SsmParameterReadIamEnforcementIntegrationTest { + + private static final String ACCOUNT = "000000000000"; + + @RegisterExtension + final PartitionCleanup cleanup = new PartitionCleanup(); + + @BeforeAll + static void configureRestAssured() { + RestAssuredJsonUtils.configureAwsContentTypes(); + } + + @Test + void aGrantOnAPathAllowsGetParametersByPathOnItAndNoOtherPath() { + String prefix = "/iam-path-read-" + UUID.randomUUID(); + String allowed = prefix + "/config"; + String other = prefix + "/secrets"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(allowed + "/key").type(ParameterType.STRING).value("v")); + root.putParameter(r -> r.name(other + "/key").type(ParameterType.STRING).value("v")); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ssm:GetParametersByPath", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(allowed)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + GetParametersByPathResponse listed = user.getParametersByPath(r -> r.path(allowed)); + assertEquals(1, listed.parameters().size()); + assertEquals(allowed + "/key", listed.parameters().getFirst().name()); + + SsmException denied = assertThrows(SsmException.class, + () -> user.getParametersByPath(r -> r.path(other))); + assertEquals("AccessDeniedException", denied.awsErrorDetails().errorCode()); + } + } finally { + root.deleteParameter(r -> r.name(allowed + "/key")); + root.deleteParameter(r -> r.name(other + "/key")); + } + } + } + + @Test + void getParametersNeedsAGrantOnEveryParameterItNames() { + String prefix = "/iam-names-read-" + UUID.randomUUID(); + String allowed = prefix + "/a"; + String other = prefix + "/b"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(allowed).type(ParameterType.STRING).value("v")); + root.putParameter(r -> r.name(other).type(ParameterType.STRING).value("v")); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ssm:GetParameters", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(allowed)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + GetParametersResponse read = user.getParameters(r -> r.names(allowed)); + assertEquals(1, read.parameters().size()); + + SsmException denied = assertThrows(SsmException.class, + () -> user.getParameters(r -> r.names(allowed, other))); + assertEquals("AccessDeniedException", denied.awsErrorDetails().errorCode()); + } + } finally { + root.deleteParameter(r -> r.name(allowed)); + root.deleteParameter(r -> r.name(other)); + } + } + } + + @Test + void aDenyOnAPathRefusesGetParametersByPathOnItWhateverNamesTheBodyCarries() { + String prefix = "/iam-path-names-" + UUID.randomUUID(); + String allowed = prefix + "/allowed"; + String other = prefix + "/secrets"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(allowed).type(ParameterType.STRING).value("v")); + root.putParameter(r -> r.name(other + "/key").type(ParameterType.STRING).value("v")); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[ + {"Effect":"Allow","Action":"ssm:GetParametersByPath", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter/*"}, + {"Effect":"Deny","Action":"ssm:GetParametersByPath", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(other)); + + given() + .header("Authorization", auth(credentials.accessKeyId(), "ssm")) + .header("X-Amz-Target", "AmazonSSM.GetParametersByPath") + .contentType("application/x-amz-json-1.1") + .body("{\"Path\":\"" + other + "\",\"Names\":[\"" + allowed + "\"]}") + .when().post("/") + .then().statusCode(400).body(containsString("AccessDeniedException")); + } finally { + root.deleteParameter(r -> r.name(allowed)); + root.deleteParameter(r -> r.name(other + "/key")); + } + } + } + + @Test + void aGrantOnAParameterAllowsReadingItsVersionsAndLabels() { + String name = "/iam-selector-read-" + UUID.randomUUID() + "/db"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(name).type(ParameterType.STRING).value("v1")); + root.putParameter(r -> r.name(name).type(ParameterType.STRING).value("v2").overwrite(true)); + root.labelParameterVersion(r -> r.name(name).parameterVersion(1L).labels("stable")); + String arn = root.getParameter(r -> r.name(name)).parameter().arn(); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[{"Effect":"Allow", + "Action":["ssm:GetParameter","ssm:GetParameters"], + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(name)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + assertEquals("v1", user.getParameter(r -> r.name(name + ":1")).parameter().value()); + assertEquals("v1", user.getParameter(r -> r.name(arn + ":stable")).parameter().value()); + GetParametersResponse read = user.getParameters(r -> r.names(name + ":2", name + ":stable")); + assertEquals(2, read.parameters().size()); + } + } finally { + root.deleteParameter(r -> r.name(name)); + } + } + } + + @Test + void aDenyOnAParameterRefusesReadingItsVersionsAndLabels() { + String name = "/iam-selector-deny-" + UUID.randomUUID() + "/db"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(name).type(ParameterType.STRING).value("v1")); + root.labelParameterVersion(r -> r.name(name).parameterVersion(1L).labels("stable")); + String arn = root.getParameter(r -> r.name(name)).parameter().arn(); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[ + {"Effect":"Allow","Action":["ssm:GetParameter","ssm:GetParameters"], + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter/*"}, + {"Effect":"Deny","Action":["ssm:GetParameter","ssm:GetParameters"], + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(name)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + for (String selected : new String[] {name + ":1", name + ":stable", arn + ":stable"}) { + SsmException denied = assertThrows(SsmException.class, + () -> user.getParameter(r -> r.name(selected))); + assertEquals("AccessDeniedException", denied.awsErrorDetails().errorCode()); + SsmException batchDenied = assertThrows(SsmException.class, + () -> user.getParameters(r -> r.names(selected))); + assertEquals("AccessDeniedException", batchDenied.awsErrorDetails().errorCode()); + } + } + } finally { + root.deleteParameter(r -> r.name(name)); + } + } + } + + @Test + void aDoubleSlashArnDoesNotReadTheParameterADenyCovers() { + String name = "/iam-double-slash-" + UUID.randomUUID(); + String doubleSlashArn = "arn:aws:ssm:us-east-1:000000000000:parameter/" + name; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(name).type(ParameterType.STRING).value("v1")); + root.labelParameterVersion(r -> r.name(name).parameterVersion(1L).labels("stable")); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[ + {"Effect":"Allow","Action":["ssm:GetParameter","ssm:GetParameters"], + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter/*"}, + {"Effect":"Deny","Action":["ssm:GetParameter","ssm:GetParameters"], + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(name)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + for (String selected : new String[] {doubleSlashArn, doubleSlashArn + ":stable"}) { + SsmException refused = assertThrows(SsmException.class, + () -> user.getParameter(r -> r.name(selected))); + assertEquals("ParameterNotFound", refused.awsErrorDetails().errorCode()); + GetParametersResponse read = user.getParameters(r -> r.names(selected)); + assertEquals(0, read.parameters().size()); + assertEquals(List.of(selected), read.invalidParameters()); + } + } + } finally { + root.deleteParameter(r -> r.name(name)); + } + } + } + + @Test + void aGrantOnAParameterWithoutALeadingSlashAllowsReadingItsVersion() { + String name = "iam-unslashed-read-" + UUID.randomUUID(); + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(name).type(ParameterType.STRING).value("v1")); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ssm:GetParameter", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter/%s"}]}""".formatted(name)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + assertEquals("v1", user.getParameter(r -> r.name(name + ":1")).parameter().value()); + assertEquals("v1", user.getParameter( + r -> r.name("arn:aws:ssm:us-east-1:000000000000:parameter/" + name)).parameter().value()); + } + } finally { + root.deleteParameter(r -> r.name(name)); + } + } + } + + @Test + void aGrantOnADoubleSlashArnAllowsOnlyThatArnThrough() { + String name = "/iam-double-slash-grant-" + UUID.randomUUID(); + String doubleSlashArn = "arn:aws:ssm:us-east-1:000000000000:parameter/" + name; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(name).type(ParameterType.STRING).value("v1")); + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ssm:GetParameter", + "Resource":"%s"}]}""".formatted(doubleSlashArn)); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + SsmException missing = assertThrows(SsmException.class, + () -> user.getParameter(r -> r.name(doubleSlashArn))); + assertEquals("ParameterNotFound", missing.awsErrorDetails().errorCode()); + + SsmException denied = assertThrows(SsmException.class, + () -> user.getParameter(r -> r.name(name))); + assertEquals("AccessDeniedException", denied.awsErrorDetails().errorCode()); + } + } finally { + root.deleteParameter(r -> r.name(name)); + } + } + } + + @Test + void aDenyOnTheRootPathRefusesGetParametersByPathOnItAndWithoutAPath() { + EnforcementFixtures.UserCredentials credentials = user(""" + {"Version":"2012-10-17","Statement":[ + {"Effect":"Allow","Action":"ssm:GetParametersByPath", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter/*"}, + {"Effect":"Deny","Action":"ssm:GetParametersByPath", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter/"}]}"""); + try (SsmClient user = AwsTestClients.create(SsmClient.builder(), credentials.accessKeyId(), + Region.US_EAST_1)) { + SsmException denied = assertThrows(SsmException.class, + () -> user.getParametersByPath(r -> r.path("/").recursive(true))); + assertEquals("AccessDeniedException", denied.awsErrorDetails().errorCode()); + } + + given() + .header("Authorization", auth(credentials.accessKeyId(), "ssm")) + .header("X-Amz-Target", "AmazonSSM.GetParametersByPath") + .contentType("application/x-amz-json-1.1") + .body("{\"Recursive\":true}") + .when().post("/") + .then().statusCode(400).body(containsString("AccessDeniedException")); + } + + private EnforcementFixtures.UserCredentials user(String policy) { + String userName = "ssm-read-" + UUID.randomUUID(); + EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser( + cleanup, RestAssured.port, auth(ACCOUNT, "iam"), userName); + EnforcementFixtures.putUserPolicy(RestAssured.port, auth(ACCOUNT, "iam"), userName, "p", policy); + return credentials; + } +} diff --git a/src/test/java/io/floci/aws/services/ssm/SsmTaggingIamEnforcementIntegrationTest.java b/src/test/java/io/floci/aws/services/ssm/SsmTaggingIamEnforcementIntegrationTest.java new file mode 100644 index 0000000000..723f3dcdc4 --- /dev/null +++ b/src/test/java/io/floci/aws/services/ssm/SsmTaggingIamEnforcementIntegrationTest.java @@ -0,0 +1,191 @@ +package io.floci.aws.services.ssm; + +import io.floci.aws.testing.AwsTestClients; +import io.floci.aws.testing.EnforcementFixtures; +import io.floci.aws.testing.IamEnforcementProfile; +import io.floci.aws.testing.PartitionCleanup; +import io.floci.aws.testing.RestAssuredJsonUtils; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.TestProfile; +import io.restassured.RestAssured; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.ssm.SsmClient; +import software.amazon.awssdk.services.ssm.model.ParameterType; +import software.amazon.awssdk.services.ssm.model.ResourceTypeForTagging; + +import java.util.UUID; + +import static io.floci.aws.testing.EnforcementFixtures.auth; +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.containsString; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** The tagging actions are checked against the parameter their {@code ResourceId} names. */ +@QuarkusTest +@TestProfile(IamEnforcementProfile.class) +class SsmTaggingIamEnforcementIntegrationTest { + + private static final String ACCOUNT = "000000000000"; + + @RegisterExtension + final PartitionCleanup cleanup = new PartitionCleanup(); + + @BeforeAll + static void configureRestAssured() { + RestAssuredJsonUtils.configureAwsContentTypes(); + } + + @Test + void aDenyOnAParameterRefusesTaggingItWhateverNameTheBodyCarries() { + String prefix = "/iam-tagging-" + UUID.randomUUID(); + String allowed = prefix + "/allowed"; + String denied = prefix + "/denied"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(allowed).type(ParameterType.STRING).value("v")); + root.putParameter(r -> r.name(denied).type(ParameterType.STRING).value("v")); + String userName = "ssm-tagging-" + UUID.randomUUID(); + EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser( + cleanup, RestAssured.port, auth(ACCOUNT, "iam"), userName); + EnforcementFixtures.putUserPolicy(RestAssured.port, auth(ACCOUNT, "iam"), userName, "p", """ + {"Version":"2012-10-17","Statement":[ + {"Effect":"Allow","Action":["ssm:AddTagsToResource","ssm:ListTagsForResource", + "ssm:RemoveTagsFromResource"],"Resource":"*"}, + {"Effect":"Deny","Action":["ssm:AddTagsToResource","ssm:ListTagsForResource", + "ssm:RemoveTagsFromResource"], + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(denied)); + + for (String operation : new String[] {"AddTagsToResource", "ListTagsForResource", + "RemoveTagsFromResource"}) { + given() + .header("Authorization", auth(credentials.accessKeyId(), "ssm")) + .header("X-Amz-Target", "AmazonSSM." + operation) + .contentType("application/x-amz-json-1.1") + .body("{\"ResourceType\":\"Parameter\",\"ResourceId\":\"" + denied + "\",\"Name\":\"" + + allowed + "\",\"Tags\":[{\"Key\":\"team\",\"Value\":\"x\"}]," + + "\"TagKeys\":[\"team\"]}") + .when().post("/") + .then().statusCode(400).body(containsString("AccessDeniedException")); + } + + given() + .header("Authorization", auth(credentials.accessKeyId(), "ssm")) + .header("X-Amz-Target", "AmazonSSM.AddTagsToResource") + .contentType("application/x-amz-json-1.1") + .body("{\"ResourceType\":\"Parameter\",\"ResourceId\":\"" + allowed + "\",\"Name\":\"" + + denied + "\",\"Tags\":[{\"Key\":\"team\",\"Value\":\"x\"}]}") + .when().post("/") + .then().statusCode(200); + + assertTrue(root.listTagsForResource(r -> r.resourceType(ResourceTypeForTagging.PARAMETER) + .resourceId(denied)).tagList().isEmpty()); + } finally { + root.deleteParameter(r -> r.name(denied)); + root.deleteParameter(r -> r.name(allowed)); + } + } + } + + @Test + void aDenyOnAParameterRefusesTaggingItByItsArnInAnotherRegion() { + String denied = "/iam-tagging-" + UUID.randomUUID() + "/denied"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(denied).type(ParameterType.STRING).value("v")); + String userName = "ssm-tagging-" + UUID.randomUUID(); + EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser( + cleanup, RestAssured.port, auth(ACCOUNT, "iam"), userName); + EnforcementFixtures.putUserPolicy(RestAssured.port, auth(ACCOUNT, "iam"), userName, "p", """ + {"Version":"2012-10-17","Statement":[ + {"Effect":"Allow","Action":"ssm:AddTagsToResource","Resource":"*"}, + {"Effect":"Deny","Action":"ssm:AddTagsToResource", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(denied)); + + given() + .header("Authorization", auth(credentials.accessKeyId(), "ssm")) + .header("X-Amz-Target", "AmazonSSM.AddTagsToResource") + .contentType("application/x-amz-json-1.1") + .body("{\"ResourceType\":\"Parameter\",\"ResourceId\":\"arn:aws:ssm:us-west-2:" + + ACCOUNT + ":parameter" + denied + + "\",\"Tags\":[{\"Key\":\"team\",\"Value\":\"x\"}]}") + .when().post("/") + .then().statusCode(400).body(containsString("AccessDeniedException")); + + assertTrue(root.listTagsForResource(r -> r.resourceType(ResourceTypeForTagging.PARAMETER) + .resourceId(denied)).tagList().isEmpty()); + } finally { + root.deleteParameter(r -> r.name(denied)); + } + } + } + + @Test + void aGrantOnAParameterAllowsTaggingItWhateverNameTheBodyCarries() { + String prefix = "/iam-tagging-grant-" + UUID.randomUUID(); + String allowed = prefix + "/allowed"; + String other = prefix + "/other"; + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(allowed).type(ParameterType.STRING).value("v")); + root.putParameter(r -> r.name(other).type(ParameterType.STRING).value("v")); + String userName = "ssm-tagging-" + UUID.randomUUID(); + EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser( + cleanup, RestAssured.port, auth(ACCOUNT, "iam"), userName); + EnforcementFixtures.putUserPolicy(RestAssured.port, auth(ACCOUNT, "iam"), userName, "p", """ + {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ssm:AddTagsToResource", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter%s"}]}""".formatted(allowed)); + + given() + .header("Authorization", auth(credentials.accessKeyId(), "ssm")) + .header("X-Amz-Target", "AmazonSSM.AddTagsToResource") + .contentType("application/x-amz-json-1.1") + .body("{\"ResourceType\":\"Parameter\",\"ResourceId\":\"" + allowed + "\",\"Name\":\"" + + other + "\",\"Tags\":[{\"Key\":\"team\",\"Value\":\"x\"}]}") + .when().post("/") + .then().statusCode(200); + + assertTrue(root.listTagsForResource(r -> r.resourceType(ResourceTypeForTagging.PARAMETER) + .resourceId(other)).tagList().isEmpty()); + } finally { + root.deleteParameter(r -> r.name(other)); + root.deleteParameter(r -> r.name(allowed)); + } + } + } + + @Test + void aLegacyArnWithoutParameterSlashIsCheckedAgainstTheParameterItTags() { + String denied = "iam-tagging-legacy-" + UUID.randomUUID(); + try (SsmClient root = AwsTestClients.create(SsmClient.builder(), ACCOUNT, Region.US_EAST_1)) { + try { + root.putParameter(r -> r.name(denied).type(ParameterType.STRING).value("v")); + String userName = "ssm-tagging-" + UUID.randomUUID(); + EnforcementFixtures.UserCredentials credentials = EnforcementFixtures.createUser( + cleanup, RestAssured.port, auth(ACCOUNT, "iam"), userName); + EnforcementFixtures.putUserPolicy(RestAssured.port, auth(ACCOUNT, "iam"), userName, "p", """ + {"Version":"2012-10-17","Statement":[ + {"Effect":"Allow","Action":"ssm:AddTagsToResource","Resource":"*"}, + {"Effect":"Deny","Action":"ssm:AddTagsToResource", + "Resource":"arn:aws:ssm:us-east-1:000000000000:parameter/%s"}]}""".formatted(denied)); + + given() + .header("Authorization", auth(credentials.accessKeyId(), "ssm")) + .header("X-Amz-Target", "AmazonSSM.AddTagsToResource") + .contentType("application/x-amz-json-1.1") + .body("{\"ResourceType\":\"Parameter\",\"ResourceId\":\"arn:aws:ssm:us-east-1:" + + ACCOUNT + ":parameter" + denied + + "\",\"Tags\":[{\"Key\":\"team\",\"Value\":\"x\"}]}") + .when().post("/") + .then().statusCode(400).body(containsString("AccessDeniedException")); + + assertTrue(root.listTagsForResource(r -> r.resourceType(ResourceTypeForTagging.PARAMETER) + .resourceId(denied)).tagList().isEmpty()); + } finally { + root.deleteParameter(r -> r.name(denied)); + } + } + } +} diff --git a/tools/aws/regen_iam_request_resources.py b/tools/aws/regen_iam_request_resources.py index d685dbf412..9a64274479 100644 --- a/tools/aws/regen_iam_request_resources.py +++ b/tools/aws/regen_iam_request_resources.py @@ -33,7 +33,10 @@ strings, or, for an ARN, a member of a structure or of each element of a list of `${SecurityGroupId}`), and it is a name for a name and an id for an id (an `Identifier` either), or the member is a bare `Name`, `Id` or `Identifier`, the variable is named after the type and the operation is about the type, its name past the verb the type's (`DescribeTargetGroups`, but not - `StartExecution` for a state machine, whose `name` is the execution's), and no member holds its ARN. + `StartExecution` for a state machine, whose `name` is the execution's), and no member holds its ARN, + or, when no member does either, a string member whose botocore shape is named after the type (Parameter Store's + `GetParametersByPath` names a hierarchy by a `Path` holding a `PSParameterName`, as `GetParameterHistory` names a + parameter by its `Name`). Of several members that could fill a variable, one naming the type before the variable wins over a bare one: the snapshot `RestoreFromClusterSnapshot` restores has the cluster its `SnapshotClusterIdentifier` names, not the `ClusterIdentifier` of the cluster it creates, and the @@ -119,9 +122,11 @@ request, never from a member a caller could add. `CLIENTS_NOT_READ` are SDK clie namespace's operations whose requests Floci does not serve, each with its reason. `UNQUALIFIED` are the resource types whose ARN a request may give with a qualifier, one more `:` past its format, and whose service checks it without one: Step Functions checks a version or an alias -on its state machine's ARN. `MINTED_IDS` are the resource types whose service follows the name their -format ends in with an id it mints, `/`, which the format leaves out and a request naming one by -its name does not give: EventBridge's connections and API destinations, whose stored ARN the reader +on its state machine's ARN, and Parameter Store a version or a label on its parameter's. A value filling a variable +named `...WithoutLeadingSlash` is read as a Parameter Store name, without the whitespace around it and one leading +`/`: a parameter's ARN is `parameter/`, whether or not its name starts with a slash. `MINTED_IDS` are the +resource types whose service follows the name their format ends in with an id it mints, `/`, which the +format leaves out and a request naming one by its name does not give: EventBridge's connections and API destinations, whose stored ARN the reader asks the service for, or else checks with that id open. `FOUND_BY` are the resource types whose ARN is all an id their service mints, which a request names by members the ARN does not hold, with those members: each operation whose request has them all names the type by them (`find`), and the reader @@ -185,8 +190,8 @@ NAMESPACES = ("access-analyzer", "account", "acm", "application-autoscaling", "a "datasync", "ec2", "ecr", "elasticloadbalancing", "elasticmapreduce", "emr-serverless", "es", "events", "firehose", "fis", "globalaccelerator", "inspector2", "kinesisanalytics", "macie2", "oam", "payment-cryptography", "quicksight", "ram", "redshift", "redshift-data", "redshift-serverless", - "rekognition", "resource-explorer-2", "route53", "servicediscovery", "servicequotas", "sso", "states", "textract", - "timestream-influxdb", "translate", "signer", "xray", "securityhub", "guardduty") + "rekognition", "resource-explorer-2", "route53", "servicediscovery", "servicequotas", "ssm", "sso", + "states", "textract", "timestream-influxdb", "translate", "signer", "xray", "securityhub", "guardduty") # SDK clients the reference lists for a namespace's operations whose requests Floci does not serve, and why: their # members are not read. @@ -205,7 +210,7 @@ QUALIFIED_MEMBERS = ("payment-cryptography",) # The namespaces whose resources ResourceArnBuilder builds itself. HAND_BUILT = ("apigateway", "bedrock", "dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "lambda", "logs", "pipes", - "resource-groups", "s3", "scheduler", "secretsmanager", "sns", "sqs", "ssm", "sts") + "resource-groups", "s3", "scheduler", "secretsmanager", "sns", "sqs", "sts") # Operations of a namespace in `HAND_BUILT` read from the reference all the same, each with its reason. _LOGS_DELIVERY = ("CloudWatch Logs vended-log delivery: its requests name a delivery source, destination or delivery " @@ -221,12 +226,6 @@ READ_IN_HAND_BUILT["logs:PutDestination"] = ( "CloudWatch Logs destination creation names the destination by destinationName, which ResourceArnBuilder " "reads from the generated request-resource table") -_SSM_TAGS = ("SSM tagging: a request names its resource by ResourceType and ResourceId, or tags the document or " - "association it creates, which the rule reads, while ResourceArnBuilder keeps building the parameter ARNs") -READ_IN_HAND_BUILT.update({f"ssm:{operation}": _SSM_TAGS - for operation in ("AddTagsToResource", "ListTagsForResource", "RemoveTagsFromResource", - "CreateDocument", "CreateAssociation")}) - _LATER = "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint" _REST = ("REST: its requests name their resources in the path, which RequestResources reads from the route a request " "matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet") @@ -594,6 +593,10 @@ UNQUALIFIED: dict[str, str] = { "states:statemachine": "Step Functions authorizes a version or an alias on its state machine's ARN, not on the " "version's or the alias's ('To authorize a version or an alias to invoke an API action, " "Step Functions uses the state machine's ARN instead of using the version ARN or alias ARN')", + "ssm:parameter": "Parameter Store reads a version or a label after a parameter's name ('To query by parameter " + "label, use \"Name\": \"name:label\". To query by parameter version, use \"Name\": " + "\"name:version\"', GetParameter's Name) and checks the read on the parameter, whose name " + "holds no colon", } # Resource types whose service follows the one variable their format ends in with an id it mints, `/`, @@ -896,6 +899,19 @@ def request_members(models: dict[str, dict], operation: str) -> dict[str, str]: return found +def member_shapes(models: dict[str, dict], operation: str) -> dict[str, str]: + """The botocore shape each top-level member of the operation's request holds, by member name, across the request's + clients.""" + found: dict[str, str] = {} + for model in models.values(): + spec = model["operations"].get(operation) + if spec is None or "input" not in spec: + continue + for name, member in model["shapes"][spec["input"]["shape"]].get("members", {}).items(): + found.setdefault(name, member["shape"]) + return found + + def enum_members(models: dict[str, dict], operation: str) -> dict[str, set[str]]: """The top-level string members of the operation's request that this file reads, with the values their enum lists; a member with no enum is left out.""" @@ -1212,9 +1228,11 @@ def compatible(member: str, variable: str) -> bool: def resources_for(operation: str, types: list[str], formats: dict[str, str], members: dict[str, str], - arn_members: set[str] | None = None, labels: dict[str, str] | None = None) -> list[dict]: + arn_members: set[str] | None = None, labels: dict[str, str] | None = None, + shapes: dict[str, str] | None = None) -> list[dict]: """The resources the rule finds the operation's request naming, as vendored entries. `labels` gives the path - segment before each bare member a REST request carries as a path label, stemmed (`path_labels`).""" + segment before each bare member a REST request carries as a path label, stemmed (`path_labels`), and `shapes` the + botocore shape each member holds (`member_shapes`).""" name = operation.split(":", 1)[1] created = stem(CREATING_RE.sub("", name)) if CREATING_RE.match(name) else None subject = stem(SUBJECT_RE.sub("", name)) @@ -1249,7 +1267,8 @@ def resources_for(operation: str, types: list[str], formats: dict[str, str], mem fill: dict[str, str] = {} for variable in sorted(variables, key=lambda v: (v == in_slot, kind_of(v) == "", v)): choice = _filling(variable, kind_stem, len(variables), {m: p for m, p in names.items() if m not in fill.values()}, - bare=bare, qualified=namespace_of(operation) in QUALIFIED_MEMBERS) + bare=bare, qualified=namespace_of(operation) in QUALIFIED_MEMBERS, + shapes=shapes if not held else None) if choice is not None: fill[variable] = choice used[kind] = choice @@ -1367,11 +1386,12 @@ def by_members_key_is_empty(kinds: list[str], filled: dict[str, dict[str, str]]) def _filling(variable: str, kind_stem: str, variables: int, names: dict[str, str], bare: set[str], - qualified: bool = False) -> str | None: + qualified: bool = False, shapes: dict[str, str] | None = None) -> str | None: """The member that fills the variable: one of a compatible kind whose stem relates to the variable's, or, for the variable named after the type or a type's only one, a member named after the type, or a - bare `Name` or `Id` among those `bare` gives, of a compatible kind; the closest of them, and a string - before a list.""" + bare `Name` or `Id` among those `bare` gives, of a compatible kind, or else a string member whose botocore + shape is named after the type, of a compatible kind (Parameter Store's `Path` and `GetParameterHistory`'s + `Name` hold a `PSParameterName`); the closest of them, and a string before a list.""" variable_stem = stem(variable) candidates = [member for member in names if stem(member) and related(stem(member), variable_stem) and compatible(member, variable)] @@ -1380,6 +1400,10 @@ def _filling(variable: str, kind_stem: str, variables: int, names: dict[str, str and ((member in bare and member.lower() in BARE) or (stem(member) and (related(stem(member), kind_stem) or (qualified and names_type(member, kind_stem)))))] + if not candidates and (related(variable_stem, kind_stem) or variables == 1): + candidates = [member for member in names if member in (shapes or {}) and not names[member].endswith("[]") + and "." not in member and stem(shapes[member]) and related(stem(shapes[member]), kind_stem) + and compatible(shapes[member], variable) and compatible(member, variable)] if not candidates: return None # A member naming the type before the variable (`SnapshotClusterIdentifier` for the snapshot's `ClusterName`, @@ -1492,7 +1516,8 @@ def entry_for(operation: str, upstream: dict, formats: dict[str, str], models: d resources = picked_by_enum(types, formats, members, enum_members(models, operation.split(":", 1)[1])) if resources is None: resources = with_through(with_found(with_parent_ids(resources_for(operation, types, formats, members, - arn_members, labels), + arn_members, labels, + member_shapes(models, operation.split(":", 1)[1])), formats, types, members), namespace_of(operation), types, members), namespace_of(operation), types, members) diff --git a/tools/aws/test_regen_iam_request_resources.py b/tools/aws/test_regen_iam_request_resources.py index 8a5003ebd3..793fc499a1 100644 --- a/tools/aws/test_regen_iam_request_resources.py +++ b/tools/aws/test_regen_iam_request_resources.py @@ -919,7 +919,7 @@ def test_the_vendored_file_is_well_formed(): for operation, entry in operations.items() if operation.startswith("events:") and "endpoint" in json.dumps(entry) for resource in entry["resources"]) # A state machine's version or alias is checked on the state machine. - assert document["unqualified"] == {"states": ["statemachine"]} + assert document["unqualified"] == {"ssm": ["parameter"], "states": ["statemachine"]} # A listener is made under a load balancer, and a rule under a listener. assert operations["elasticloadbalancing:CreateListener"]["creates"] == [ {"type": f"listener/{kind}", "parent": f"loadbalancer/{kind}/", "arn": "LoadBalancerArn"} @@ -1317,3 +1317,14 @@ def test_an_enum_value_picks_a_type_ignoring_case_and_hyphens_and_the_resource_i "when": {"ResourceType": ["ManagedInstance"]}}, {"type": "parameter", "fill": {"ParameterNameWithoutLeadingSlash": "ResourceId"}, "when": {"ResourceType": ["Parameter"]}}] + + +def test_a_member_whose_shape_is_named_after_the_type_names_it(): + assert r.resources_for("svc:GetThingsByPath", ["thing"], FORMATS, members("Path"), + shapes={"Path": "ThingName"}) == [{"type": "thing", "fill": {"ThingName": "Path"}}] + assert r.resources_for("svc:GetThingsByPath", ["thing"], FORMATS, members("Path")) == [] + # A shape named for something else, a shape of another kind, or a list names nothing. + assert r.resources_for("svc:GetThingsByPath", ["thing"], FORMATS, members("Path"), shapes={"Path": "PathString"}) == [] + assert r.resources_for("svc:GetPoolsByPath", ["pool"], FORMATS, members("Path"), shapes={"Path": "PoolName"}) == [] + assert r.resources_for("svc:GetThingsByPath", ["thing"], FORMATS, members("Paths[]"), + shapes={"Paths": "ThingName"}) == []