fix(iam): check AWS Batch by its generated routes, resources and passed roles (#9660)

Under enforcement a REST route no vendored model names runs unchecked, and AWS Batch was among them: a caller could create a compute environment with any service, instance or Spot Fleet role and register a job definition with any job or execution role, as #6255 reports. Batch's model routes are vendored, so each request is checked as its operation's action, and Batch joins the table of request resources and the passed-roles table.

The passed-roles generator reads RegisterJobDefinition's roles, each passed to ecs-tasks.amazonaws.com, alone. The Service Reference passes CreateComputeEnvironment's and UpdateComputeEnvironment's roles to batch, ec2, ecs and spotfleet without saying which member's goes where, so a vendored source, tools/aws/sources/batch-roles.json, written by tools/aws/fetch_batch_roles.py from the Batch API reference and user guide, gives each: serviceRole is trusted by batch.amazonaws.com, a compute resource's instanceRole is an instance profile whose role is trusted by ec2.amazonaws.com, spotIamFleetRole by spotfleet.amazonaws.com, and a managed instances provider's infrastructureRoleArn needs "iam:PassedToService: ecs.amazonaws.com", the update's naming the same role in the same words. SubmitServiceJob, which Floci does not serve, names its role inside the SageMaker request it queues, a string the table does not read.

The request-resources generator reads a type of two variables from a member whose documentation spells it, as it does ECS's "(family:revision)", now also where a variable shares only some of its words with the type's name, so DeregisterJobDefinition's "(name:revision)" names a job definition revision whole, not only its name, and where a member lists the form among those it takes, as SubmitJob's "definition-name, definition-name:revision, or the ARN" does, naming the revision rather than the job definition its name alone fills: "the request ARN includes the revision". BatchStoredResourceArns resolves it as Batch does, a name alone being the latest active revision a job runs, and answers the tags of what Batch stores. A member of a structure documented as "The Amazon Resource Name (ARN) of the" resource is read as one, so a job queue's computeEnvironmentOrder[].computeEnvironment is checked. No other namespace's reading changes.

A role name a path prefixes, which Batch documents ("if a role with the name bar has a path of /foo/, specify /foo/bar as the role name"), is checked on the role IAM holds under that name and path.

Batch's tag routes are served, as every namespace's the table reads, on the route its model gives, /v1/tags/{resourceArn} with the ARN encoded as an SDK sends it. Its tag-on-create reading waits: CreateComputeEnvironment is checked as batch:TagResource or batch:SetCapacityTags, and nothing says which of its tag members each is for.

Part of #6255.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-28 11:14:42 -04:00
1 parent 31d2222c93
commit 739e1274bc
24 files changed
+1046 -55

No files matched your search

+3
View File
@@ -61,6 +61,9 @@ on:
- 'tools/aws/sources/apigateway-roles.json'
- 'tools/aws/fetch_apigateway_roles.py'
- 'tools/aws/test_fetch_apigateway_roles.py'
- 'tools/aws/sources/batch-roles.json'
- 'tools/aws/fetch_batch_roles.py'
- 'tools/aws/test_fetch_batch_roles.py'
- 'src/main/resources/aws/iam-passed-network-connectors.json'
- 'tools/aws/regen_iam_passed_network_connectors.py'
- 'tools/aws/test_regen_iam_passed_network_connectors.py'
+2 -1
View File
@@ -625,7 +625,8 @@ IAM_PASSED_ROLES_PATHS := src/main/resources/aws/iam-passed-roles.json $(IAM_PAS
tools/aws/test_regen_iam_passed_roles.py tools/aws/sources/eks-roles.json tools/aws/fetch_eks_roles.py \
tools/aws/test_fetch_eks_roles.py tools/aws/sources/emr-roles.json tools/aws/fetch_emr_roles.py \
tools/aws/test_fetch_emr_roles.py tools/aws/sources/apigateway-roles.json tools/aws/fetch_apigateway_roles.py \
tools/aws/test_fetch_apigateway_roles.py
tools/aws/test_fetch_apigateway_roles.py tools/aws/sources/batch-roles.json tools/aws/fetch_batch_roles.py \
tools/aws/test_fetch_batch_roles.py
IAM_PASSED_NETWORK_CONNECTORS_PATHS := src/main/resources/aws/iam-passed-network-connectors.json \
tools/aws/regen_iam_passed_network_connectors.py $(IAM_PASSED_ROLES_GENERATOR) \
tools/aws/test_regen_iam_passed_network_connectors.py
+21 -2
View File
@@ -2591,7 +2591,7 @@ AWS Data Exports, AWS Pricing Calculator, Cost Explorer, CloudTrail, Global Acce
Timestream for InfluxDB, Amazon Redshift, the Amazon Redshift Data API, AWS Payment Cryptography, AWS DataSync, Amazon EMR,
Amazon Rekognition, IAM Identity Center, Amazon Inspector, Amazon Macie, AWS Fault Injection Service, AWS Resource
Access Manager, CloudWatch Observability Access Manager, AWS Resource Explorer, AWS Account Management, AWS Control
Catalog, Amazon OpenSearch Service, IAM Access Analyzer, AWS Security Hub, Amazon GuardDuty, Lambda, AWS Glue, Amazon SQS, Amazon SNS, Amazon Kinesis Data Streams, Amazon EventBridge Pipes, Aurora DSQL, STS, Amazon EKS, AWS Resource Groups, Amazon CloudWatch Logs, Amazon CloudWatch, Amazon Comprehend, AWS Config, AWS DMS, Amazon ElastiCache, AWS Identity Store, Amazon MemoryDB, Amazon Route 53 Resolver, Amazon SageMaker, Amazon Transcribe, AWS Transfer Family, Amazon EFS, Amazon SES, AWS AppConfig, AWS CodeArtifact and Amazon CodeGuru Reviewer they come from a table generated from AWS's Service Reference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives each
Catalog, Amazon OpenSearch Service, IAM Access Analyzer, AWS Security Hub, Amazon GuardDuty, Lambda, AWS Glue, Amazon SQS, Amazon SNS, Amazon Kinesis Data Streams, Amazon EventBridge Pipes, Aurora DSQL, STS, Amazon EKS, AWS Batch, AWS Resource Groups, Amazon CloudWatch Logs, Amazon CloudWatch, Amazon Comprehend, AWS Config, AWS DMS, Amazon ElastiCache, AWS Identity Store, Amazon MemoryDB, Amazon Route 53 Resolver, Amazon SageMaker, Amazon Transcribe, AWS Transfer Family, Amazon EFS, Amazon SES, AWS AppConfig, AWS CodeArtifact and Amazon CodeGuru Reviewer they come from a table generated from AWS's Service Reference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives each
operation's action, the resource types that action acts on with their ARN formats, and the request
members that name them: a member holding a resource's ARN, which counts when it matches the format
of a type the action acts on, or members filling the variables of a type's format. Nothing in it is
@@ -2916,7 +2916,11 @@ Formation and Amazon Inspector is one AWS authorizes on no resource type, as is
account's members, `member/*`, as nothing botocore or the Service Reference says names the member it makes by its
`account.accountId`, and needs `macie2:TagResource` when it carries tags. Amazon EFS's routes are checked on the
resources the table of request resources reads: a file system by its id, and a mount target's operations and the tag
calls on the file system or access point EFS answers their `MountTargetId` or `ResourceId` reaches. Amazon SES v2's
calls on the file system or access point EFS answers their `MountTargetId` or `ResourceId` reaches. AWS Batch's
routes are checked the same way: a compute environment, a job queue or a job definition by its name or its ARN, the
compute environments a job queue's `computeEnvironmentOrder` names, the job definition revision a `name:revision`
names, and for a job submitted from a definition's name alone the latest active revision it runs ("the request ARN
includes the revision"), each as Batch resolves it, and a job by its id. Amazon SES v2's
and Amazon Pinpoint Email's routes are checked by their routes, on the resources the table reads, as SES v1's Query
requests are by their `Action`. Two `GET` routes an SDK built before botocore moved `ListConfigurationSets` and
`ListEmailIdentities` to `POST /v2/email/list-configuration-sets` and `POST /v2/email/list-identities` still sends,
@@ -3132,6 +3136,21 @@ role each passes:
(ARN)"; "the path for this property is /name"; "only OpenAPI definition JSON/YAML files are
supported"; and each extension, what it extends and its property "in the form of an ARN of an IAM
execution role".
- **Batch:** `CreateComputeEnvironment` and `UpdateComputeEnvironment` pass `serviceRole`, by its name, a name
its path prefixes (`/foo/bar`, the role `bar` of the path `/foo/`) or its ARN, to `batch.amazonaws.com`, the roles of the instance profile a compute resource's `instanceRole` names, by its
name or its ARN, to `ec2.amazonaws.com`, and a managed instances provider's `infrastructureRoleArn` to
`ecs.amazonaws.com`; `CreateComputeEnvironment` also passes a compute resource's `spotIamFleetRole` to
`spotfleet.amazonaws.com`. All are read from the table below. The Service Reference passes their roles to those
services without saying which member's goes where, so a vendored source, `tools/aws/sources/batch-roles.json`,
written by `tools/aws/fetch_batch_roles.py` from the Batch API reference and user guide, gives each member's role:
`serviceRole` is the role "that allows AWS Batch to make calls to other AWS services on your behalf" (trusted by
`batch.amazonaws.com`), `instanceRole` "the Amazon ECS instance profile applied to Amazon EC2 instances" (its role
trusted by `ec2.amazonaws.com`), `spotIamFleetRole` "the Amazon EC2 Spot Fleet IAM role" (`spotfleet.amazonaws.com`),
and `infrastructureRoleArn` needs "the iam:PassRole permission for this role with the condition
iam:PassedToService: ecs.amazonaws.com", the update's naming the same role in the same words.
`RegisterJobDefinition` passes the `jobRoleArn`, `taskRoleArn` and `executionRoleArn` of each container and ECS task
to `ecs-tasks.amazonaws.com`. `SubmitServiceJob`, which Floci does not serve, names its role inside the SageMaker
request it queues, a string the table does not read.
- **CloudFormation:** `CreateStack`, `UpdateStack`, `DeleteStack`, `CreateChangeSet` and
`ContinueUpdateRollback` pass `RoleARN` to `cloudformation.amazonaws.com` when the request names
one. `CreateStackSet` and `UpdateStackSet` pass `AdministrationRoleARN`, or, for a self-managed
@@ -81,13 +81,20 @@ public class PassedRoleLookups {
@Override
public String roleArn(String roleName) {
return AwsArnUtils.Arn.global(partition, "iam", accountId, "role/" + roleName).toString();
return AwsArnUtils.Arn.global(partition, "iam", accountId,
"role/" + (roleName.startsWith("/") ? roleName.substring(1) : roleName)).toString();
}
@Override
public Optional<String> heldRoleArn(String roleName) {
return iamService == null ? Optional.empty()
: iamService.findRole(accountId, roleName).map(IamRole::getArn);
if (iamService == null) {
return Optional.empty();
}
// A role's name holds no slash, so one prefixed with its path names the role of that name and path.
int name = roleName.lastIndexOf('/');
return iamService.findRole(accountId, roleName.substring(name + 1))
.filter(role -> name < 0 || roleName.substring(0, name + 1).equals(role.getPath()))
.map(IamRole::getArn);
}
@Override
@@ -251,10 +251,16 @@ final class PassedRoles {
Optional<String> instanceRefreshInstanceProfile(String groupName, String templateId, String templateName,
String version);
/** The ARN of the role {@code roleName}, a name with any path, names in the request's account. */
/**
* The ARN of the role {@code roleName}, a name with any path, names in the request's account: Batch's
* {@code /foo/bar} is the role {@code bar} of the path {@code /foo/}.
*/
String roleArn(String roleName);
/** The ARN, path included, of the role IAM holds under {@code roleName}; empty when it holds none. */
/**
* The ARN, path included, of the role IAM holds under {@code roleName}, or under the name a path prefixes with
* that path; empty when it holds none.
*/
Optional<String> heldRoleArn(String roleName);
/** The type of the Service Catalog constraint {@code constraintId}; empty when there is none. */
@@ -50,8 +50,9 @@ import java.util.Optional;
* and the tags of a cluster, a snapshot, a parameter group, a subnet group, a snapshot copy grant, a snapshot
* schedule, an event subscription or an integration; SSM, for the parameter a legacy ARN names, the document of
* another account an association runs and the tags of a parameter, a document or an association; CloudFront, for the
* key value store a name names and the tags of any resource it tags; ECS, for the revision a task definition
* reference resolves to, its default cluster and the tags of a cluster, a task definition, a service, a capacity
* key value store a name names and the tags of any resource it tags; Batch, for the job definition revision a reference
* resolves to and the tags of a compute environment, a job queue, a job definition or a job; ECS, for the revision a
* task definition reference resolves to, its default cluster and the tags of a cluster, a task definition, a service, a capacity
* provider, a task or a container instance; ACM, for the tags of a certificate; Firehose, for the tags of a delivery
* stream; Cognito, for the tags of a user pool or an identity pool; OpenSearch, for the tags of a domain; Signer, for
* the tags of a signing profile; Access Analyzer, for the tags of an analyzer; Managed Service for Apache Flink, for
@@ -447,6 +447,29 @@ public class BatchService {
return tags == null ? Map.of() : tags;
}
/**
* The tags Batch holds on the compute environment, job queue, job definition revision or job the ARN names; none
* for a resource it holds none of. Reads only.
*/
synchronized Map<String, String> storedTags(String resourceArn) {
try {
return Map.copyOf(taggable(resourceArn).tags());
} catch (AwsException expected) {
// taggable refuses a resource Batch does not hold, which has no stored tags.
return Map.of();
}
}
/**
* The ARN of the job definition revision a reference names: the one a name and revision or an ARN names, whatever
* its status, and for a name alone its latest active revision, which SubmitJob runs, or else its latest; empty for
* one Batch holds none of. Reads only.
*/
synchronized Optional<String> jobDefinitionArn(String ref) {
return resolveJobDefinitionOptional(ref, false).or(() -> resolveJobDefinitionOptional(ref, true))
.map(BatchJobDefinition::getJobDefinitionArn);
}
public ObjectNode describeJobQueues(JsonNode request) {
List<String> refs = stringList(request.path("jobQueues"));
if (refs.size() > DESCRIBE_JOBS_LIMIT) {
@@ -0,0 +1,51 @@
package io.floci.aws.services.batch;
import io.floci.aws.core.common.StoredResourceArns;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* What IAM asks Batch of the resources a request names: the job definition revision a reference names, by name, name
* and revision or ARN ({@code find}), and the tags Batch holds on a compute environment, a job queue, a job
* definition revision or a job, which an {@code aws:ResourceTag} condition reads.
*/
@ApplicationScoped
public class BatchStoredResourceArns implements StoredResourceArns {
private final BatchService batch;
@Inject
public BatchStoredResourceArns(BatchService batch) {
this.batch = batch;
}
@Override
public String namespace() {
return "batch";
}
/** Batch stores no resource under a name a request fills an ARN with: a job's id is one it mints. */
@Override
public Optional<String> find(String type, List<String> names, String region) {
return Optional.empty();
}
/**
* The job definition revision a reference names, as Batch resolves it, a name alone being the latest active revision
* a submitted job runs; none for a job a request submits, whose id Batch mints, and for any other type.
*/
@Override
public Optional<String> findByMembers(String type, List<String> names, String region) {
return "job-definition-revision".equals(type) && names.size() == 1
? batch.jobDefinitionArn(names.getFirst()) : Optional.empty();
}
@Override
public Map<String, String> storedTags(String arn) {
return batch.storedTags(arn);
}
}
@@ -387,6 +387,19 @@
"ListScrapers",
"ListWorkspaces"
],
"batch": [
"DescribeComputeEnvironments",
"DescribeJobDefinitions",
"DescribeJobQueues",
"DescribeJobs",
"DescribeSchedulingPolicies",
"DescribeServiceEnvironments",
"DescribeServiceJob",
"ListConsumableResources",
"ListJobs",
"ListSchedulingPolicies",
"ListServiceJobs"
],
"bedrock": [
"AgenticRetrieveStream",
"AssociateThirdPartyKnowledgeBase",
+24 -2
View File
@@ -1,7 +1,7 @@
{
"_source": {"generator": "tools/aws/regen_iam_passed_roles.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.44.9 (installed package)", "retrieved": "2026-11-28", "note": "make iam-passed-roles-check re-derives every member from botocore; make iam-passed-roles-verify checks every operation against AWS."},
"namespaces": {"apigateway": ["apigateway", "apigatewayv2"], "application-autoscaling": ["application-autoscaling"], "aps": ["amp"], "athena": ["athena"], "autoscaling": ["autoscaling"], "budgets": ["budgets"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codebuild": ["codebuild"], "codedeploy": ["codedeploy"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticfilesystem": ["efs"], "elasticloadbalancing": ["elb-proxy"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "glue": ["glue"], "iam": ["iam"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "pipes": ["pipes"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-groups": ["resource-groups"], "s3": ["s3", "s3control"], "s3tables": ["s3tables"], "sagemaker": ["sagemaker"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "servicecatalog": ["servicecatalog"], "ses": ["mailmanager", "pinpoint-email", "ses", "sesv2"], "sns": ["sns"], "ssm": ["ssm"], "states": ["stepfunctions"], "swf": ["swf"], "textract": ["textract"], "transcribe": ["transcribe"], "transfer": ["transfer"], "translate": ["translate"], "wafv2": ["wafv2"]},
"notCovered": {"access-analyzer": "REST routes no rule maps yet", "airflow": "REST routes no rule maps yet", "appconfig": "CreateExtension and UpdateExtension pass a role in Actions{}[].RoleArn, a map of lists, which this file does not read yet", "appsync": "REST routes no rule maps yet", "aws-marketplace": "REST routes no rule maps yet", "backup": "REST routes no rule maps yet", "batch": "REST routes no rule maps yet", "bedrock": "REST routes no rule maps yet", "bedrock-agentcore": "REST routes no rule maps yet", "cloudfront": "REST routes no rule maps yet", "dlm": "REST routes no rule maps yet", "es": "REST routes no rule maps yet", "fis": "REST routes no rule maps yet", "guardduty": "REST routes no rule maps yet", "iot": "REST routes no rule maps yet", "kafka": "REST routes no rule maps yet", "macie2": "REST routes no rule maps yet", "mq": "REST routes no rule maps yet", "quicksight": "metadata-only REST subset; role passing and iam:PassRole checks are not implemented", "rum": "REST routes no rule maps yet"},
"namespaces": {"apigateway": ["apigateway", "apigatewayv2"], "application-autoscaling": ["application-autoscaling"], "aps": ["amp"], "athena": ["athena"], "autoscaling": ["autoscaling"], "batch": ["batch"], "budgets": ["budgets"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codebuild": ["codebuild"], "codedeploy": ["codedeploy"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticfilesystem": ["efs"], "elasticloadbalancing": ["elb-proxy"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "glue": ["glue"], "iam": ["iam"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "pipes": ["pipes"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-groups": ["resource-groups"], "s3": ["s3", "s3control"], "s3tables": ["s3tables"], "sagemaker": ["sagemaker"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "servicecatalog": ["servicecatalog"], "ses": ["mailmanager", "pinpoint-email", "ses", "sesv2"], "sns": ["sns"], "ssm": ["ssm"], "states": ["stepfunctions"], "swf": ["swf"], "textract": ["textract"], "transcribe": ["transcribe"], "transfer": ["transfer"], "translate": ["translate"], "wafv2": ["wafv2"]},
"notCovered": {"access-analyzer": "REST routes no rule maps yet", "airflow": "REST routes no rule maps yet", "appconfig": "CreateExtension and UpdateExtension pass a role in Actions{}[].RoleArn, a map of lists, which this file does not read yet", "appsync": "REST routes no rule maps yet", "aws-marketplace": "REST routes no rule maps yet", "backup": "REST routes no rule maps yet", "bedrock": "REST routes no rule maps yet", "bedrock-agentcore": "REST routes no rule maps yet", "cloudfront": "REST routes no rule maps yet", "dlm": "REST routes no rule maps yet", "es": "REST routes no rule maps yet", "fis": "REST routes no rule maps yet", "guardduty": "REST routes no rule maps yet", "iot": "REST routes no rule maps yet", "kafka": "REST routes no rule maps yet", "macie2": "REST routes no rule maps yet", "mq": "REST routes no rule maps yet", "quicksight": "metadata-only REST subset; role passing and iam:PassRole checks are not implemented", "rum": "REST routes no rule maps yet"},
"otherNamespaces": ["agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "aoss", "appflow", "appmesh", "apprunner", "appstream", "arc-region-switch", "backup-gateway", "backup-search", "bcm-dashboards", "braket", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "codeconnections", "codestar-connections", "cognito-sync", "comprehendmedical", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "elemental-inference", "entityresolution", "fms", "forecast", "frauddetector", "gamelift", "gameliftstreams", "geo", "grafana", "greengrass", "groundstation", "health-agent", "healthlake", "imagebuilder", "iotdeviceadvisor", "iotfleetwise", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "kafkaconnect", "kendra", "lex", "lookoutequipment", "m2", "machinelearning", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "medical-imaging", "mobiletargeting", "neptune-graph", "observabilityadmin", "odb", "omics", "opensearch", "osis", "partnercentral", "pcs", "personalize", "profile", "proton", "qbusiness", "repostspace", "resiliencehub", "rolesanywhere", "s3files", "sagemaker-geospatial", "securityagent", "securitylake", "shield", "sms-voice", "snowball", "social-messaging", "ssm-incidents", "ssm-quicksetup", "storagegateway", "supportapp", "synthetics", "timestream", "voiceid", "wellarchitected", "wisdom", "workmail", "workspaces"],
"operations": {
"apigateway:CreateApi": {"passedTo": ["apigateway"], "roles": [
@@ -77,6 +77,28 @@
{"member": "RoleARN", "passedTo": "autoscaling"}
]},
"autoscaling:UpdateAutoScalingGroup": {"passedTo": ["autoscaling"], "byHand": "the roles of each launch template's instance profile, and the service-linked and lifecycle hook roles"},
"batch:CreateComputeEnvironment": {"passedTo": ["batch", "ec2", "ecs", "spotfleet"], "roles": [
{"member": "computeResources.instanceRole", "passedTo": "ec2", "byName": true, "instanceProfile": true},
{"member": "computeResources.managedInstancesProvider.infrastructureRoleArn", "passedTo": "ecs"},
{"member": "computeResources.spotIamFleetRole", "passedTo": "spotfleet"},
{"member": "serviceRole", "passedTo": "batch", "byName": true}
]},
"batch:RegisterJobDefinition": {"passedTo": ["ecs-tasks"], "roles": [
{"member": "containerProperties.executionRoleArn", "passedTo": "ecs-tasks"},
{"member": "containerProperties.jobRoleArn", "passedTo": "ecs-tasks"},
{"member": "ecsProperties.taskProperties[].executionRoleArn", "passedTo": "ecs-tasks"},
{"member": "ecsProperties.taskProperties[].taskRoleArn", "passedTo": "ecs-tasks"},
{"member": "nodeProperties.nodeRangeProperties[].container.executionRoleArn", "passedTo": "ecs-tasks"},
{"member": "nodeProperties.nodeRangeProperties[].container.jobRoleArn", "passedTo": "ecs-tasks"},
{"member": "nodeProperties.nodeRangeProperties[].ecsProperties.taskProperties[].executionRoleArn", "passedTo": "ecs-tasks"},
{"member": "nodeProperties.nodeRangeProperties[].ecsProperties.taskProperties[].taskRoleArn", "passedTo": "ecs-tasks"}
]},
"batch:SubmitServiceJob": {"passedTo": ["sagemaker"], "notRead": "the role is a member of the request of the service the job queues, which the request holds as a string"},
"batch:UpdateComputeEnvironment": {"passedTo": ["batch", "ec2", "ecs"], "roles": [
{"member": "computeResources.instanceRole", "passedTo": "ec2", "byName": true, "instanceProfile": true},
{"member": "computeResources.managedInstancesProvider.infrastructureRoleArn", "passedTo": "ecs"},
{"member": "serviceRole", "passedTo": "batch", "byName": true}
]},
"budgets:CreateBudgetAction": {"passedTo": ["budgets"], "roles": [
{"member": "ExecutionRoleArn", "passedTo": "budgets"}
]},
@@ -1,11 +1,11 @@
{
"_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.44.9 (installed package)", "retrieved": "2026-11-28", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."},
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "apigateway": ["apigateway", "apigatewayv2"], "appconfig": ["appconfig", "appconfigdata"], "application-autoscaling": ["application-autoscaling"], "aps": ["amp"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "bedrock": ["bedrock", "bedrock-agent", "bedrock-agent-runtime", "bedrock-data-automation", "bedrock-data-automation-runtime", "bedrock-runtime"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codeartifact": ["codeartifact"], "codebuild": ["codebuild"], "codeguru-reviewer": ["codeguru-reviewer"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "dynamodb": ["dynamodb", "dynamodbstreams"], "ec2": ["ec2"], "ec2-instance-connect": ["ec2-instance-connect"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticache": ["elasticache"], "elasticfilesystem": ["efs"], "elasticloadbalancing": ["elb", "elb-proxy", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "iam": ["iam", "iam-toolbox"], "identitystore": ["identitystore"], "inspector2": ["inspector2"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "kms": ["kms"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "memorydb": ["memorydb"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "pipes": ["pipes"], "quicksight": ["quicksight"], "ram": ["ram"], "rds": ["docdb", "neptune", "rds"], "rds-data": ["rds-data"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "resource-groups": ["resource-groups"], "route53": ["route53"], "route53resolver": ["route53resolver"], "s3": ["s3", "s3control"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "sagemaker": ["sagemaker", "sagemaker-a2i-runtime", "sagemaker-edge", "sagemaker-featurestore-runtime", "sagemaker-gateway-runtime", "sagemaker-inference-router-runtime", "sagemaker-metrics", "sagemaker-runtime", "sagemakerjobruntime", "sagemakertrainingsessionruntime"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "ses": ["mailmanager", "pinpoint-email", "ses", "sesv2"], "signer": ["signer", "signer-data"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "sts": ["sts"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "transcribe": ["transcribe"], "transfer": ["transfer"], "translate": ["translate"], "xray": ["xray"]},
"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", "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", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, 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", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rules do not fill a name from, so nearly every operation's resource would be left open", "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/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "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", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment/<application>/<name>`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "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", "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", "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", "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", "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 pLine truncated
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "apigateway": ["apigateway", "apigatewayv2"], "appconfig": ["appconfig", "appconfigdata"], "application-autoscaling": ["application-autoscaling"], "aps": ["amp"], "athena": ["athena"], "batch": ["batch"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "bedrock": ["bedrock", "bedrock-agent", "bedrock-agent-runtime", "bedrock-data-automation", "bedrock-data-automation-runtime", "bedrock-runtime"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codeartifact": ["codeartifact"], "codebuild": ["codebuild"], "codeguru-reviewer": ["codeguru-reviewer"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "dynamodb": ["dynamodb", "dynamodbstreams"], "ec2": ["ec2"], "ec2-instance-connect": ["ec2-instance-connect"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticache": ["elasticache"], "elasticfilesystem": ["efs"], "elasticloadbalancing": ["elb", "elb-proxy", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "iam": ["iam", "iam-toolbox"], "identitystore": ["identitystore"], "inspector2": ["inspector2"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "kms": ["kms"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "memorydb": ["memorydb"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "pipes": ["pipes"], "quicksight": ["quicksight"], "ram": ["ram"], "rds": ["docdb", "neptune", "rds"], "rds-data": ["rds-data"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "resource-groups": ["resource-groups"], "route53": ["route53"], "route53resolver": ["route53resolver"], "s3": ["s3", "s3control"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "sagemaker": ["sagemaker", "sagemaker-a2i-runtime", "sagemaker-edge", "sagemaker-featurestore-runtime", "sagemaker-gateway-runtime", "sagemaker-inference-router-runtime", "sagemaker-metrics", "sagemaker-runtime", "sagemakerjobruntime", "sagemakertrainingsessionruntime"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "ses": ["mailmanager", "pinpoint-email", "ses", "sesv2"], "signer": ["signer", "signer-data"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "sts": ["sts"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "transcribe": ["transcribe"], "transfer": ["transfer"], "translate": ["translate"], "xray": ["xray"]},
"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", "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", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, 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", "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", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rules do not fill a name from, so nearly every operation's resource would be left open", "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/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "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", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment/<application>/<name>`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "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", "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", "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", "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", "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", "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 modelLine truncated
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifygen3", "amplifyuibuilder", "aoss", "apiportal", "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", "bcm-data-hub", "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", "end-user-messaging", "entityresolution", "evs", "finops-agent", "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", "osm", "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", "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}"}, "apigateway": {"AccessLogSettings": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/stages/${StageName}/accesslogsettings", "Account": "arn:${Partition}:apigateway:${Region}::/account", "Api": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}", "ApiKey": "arn:${Partition}:apigateway:${Region}::/apikeys/${ApiKeyId}", "ApiKeys": "arn:${Partition}:apigateway:${Region}::/apikeys", "ApiMapping": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/apimappings/${ApiMappingId}", "ApiMappings": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/apimappings", "Apis": "arn:${Partition}:apigateway:${Region}::/apis", "Authorizer": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/authorizers/${AuthorizerId}", "Authorizers": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/authorizers", "AuthorizersCache": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/stages/${StageName}/cache/authorizers", "BasePathMapping": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/basepathmappings/${BasePath}", "BasePathMappings": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/basepathmappings", "ClientCertificate": "arn:${Partition}:apigateway:${Region}::/clientcertificates/${ClientCertificateId}", "ClientCertificates": "arn:${Partition}:apigateway:${Region}::/clientcertificates", "Cors": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/cors", "Deployment": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/deployments/${DeploymentId}", "Deployments": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/deployments", "DocumentationPart": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/parts/${DocumentationPartId}", "DocumentationParts": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/parts", "DocumentationVersion": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/versions/${DocumentationVersionId}", "DocumentationVersions": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/versions", "DomainName": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}", "DomainNameAccessAssociation": "arn:${Partition}:apigateway:${Region}:${Account}:/domainnameaccessassociations/domainname/${DomainName}/${SourceType}/${SourceId}", "DomainNameAccessAssociations": "arn:${Partition}:apigateway:${Region}:${Account}:/domainnameaccessassociations", "DomainNames": "arn:${Partition}:apigateway:${Region}::/domainnames", "ExportedAPI": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/exports/${Specification}", "GatewayResponse": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/gatewayresponses/${ResponseType}", "GatewayResponses": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/gatewayresponses", "Integration": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}", "IntegrationResponse": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}/integrationresponses/${IntegrationResponseId}", "IntegrationResponses": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}/integrationresponses", "Integrations": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations", "Method": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/resources/${ResourceId}/methods/${HttpMethodType}", "MethodResponse": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/resources/${ResourceId}/methods/${HttpMethodType}/responses/${StatusCode}", "Model": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models/${ModelId}", "ModelTemplate": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models/${ModelId}/template", "Models": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models", "Portal": "arn:${Partition}:apigateway:${Region}:${Account}:/portals/${PortalId}", "PortalProduct": "arn:${Partition}:apigateway:${Region}:${Account}:/portalproducts/$Line truncated
"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}"}, "apigateway": {"AccessLogSettings": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/stages/${StageName}/accesslogsettings", "Account": "arn:${Partition}:apigateway:${Region}::/account", "Api": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}", "ApiKey": "arn:${Partition}:apigateway:${Region}::/apikeys/${ApiKeyId}", "ApiKeys": "arn:${Partition}:apigateway:${Region}::/apikeys", "ApiMapping": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/apimappings/${ApiMappingId}", "ApiMappings": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/apimappings", "Apis": "arn:${Partition}:apigateway:${Region}::/apis", "Authorizer": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/authorizers/${AuthorizerId}", "Authorizers": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/authorizers", "AuthorizersCache": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/stages/${StageName}/cache/authorizers", "BasePathMapping": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/basepathmappings/${BasePath}", "BasePathMappings": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/basepathmappings", "ClientCertificate": "arn:${Partition}:apigateway:${Region}::/clientcertificates/${ClientCertificateId}", "ClientCertificates": "arn:${Partition}:apigateway:${Region}::/clientcertificates", "Cors": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/cors", "Deployment": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/deployments/${DeploymentId}", "Deployments": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/deployments", "DocumentationPart": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/parts/${DocumentationPartId}", "DocumentationParts": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/parts", "DocumentationVersion": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/versions/${DocumentationVersionId}", "DocumentationVersions": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/versions", "DomainName": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}", "DomainNameAccessAssociation": "arn:${Partition}:apigateway:${Region}:${Account}:/domainnameaccessassociations/domainname/${DomainName}/${SourceType}/${SourceId}", "DomainNameAccessAssociations": "arn:${Partition}:apigateway:${Region}:${Account}:/domainnameaccessassociations", "DomainNames": "arn:${Partition}:apigateway:${Region}::/domainnames", "ExportedAPI": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/exports/${Specification}", "GatewayResponse": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/gatewayresponses/${ResponseType}", "GatewayResponses": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/gatewayresponses", "Integration": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}", "IntegrationResponse": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}/integrationresponses/${IntegrationResponseId}", "IntegrationResponses": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}/integrationresponses", "Integrations": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations", "Method": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/resources/${ResourceId}/methods/${HttpMethodType}", "MethodResponse": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/resources/${ResourceId}/methods/${HttpMethodType}/responses/${StatusCode}", "Model": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models/${ModelId}", "ModelTemplate": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models/${ModelId}/template", "Models": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models", "Portal": "arn:${Partition}:apigateway:${Region}:${Account}:/portals/${PortalId}", "PortalProduct": "arn:${Partition}:apigateway:${Region}:${Account}:/portalproducts/$Line truncated
"pathFormats": {"apigateway": {"/restapis/{restapi_id}/models/{model_name}/default_template (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/models/${ModelName}/default_template", "/restapis/{restapi_id}/stages/{stage_name}/cache/authorizers (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/cache/authorizers", "/restapis/{restapi_id}/stages/{stage_name}/cache/data (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/cache/data", "/restapis/{restapi_id}/stages/{stage_name}/exports/{export_type} (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/exports/${ExportType}", "/sdktypes (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/sdktypes", "/sdktypes/{sdktype_id} (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/sdktypes/${SdktypeId}", "/usageplans/{usageplanId}/keys/{keyId}/usage (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/usageplans/${UsageplanId}/keys/${KeyId}/usage", "/usageplans/{usageplanId}/usage (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/usageplans/${UsageplanId}/usage", "Authorizer (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/authorizers/${Id}", "Authorizers (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/authorizers", "Deployment (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/deployments/${Id}", "Deployments (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/deployments", "Integration (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/resources/${ResourceId}/methods/${HttpMethod}/integration", "IntegrationResponse (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/resources/${ResourceId}/methods/${HttpMethod}/integration/responses/${StatusCode}", "Model (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/models/${ModelName}", "Models (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/models", "Stage (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/stages/${StageName}", "Stages (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/stages"}},
"resourceTagKeys": {"access-analyzer": {"Analyzer": ["aws:ResourceTag/"]}, "acm": {"acme-domain-validation": ["aws:ResourceTag/"], "acme-endpoint": ["aws:ResourceTag/"], "acme-external-account-binding": ["aws:ResourceTag/"], "certificate": ["aws:ResourceTag/"]}, "apigateway": {"AccessLogSettings": ["aws:ResourceTag/"], "Api": ["aws:ResourceTag/"], "ApiKey": ["aws:ResourceTag/"], "ApiKeys": ["aws:ResourceTag/"], "ApiMapping": ["aws:ResourceTag/"], "ApiMappings": ["aws:ResourceTag/"], "Apis": ["aws:ResourceTag/"], "Authorizer": ["aws:ResourceTag/"], "Authorizers": ["aws:ResourceTag/"], "AuthorizersCache": ["aws:ResourceTag/"], "BasePathMapping": ["aws:ResourceTag/"], "BasePathMappings": ["aws:ResourceTag/"], "ClientCertificate": ["aws:ResourceTag/"], "ClientCertificates": ["aws:ResourceTag/"], "Cors": ["aws:ResourceTag/"], "Deployment": ["aws:ResourceTag/"], "Deployments": ["aws:ResourceTag/"], "DocumentationPart": ["aws:ResourceTag/"], "DocumentationParts": ["aws:ResourceTag/"], "DocumentationVersion": ["aws:ResourceTag/"], "DocumentationVersions": ["aws:ResourceTag/"], "DomainName": ["aws:ResourceTag/"], "DomainNameAccessAssociations": ["aws:ResourceTag/"], "DomainNames": ["aws:ResourceTag/"], "ExportedAPI": ["aws:ResourceTag/"], "GatewayResponse": ["aws:ResourceTag/"], "GatewayResponses": ["aws:ResourceTag/"], "Integration": ["aws:ResourceTag/"], "IntegrationResponse": ["aws:ResourceTag/"], "IntegrationResponses": ["aws:ResourceTag/"], "Integrations": ["aws:ResourceTag/"], "Method": ["aws:ResourceTag/"], "MethodResponse": ["aws:ResourceTag/"], "Model": ["aws:ResourceTag/"], "ModelTemplate": ["aws:ResourceTag/"], "Models": ["aws:ResourceTag/"], "Portal": ["aws:ResourceTag/"], "PortalProduct": ["aws:ResourceTag/"], "PrivateBasePathMapping": ["aws:ResourceTag/"], "PrivateBasePathMappings": ["aws:ResourceTag/"], "PrivateDomainName": ["aws:ResourceTag/"], "ProductPage": ["aws:ResourceTag/"], "ProductRestEndpointPage": ["aws:ResourceTag/"], "RequestValidator": ["aws:ResourceTag/"], "RequestValidators": ["aws:ResourceTag/"], "Resource": ["aws:ResourceTag/"], "Resources": ["aws:ResourceTag/"], "RestApi": ["aws:ResourceTag/"], "RestApis": ["aws:ResourceTag/"], "Route": ["aws:ResourceTag/"], "RouteRequestParameter": ["aws:ResourceTag/"], "RouteResponse": ["aws:ResourceTag/"], "RouteResponses": ["aws:ResourceTag/"], "RouteSettings": ["aws:ResourceTag/"], "Routes": ["aws:ResourceTag/"], "RoutingRule": ["aws:ResourceTag/"], "Sdk": ["aws:ResourceTag/"], "Stage": ["aws:ResourceTag/"], "Stages": ["aws:ResourceTag/"], "Template": ["aws:ResourceTag/"], "UsagePlan": ["aws:ResourceTag/"], "UsagePlanKey": ["aws:ResourceTag/"], "UsagePlanKeys": ["aws:ResourceTag/"], "UsagePlans": ["aws:ResourceTag/"], "VpcLink": ["aws:ResourceTag/"], "VpcLinks": ["aws:ResourceTag/"]}, "appconfig": {"application": ["aws:ResourceTag/"], "configuration": ["aws:ResourceTag/"], "configurationprofile": ["aws:ResourceTag/"], "deployment": ["aws:ResourceTag/"], "deploymentstrategy": ["aws:ResourceTag/"], "environment": ["aws:ResourceTag/"], "experimentdefinition": ["aws:ResourceTag/"], "experimentrun": ["aws:ResourceTag/"], "extension": ["aws:ResourceTag/"], "extensionassociation": ["aws:ResourceTag/"]}, "application-autoscaling": {"ScalableTarget": ["aws:ResourceTag/"]}, "aps": {"anomalydetector": ["aws:ResourceTag/"], "cluster": ["aws:ResourceTag/"], "rulegroupsnamespace": ["aws:ResourceTag/"], "scraper": ["aws:ResourceTag/"], "workspace": ["aws:ResourceTag/"]}, "athena": {"capacity-reservation": ["aws:ResourceTag/"], "datacatalog": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"], "system-table": ["aws:ResourceTag/"], "workgroup": ["aws:ResourceTag/"]}, "bcm-data-exports": {"billingview": ["aws:ResourceTag/"], "export": ["aws:ResourceTag/"]}, "bcm-pricing-calculator": {"bill-estimate": ["aws:ResourceTag/"], "bill-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "bedrock": {"advanced-prompt-optimization-job": ["aws:ResourceTag/"], "agent": ["aws:ResourceTag/"], "agent-alias": ["aws:ResourceTag/"], "application-inference-profile": ["aws:ResourceTag/"], "async-invoke": ["aws:ResourceTag/"], "automated-reasoning-policy": ["aws:ResourceTag/"], "automated-reasoning-policy-version": ["aws:ResourceTag/"], "blueprint": ["aws:ResourceTag/"], "blueprint-optimization-invocation": ["aws:ResourceTag/"], "custom-model": ["aws:ResourceTag/"], "custom-model-deployment": ["aws:ResourceTag/"], "data-automation-invocation-job": ["aws:ResourceTag/"], "data-automation-library": ["aws:ResourceTag/"], "data-automation-library-ingestion-job": ["aws:ResourceTag/"], "data-automation-project": ["aws:ResourceTag/"], "evaluation-job": ["aws:ResourceTag/"], "flow": ["aws:ResourceTag/"], "flow-alias": ["aws:ResourceTag/"], "guardrail": ["aws:ResourceTag/"], "imported-model": ["aws:ResourceTag/"], "knowledge-base": ["aws:ResourceTag/"], "model-copy-job": ["aws:ResourceTag/"], "model-customization-job": ["aws:ResourceTag/"], "model-evaluation-job"Line truncated
"resourceTagKeys": {"access-analyzer": {"Analyzer": ["aws:ResourceTag/"]}, "acm": {"acme-domain-validation": ["aws:ResourceTag/"], "acme-endpoint": ["aws:ResourceTag/"], "acme-external-account-binding": ["aws:ResourceTag/"], "certificate": ["aws:ResourceTag/"]}, "apigateway": {"AccessLogSettings": ["aws:ResourceTag/"], "Api": ["aws:ResourceTag/"], "ApiKey": ["aws:ResourceTag/"], "ApiKeys": ["aws:ResourceTag/"], "ApiMapping": ["aws:ResourceTag/"], "ApiMappings": ["aws:ResourceTag/"], "Apis": ["aws:ResourceTag/"], "Authorizer": ["aws:ResourceTag/"], "Authorizers": ["aws:ResourceTag/"], "AuthorizersCache": ["aws:ResourceTag/"], "BasePathMapping": ["aws:ResourceTag/"], "BasePathMappings": ["aws:ResourceTag/"], "ClientCertificate": ["aws:ResourceTag/"], "ClientCertificates": ["aws:ResourceTag/"], "Cors": ["aws:ResourceTag/"], "Deployment": ["aws:ResourceTag/"], "Deployments": ["aws:ResourceTag/"], "DocumentationPart": ["aws:ResourceTag/"], "DocumentationParts": ["aws:ResourceTag/"], "DocumentationVersion": ["aws:ResourceTag/"], "DocumentationVersions": ["aws:ResourceTag/"], "DomainName": ["aws:ResourceTag/"], "DomainNameAccessAssociations": ["aws:ResourceTag/"], "DomainNames": ["aws:ResourceTag/"], "ExportedAPI": ["aws:ResourceTag/"], "GatewayResponse": ["aws:ResourceTag/"], "GatewayResponses": ["aws:ResourceTag/"], "Integration": ["aws:ResourceTag/"], "IntegrationResponse": ["aws:ResourceTag/"], "IntegrationResponses": ["aws:ResourceTag/"], "Integrations": ["aws:ResourceTag/"], "Method": ["aws:ResourceTag/"], "MethodResponse": ["aws:ResourceTag/"], "Model": ["aws:ResourceTag/"], "ModelTemplate": ["aws:ResourceTag/"], "Models": ["aws:ResourceTag/"], "Portal": ["aws:ResourceTag/"], "PortalProduct": ["aws:ResourceTag/"], "PrivateBasePathMapping": ["aws:ResourceTag/"], "PrivateBasePathMappings": ["aws:ResourceTag/"], "PrivateDomainName": ["aws:ResourceTag/"], "ProductPage": ["aws:ResourceTag/"], "ProductRestEndpointPage": ["aws:ResourceTag/"], "RequestValidator": ["aws:ResourceTag/"], "RequestValidators": ["aws:ResourceTag/"], "Resource": ["aws:ResourceTag/"], "Resources": ["aws:ResourceTag/"], "RestApi": ["aws:ResourceTag/"], "RestApis": ["aws:ResourceTag/"], "Route": ["aws:ResourceTag/"], "RouteRequestParameter": ["aws:ResourceTag/"], "RouteResponse": ["aws:ResourceTag/"], "RouteResponses": ["aws:ResourceTag/"], "RouteSettings": ["aws:ResourceTag/"], "Routes": ["aws:ResourceTag/"], "RoutingRule": ["aws:ResourceTag/"], "Sdk": ["aws:ResourceTag/"], "Stage": ["aws:ResourceTag/"], "Stages": ["aws:ResourceTag/"], "Template": ["aws:ResourceTag/"], "UsagePlan": ["aws:ResourceTag/"], "UsagePlanKey": ["aws:ResourceTag/"], "UsagePlanKeys": ["aws:ResourceTag/"], "UsagePlans": ["aws:ResourceTag/"], "VpcLink": ["aws:ResourceTag/"], "VpcLinks": ["aws:ResourceTag/"]}, "appconfig": {"application": ["aws:ResourceTag/"], "configuration": ["aws:ResourceTag/"], "configurationprofile": ["aws:ResourceTag/"], "deployment": ["aws:ResourceTag/"], "deploymentstrategy": ["aws:ResourceTag/"], "environment": ["aws:ResourceTag/"], "experimentdefinition": ["aws:ResourceTag/"], "experimentrun": ["aws:ResourceTag/"], "extension": ["aws:ResourceTag/"], "extensionassociation": ["aws:ResourceTag/"]}, "application-autoscaling": {"ScalableTarget": ["aws:ResourceTag/"]}, "aps": {"anomalydetector": ["aws:ResourceTag/"], "cluster": ["aws:ResourceTag/"], "rulegroupsnamespace": ["aws:ResourceTag/"], "scraper": ["aws:ResourceTag/"], "workspace": ["aws:ResourceTag/"]}, "athena": {"capacity-reservation": ["aws:ResourceTag/"], "datacatalog": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"], "system-table": ["aws:ResourceTag/"], "workgroup": ["aws:ResourceTag/"]}, "batch": {"compute-environment": ["aws:ResourceTag/"], "consumable-resource": ["aws:ResourceTag/"], "job": ["aws:ResourceTag/"], "job-definition-revision": ["aws:ResourceTag/"], "job-queue": ["aws:ResourceTag/"], "quota-share": ["aws:ResourceTag/"], "scheduling-policy": ["aws:ResourceTag/"], "service-environment": ["aws:ResourceTag/"], "service-job": ["aws:ResourceTag/"]}, "bcm-data-exports": {"billingview": ["aws:ResourceTag/"], "export": ["aws:ResourceTag/"]}, "bcm-pricing-calculator": {"bill-estimate": ["aws:ResourceTag/"], "bill-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "bedrock": {"advanced-prompt-optimization-job": ["aws:ResourceTag/"], "agent": ["aws:ResourceTag/"], "agent-alias": ["aws:ResourceTag/"], "application-inference-profile": ["aws:ResourceTag/"], "async-invoke": ["aws:ResourceTag/"], "automated-reasoning-policy": ["aws:ResourceTag/"], "automated-reasoning-policy-version": ["aws:ResourceTag/"], "blueprint": ["aws:ResourceTag/"], "blueprint-optimization-invocation": ["aws:ResourceTag/"], "custom-model": ["aws:ResourceTag/"], "custom-model-deployment": ["aws:ResourceTag/"], "data-automation-invocation-job": ["aws:ResourceTag/"], "data-automation-library": ["aws:ResourceTag/"], "data-automation-library-ingestion-job": ["aws:ResourceTag/"], "dataLine truncated
"resourceKeys": {"ec2": {"capacity-reservation": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:CapacityReservationFleet": {"member": "CapacityReservationFleetId", "arn": "capacity-reservation-fleet"}, "ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:EndDateType": {"member": "EndDateType"}, "ec2:EphemeralStorage": {"member": "EphemeralStorage"}, "ec2:InstanceMatchCriteria": {"member": "InstanceMatchCriteria"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:Tenancy": {"member": "Tenancy"}}, "carrier-gateway": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "dhcp-options": {"ec2:DhcpOptionsID": {"member": "DhcpOptionsId"}}, "fpga-image": {"ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}}, "image": {"ec2:ImageID": {"member": "ImageId"}, "ec2:ImageType": {"member": "ImageType"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "instance": {"ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:InstanceID": {"member": "InstanceId"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "internet-gateway": {"ec2:InternetGatewayID": {"member": "InternetGatewayId"}}, "launch-template": {"ec2:LaunchTemplate": {"member": "LaunchTemplateId", "arn": "launch-template"}}, "network-acl": {"ec2:NetworkAclID": {"member": "NetworkAclId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "network-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:NetworkInterfaceID": {"member": "NetworkInterfaceId"}, "ec2:Subnet": {"member": "SubnetId", "arn": "subnet"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "reserved-instances": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:InstanceType": {"member": "InstanceType"}}, "route-table": {"ec2:RouteTableID": {"member": "RouteTableId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "secondary-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}}, "security-group": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "snapshot": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:SnapshotID": {"member": "SnapshotId"}, "ec2:VolumeSize": {"member": "VolumeSize"}}, "subnet": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:SubnetID": {"member": "SubnetId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "transit-gateway": {"ec2:transitGatewayId": {"member": "TransitGatewayId"}}, "transit-gateway-attachment": {"ec2:transitGatewayAttachmentId": {"member": "TransitGatewayAttachmentId"}}, "transit-gateway-connect-peer": {"ec2:transitGatewayConnectPeerId": {"member": "TransitGatewayConnectPeerId"}}, "transit-gateway-metering-policy": {"ec2:transitGatewayMeteringPolicyId": {"member": "TransitGatewayMeteringPolicyId"}}, "transit-gateway-multicast-domain": {"ec2:transitGatewayMulticastDomainId": {"member": "TransitGatewayMulticastDomainId"}}, "transit-gateway-policy-table": {"ec2:transitGatewayPolicyTableId": {"member": "TransitGatewayPolicyTableId"}}, "transit-gateway-route-table": {"ec2:transitGatewayRouteTableId": {"member": "TransitGatewayRouteTableId"}}, "transit-gateway-route-table-announcement": {"ec2:transitGatewayRouteTableAnnouncementId": {"member": "TransitGatewayRouteTableAnnouncementId"}}, "volume": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:KmsKeyId": {"member": "KmsKeyId"}, "ec2:VolumeID": {"member": "VolumeId"}, "ec2:VolumeInitializationRate": {"member": "VolumeInitializationRate"}, "ec2:VolumeType": {"member": "VolumeType"}}, "vpc": {"ec2:VpcID": {"member": "VpcId"}}, "vpc-peering-connection": {"ec2:VpcPeeringConnectionID": {"member": "VpcPeeringConnectionId"}}}},
"unqualified": {"ssm": ["parameter"], "states": ["statemachine"]},
"mintedIds": {"events": ["api-destination", "connection"]},
@@ -490,6 +490,54 @@
"athena:UpdatePreparedStatement": {"action": "athena:UpdatePreparedStatement", "types": ["workgroup"], "resources": [{"type": "workgroup", "fill": {"WorkGroupName": "WorkGroup"}, "apis": ["json/2017-05-18"]}]},
"athena:UpdateSystemTableConfiguration": {"action": "athena:UpdateSystemTableConfiguration", "types": ["system-table"], "resources": [{"type": "system-table", "fill": {"TableName": "TableName"}, "apis": ["json/2017-05-18"]}]},
"athena:UpdateWorkGroup": {"action": "athena:UpdateWorkGroup", "types": ["workgroup"], "resources": [{"type": "workgroup", "fill": {"WorkGroupName": "WorkGroup"}, "apis": ["json/2017-05-18"]}]},
"batch:CancelJob": {"action": "batch:CancelJob", "types": ["job"], "resources": [{"type": "job", "fill": {"JobId": "jobId"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:CancelJobs": {"action": "batch:CancelJob", "types": ["job"], "resources": [{"type": "job", "fill": {"JobId": "jobs[]"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:CreateComputeEnvironment": {"action": "batch:CreateComputeEnvironment", "types": ["compute-environment"], "resources": [{"types": ["compute-environment"], "arn": "eksConfiguration.eksClusterArn", "apis": ["rest-json/2016-08-10"]}, {"type": "compute-environment", "fill": {"ComputeEnvironmentName": "computeEnvironmentName"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:CreateConsumableResource": {"action": "batch:CreateConsumableResource", "types": ["consumable-resource"], "resources": [{"type": "consumable-resource", "fill": {"ConsumableResourceName": "consumableResourceName"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:CreateJobQueue": {"action": "batch:CreateJobQueue", "types": ["compute-environment", "job-queue", "scheduling-policy", "service-environment"], "resources": [{"types": ["compute-environment", "job-queue", "scheduling-policy", "service-environment"], "arn": "schedulingPolicyArn", "apis": ["rest-json/2016-08-10"]}, {"type": "compute-environment", "fill": {"ComputeEnvironmentName": "computeEnvironmentOrder[].computeEnvironment"}, "apis": ["rest-json/2016-08-10"]}, {"type": "job-queue", "fill": {"JobQueueName": "jobQueueName"}, "made": true, "apis": ["rest-json/2016-08-10"]}, {"type": "scheduling-policy", "fill": {}, "when": {"schedulingPolicyArn": [null]}, "default": true, "apis": ["rest-json/2016-08-10"]}]},
"batch:CreateQuotaShare": {"action": "batch:CreateQuotaShare", "types": ["job-queue", "quota-share"], "resources": [{"type": "job-queue", "fill": {"JobQueueName": "jobQueue"}, "apis": ["rest-json/2016-08-10"]}, {"type": "quota-share", "fill": {"JobQueueName": "jobQueue", "QuotaShareName": "quotaShareName"}, "arnOf": {"jobQueue": "job-queue"}, "made": true, "apis": ["rest-json/2016-08-10"]}]},
"batch:CreateSchedulingPolicy": {"action": "batch:CreateSchedulingPolicy", "types": ["scheduling-policy"], "resources": [{"type": "scheduling-policy", "fill": {"SchedulingPolicyName": "name"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:CreateServiceEnvironment": {"action": "batch:CreateServiceEnvironment", "types": ["service-environment"], "resources": [{"type": "service-environment", "fill": {"ServiceEnvironmentName": "serviceEnvironmentName"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:DeleteComputeEnvironment": {"action": "batch:DeleteComputeEnvironment", "types": ["compute-environment"], "resources": [{"type": "compute-environment", "fill": {"ComputeEnvironmentName": "computeEnvironment"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:DeleteConsumableResource": {"action": "batch:DeleteConsumableResource", "types": ["consumable-resource"], "resources": [{"type": "consumable-resource", "fill": {"ConsumableResourceName": "consumableResource"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:DeleteJobQueue": {"action": "batch:DeleteJobQueue", "types": ["job-queue"], "resources": [{"type": "job-queue", "fill": {"JobQueueName": "jobQueue"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:DeleteQuotaShare": {"action": "batch:DeleteQuotaShare", "types": ["quota-share"], "resources": [{"types": ["quota-share"], "arn": "quotaShareArn", "apis": ["rest-json/2016-08-10"]}]},
"batch:DeleteSchedulingPolicy": {"action": "batch:DeleteSchedulingPolicy", "types": ["scheduling-policy"], "resources": [{"types": ["scheduling-policy"], "arn": "arn", "apis": ["rest-json/2016-08-10"]}]},
"batch:DeleteServiceEnvironment": {"action": "batch:DeleteServiceEnvironment", "types": ["service-environment"], "resources": [{"type": "service-environment", "fill": {"ServiceEnvironmentName": "serviceEnvironment"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:DeregisterJobDefinition": {"action": "batch:DeregisterJobDefinition", "types": ["job-definition-revision"], "resources": [{"type": "job-definition-revision", "fill": {}, "find": ["jobDefinition"], "apis": ["rest-json/2016-08-10"]}]},
"batch:DescribeComputeEnvironments": {"action": "batch:DescribeComputeEnvironments", "types": [], "resources": []},
"batch:DescribeConsumableResource": {"action": "batch:DescribeConsumableResource", "types": ["consumable-resource"], "resources": [{"type": "consumable-resource", "fill": {"ConsumableResourceName": "consumableResource"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:DescribeJobDefinitions": {"action": "batch:DescribeJobDefinitions", "types": [], "resources": []},
"batch:DescribeJobQueues": {"action": "batch:DescribeJobQueues", "types": [], "resources": []},
"batch:DescribeJobs": {"action": "batch:DescribeJobs", "types": [], "resources": []},
"batch:DescribeQuotaShare": {"action": "batch:DescribeQuotaShare", "types": ["quota-share"], "resources": [{"types": ["quota-share"], "arn": "quotaShareArn", "apis": ["rest-json/2016-08-10"]}]},
"batch:DescribeSchedulingPolicies": {"action": "batch:DescribeSchedulingPolicies", "types": [], "resources": []},
"batch:DescribeServiceEnvironments": {"action": "batch:DescribeServiceEnvironments", "types": [], "resources": []},
"batch:DescribeServiceJob": {"action": "batch:DescribeServiceJob", "types": [], "resources": []},
"batch:GetJobQueueSnapshot": {"action": "batch:GetJobQueueSnapshot", "types": ["job-queue"], "resources": [{"type": "job-queue", "fill": {"JobQueueName": "jobQueue"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:ListConsumableResources": {"action": "batch:ListConsumableResources", "types": [], "resources": []},
"batch:ListJobs": {"action": "batch:ListJobs", "types": [], "resources": []},
"batch:ListJobsByConsumableResource": {"action": "batch:ListJobsByConsumableResource", "types": ["consumable-resource"], "resources": [{"type": "consumable-resource", "fill": {"ConsumableResourceName": "consumableResource"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:ListQuotaShares": {"action": "batch:ListQuotaShares", "types": ["job-queue"], "resources": [{"type": "job-queue", "fill": {"JobQueueName": "jobQueue"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:ListSchedulingPolicies": {"action": "batch:ListSchedulingPolicies", "types": [], "resources": []},
"batch:ListServiceJobs": {"action": "batch:ListServiceJobs", "types": [], "resources": []},
"batch:ListTagsForResource": {"action": "batch:ListTagsForResource", "types": ["compute-environment", "consumable-resource", "job", "job-definition-revision", "job-queue", "quota-share", "scheduling-policy", "service-environment", "service-job"], "resources": [{"types": ["compute-environment", "consumable-resource", "job", "job-definition-revision", "job-queue", "quota-share", "scheduling-policy", "service-environment", "service-job"], "arn": "resourceArn", "apis": ["rest-json/2016-08-10"]}], "located": {"resourceArn": "{resourceArn}"}},
"batch:RegisterJobDefinition": {"action": "batch:RegisterJobDefinition", "types": ["consumable-resource", "job-definition"], "resources": [{"types": ["consumable-resource", "job-definition"], "arn": "containerProperties.executionRoleArn", "apis": ["rest-json/2016-08-10"]}, {"types": ["consumable-resource", "job-definition"], "arn": "containerProperties.jobRoleArn", "apis": ["rest-json/2016-08-10"]}, {"type": "job-definition", "fill": {"JobDefinitionName": "jobDefinitionName"}, "made": true, "apis": ["rest-json/2016-08-10"]}]},
"batch:SubmitJob": {"action": "batch:SubmitJob", "types": ["consumable-resource", "job", "job-definition", "job-definition-revision", "job-queue"], "resources": [{"type": "job-queue", "fill": {"JobQueueName": "jobQueue"}, "apis": ["rest-json/2016-08-10"]}, {"type": "job", "fill": {}, "find": ["jobName"], "apis": ["rest-json/2016-08-10"]}, {"type": "job-definition-revision", "fill": {}, "find": ["jobDefinition"], "apis": ["rest-json/2016-08-10"]}]},
"batch:SubmitServiceJob": {"action": "batch:SubmitServiceJob", "types": ["job-queue", "quota-share", "service-job"], "resources": [{"type": "job-queue", "fill": {"JobQueueName": "jobQueue"}, "apis": ["rest-json/2016-08-10"]}, {"type": "quota-share", "fill": {"JobQueueName": "jobQueue", "QuotaShareName": "quotaShareName"}, "unless": {"quotaShareName": [null]}, "apis": ["rest-json/2016-08-10"]}, {"type": "service-job", "fill": {}, "find": ["jobName"], "apis": ["rest-json/2016-08-10"]}]},
"batch:TagResource": {"action": "batch:TagResource", "types": ["compute-environment", "consumable-resource", "job", "job-definition-revision", "job-queue", "quota-share", "scheduling-policy", "service-environment", "service-job"], "resources": [{"types": ["compute-environment", "consumable-resource", "job", "job-definition-revision", "job-queue", "quota-share", "scheduling-policy", "service-environment", "service-job"], "arn": "resourceArn", "apis": ["rest-json/2016-08-10"]}], "located": {"resourceArn": "{resourceArn}"}},
"batch:TerminateJob": {"action": "batch:TerminateJob", "types": ["job"], "resources": [{"type": "job", "fill": {"JobId": "jobId"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:TerminateJobs": {"action": "batch:TerminateJob", "types": ["job"], "resources": [{"type": "job", "fill": {"JobId": "jobs[]"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:TerminateServiceJob": {"action": "batch:TerminateServiceJob", "types": ["service-job"], "resources": [{"type": "service-job", "fill": {"JobId": "jobId"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:TerminateServiceJobs": {"action": "batch:TerminateServiceJob", "types": ["service-job"], "resources": [{"type": "service-job", "fill": {"JobId": "jobs[]"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:UntagResource": {"action": "batch:UntagResource", "types": ["compute-environment", "consumable-resource", "job", "job-definition-revision", "job-queue", "quota-share", "scheduling-policy", "service-environment", "service-job"], "resources": [{"types": ["compute-environment", "consumable-resource", "job", "job-definition-revision", "job-queue", "quota-share", "scheduling-policy", "service-environment", "service-job"], "arn": "resourceArn", "apis": ["rest-json/2016-08-10"]}], "located": {"resourceArn": "{resourceArn}"}},
"batch:UpdateComputeEnvironment": {"action": "batch:UpdateComputeEnvironment", "types": ["compute-environment"], "resources": [{"type": "compute-environment", "fill": {"ComputeEnvironmentName": "computeEnvironment"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:UpdateConsumableResource": {"action": "batch:UpdateConsumableResource", "types": ["consumable-resource"], "resources": [{"type": "consumable-resource", "fill": {"ConsumableResourceName": "consumableResource"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:UpdateJobQueue": {"action": "batch:UpdateJobQueue", "types": ["compute-environment", "job-queue", "scheduling-policy"], "resources": [{"types": ["compute-environment", "job-queue", "scheduling-policy"], "arn": "schedulingPolicyArn", "apis": ["rest-json/2016-08-10"]}, {"type": "compute-environment", "fill": {"ComputeEnvironmentName": "computeEnvironmentOrder[].computeEnvironment"}, "apis": ["rest-json/2016-08-10"]}, {"type": "job-queue", "fill": {"JobQueueName": "jobQueue"}, "apis": ["rest-json/2016-08-10"]}, {"type": "scheduling-policy", "fill": {}, "when": {"schedulingPolicyArn": [null]}, "default": true, "apis": ["rest-json/2016-08-10"]}]},
"batch:UpdateQuotaShare": {"action": "batch:UpdateQuotaShare", "types": ["quota-share"], "resources": [{"types": ["quota-share"], "arn": "quotaShareArn", "apis": ["rest-json/2016-08-10"]}]},
"batch:UpdateSchedulingPolicy": {"action": "batch:UpdateSchedulingPolicy", "types": ["scheduling-policy"], "resources": [{"types": ["scheduling-policy"], "arn": "arn", "apis": ["rest-json/2016-08-10"]}]},
"batch:UpdateServiceEnvironment": {"action": "batch:UpdateServiceEnvironment", "types": ["service-environment"], "resources": [{"type": "service-environment", "fill": {"ServiceEnvironmentName": "serviceEnvironment"}, "apis": ["rest-json/2016-08-10"]}]},
"batch:UpdateServiceJob": {"action": "batch:UpdateServiceJob", "types": ["service-job"], "resources": [{"type": "service-job", "fill": {"JobId": "jobId"}, "apis": ["rest-json/2016-08-10"]}]},
"bcm-data-exports:CreateExport": {"action": "bcm-data-exports:CreateExport", "types": ["billingview", "table"], "resources": []},
"bcm-data-exports:DeleteExport": {"action": "bcm-data-exports:DeleteExport", "types": ["export"], "resources": [{"types": ["export"], "arn": "ExportArn", "apis": ["json/2023-11-26"]}]},
"bcm-data-exports:GetExecution": {"action": "bcm-data-exports:GetExecution", "types": ["export"], "resources": [{"types": ["export"], "arn": "ExportArn", "apis": ["json/2023-11-26"]}]},
@@ -1,7 +1,7 @@
{
"_source": {"generator": "tools/aws/regen_iam_tag_on_create.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.44.9 (local/aws/botocore)", "retrieved": "2026-11-26", "note": "make iam-tag-on-create-check re-derives every member from botocore; make iam-tag-on-create-verify checks every operation against AWS."},
"namespaces": {"access-analyzer": ["accessanalyzer"], "acm": ["acm"], "appconfig": ["appconfig"], "application-autoscaling": ["application-autoscaling"], "aps": ["amp"], "athena": ["athena"], "autoscaling": ["autoscaling"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "bedrock": ["bedrock", "bedrock-agent", "bedrock-agent-runtime", "bedrock-data-automation", "bedrock-data-automation-runtime", "bedrock-runtime"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudformation"], "cloudhsm": ["cloudhsmv2"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codedeploy": ["codedeploy"], "codeguru-reviewer": ["codeguru-reviewer"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticache": ["elasticache"], "elasticfilesystem": ["efs"], "elasticloadbalancing": ["elb", "elb-proxy", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "iam": ["iam"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "kms": ["kms"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "lightsail": ["lightsail"], "logs": ["logs"], "macie2": ["macie2"], "memorydb": ["memorydb"], "network-firewall": ["network-firewall"], "oam": ["oam"], "organizations": ["organizations"], "payment-cryptography": ["payment-cryptography"], "pipes": ["pipes"], "ram": ["ram"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "resource-groups": ["resource-groups"], "route53resolver": ["route53resolver"], "s3tables": ["s3tables"], "s3vectors": [], "sagemaker": ["sagemaker"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "ses": ["mailmanager", "pinpoint-email", "ses", "sesv2"], "signer": ["signer"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso-admin"], "states": ["stepfunctions"], "sts": ["sts"], "swf": ["swf"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "transcribe": ["transcribe"], "transfer": ["transfer"], "translate": ["translate"], "wafv2": ["wafv2"], "xray": ["xray"]},
"notCovered": {"airflow": "REST routes no rule maps yet", "app-integrations": "REST routes no rule maps yet", "appsync": "REST routes no rule maps yet", "aws-marketplace": "REST routes no rule maps yet", "backup": "REST routes no rule maps yet", "batch": "REST routes no rule maps yet", "bedrock-agentcore": "REST routes no rule maps yet", "cloudfront": "its creation tags are a Tags structure holding Items, which this file does not read yet", "connect": "REST routes no rule maps yet", "detective": "REST routes no rule maps yet", "dlm": "REST routes no rule maps yet", "inspector2": "REST routes no rule maps yet", "iot": "REST routes no rule maps yet", "kafka": "REST routes no rule maps yet", "mq": "REST routes no rule maps yet", "quicksight": "metadata-only REST subset; creation-tag IAM authorization is not implemented", "rum": "REST routes no rule maps yet", "s3": "authorized by route; S3 checks s3:PutObjectTagging for an object it creates with tags itself", "servicecatalog": "its operations that tag are AppRegistry's, whose REST routes no rule maps yet"},
"notCovered": {"airflow": "REST routes no rule maps yet", "app-integrations": "REST routes no rule maps yet", "appsync": "REST routes no rule maps yet", "aws-marketplace": "REST routes no rule maps yet", "backup": "REST routes no rule maps yet", "batch": "CreateComputeEnvironment is checked as batch:TagResource or batch:SetCapacityTags, and nothing says which of its tag members each is for", "bedrock-agentcore": "REST routes no rule maps yet", "cloudfront": "its creation tags are a Tags structure holding Items, which this file does not read yet", "connect": "REST routes no rule maps yet", "detective": "REST routes no rule maps yet", "dlm": "REST routes no rule maps yet", "inspector2": "REST routes no rule maps yet", "iot": "REST routes no rule maps yet", "kafka": "REST routes no rule maps yet", "mq": "REST routes no rule maps yet", "quicksight": "metadata-only REST subset; creation-tag IAM authorization is not implemented", "rum": "REST routes no rule maps yet", "s3": "authorized by route; S3 checks s3:PutObjectTagging for an object it creates with tags itself", "servicecatalog": "its operations that tag are AppRegistry's, whose REST routes no rule maps yet"},
"otherNamespaces": ["account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifyuibuilder", "aoss", "apiportal", "appfabric", "appflow", "application-signals", "applicationinsights", "appmesh", "apprunner", "appstream", "arc-region-switch", "artifact", "auditmanager", "b2bi", "backup-gateway", "backup-search", "bcm-dashboards", "billing", "billingconductor", "braket", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "connect-campaigns", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "directconnect", "docdb-elastic", "drs", "ds", "ebs", "ecr-public", "elemental-inference", "entityresolution", "evs", "fms", "forecast", "frauddetector", "fsx", "gamelift", "gameliftstreams", "geo", "grafana", "greengrass", "groundstation", "health-agent", "healthlake", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotdeviceadvisor", "iotfleetwise", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "ivs", "ivschat", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "m2", "managedblockchain", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgn", "migrationhub-orchestrator", "mobiletargeting", "mpa", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "notifications", "notifications-contacts", "observabilityadmin", "odb", "omics", "opensearch", "osis", "outposts", "partnercentral", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "profile", "proton", "qbusiness", "rbin", "refactor-spaces", "repostspace", "resiliencehub", "rolesanywhere", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3files", "sagemaker-geospatial", "savingsplans", "schemas", "scn", "security-ir", "securityagent", "securitylake", "shield", "sms-voice", "snow-device-management", "social-messaging", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "voiceid", "vpc-lattice", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workspaces", "workspaces-instances", "workspaces-web"],
"resourceArns": {"ec2": {"application-status-check": "arn:${Partition}:ec2:${Region}:${Account}:application-status-check/*", "capacity-block": "arn:${Partition}:ec2:${Region}:${Account}:capacity-block/*", "capacity-manager-data-export": "arn:${Partition}:ec2:${Region}:${Account}:capacity-manager-data-export/*", "capacity-reservation": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation/*", "capacity-reservation-cancellation-quote": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-cancellation-quote/*", "capacity-reservation-fleet": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-fleet/*", "capacity-reservation-modification-quote": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-modification-quote/*", "carrier-gateway": "arn:${Partition}:ec2:${Region}:${Account}:carrier-gateway/*", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/*", "client-vpn-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:client-vpn-endpoint/*", "coip-pool": "arn:${Partition}:ec2:${Region}:${Account}:coip-pool/*", "customer-gateway": "arn:${Partition}:ec2:${Region}:${Account}:customer-gateway/*", "declarative-policies-report": "arn:${Partition}:ec2:${Region}:${Account}:declarative-policies-report/*", "dedicated-host": "arn:${Partition}:ec2:${Region}:${Account}:dedicated-host/*", "dhcp-options": "arn:${Partition}:ec2:${Region}:${Account}:dhcp-options/*", "egress-only-internet-gateway": "arn:${Partition}:ec2:${Region}:${Account}:egress-only-internet-gateway/*", "elastic-gpu": "arn:${Partition}:ec2:${Region}:${Account}:elastic-gpu/*", "elastic-inference": "arn:${Partition}:elastic-inference:${Region}:${Account}:elastic-inference-accelerator/*", "elastic-ip": "arn:${Partition}:ec2:${Region}:${Account}:elastic-ip/*", "export-image-task": "arn:${Partition}:ec2:${Region}:${Account}:export-image-task/*", "export-instance-task": "arn:${Partition}:ec2:${Region}:${Account}:export-instance-task/*", "fleet": "arn:${Partition}:ec2:${Region}:${Account}:fleet/*", "fpga-image": "arn:${Partition}:ec2:${Region}:${Account}:fpga-image/*", "group": "arn:${Partition}:resource-groups:${Region}:${Account}:group/*", "host-reservation": "arn:${Partition}:ec2:${Region}:${Account}:host-reservation/*", "image": "arn:${Partition}:ec2:${Region}::image/*", "image-usage-report": "arn:${Partition}:ec2:${Region}:${Account}:image-usage-report/*", "import-image-task": "arn:${Partition}:ec2:${Region}:${Account}:import-image-task/*", "import-snapshot-task": "arn:${Partition}:ec2:${Region}:${Account}:import-snapshot-task/*", "instance": "arn:${Partition}:ec2:${Region}:${Account}:instance/*", "instance-connect-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:instance-connect-endpoint/*", "instance-event-window": "arn:${Partition}:ec2:${Region}:${Account}:instance-event-window/*", "internet-gateway": "arn:${Partition}:ec2:${Region}:${Account}:internet-gateway/*", "ipam": "arn:${Partition}:ec2::${Account}:ipam/*", "ipam-external-resource-verification-token": "arn:${Partition}:ec2::${Account}:ipam-external-resource-verification-token/*", "ipam-internet-registry-association": "arn:${Partition}:ec2::${Account}:ipam-internet-registry-association/*", "ipam-policy": "arn:${Partition}:ec2::${Account}:ipam-policy/*", "ipam-pool": "arn:${Partition}:ec2::${Account}:ipam-pool/*", "ipam-pool-allocation": "arn:${Partition}:ec2:${Region}:${Account}:ipam-pool-allocation/*", "ipam-prefix-list-resolver": "arn:${Partition}:ec2::${Account}:ipam-prefix-list-resolver/*", "ipam-prefix-list-resolver-target": "arn:${Partition}:ec2::${Account}:ipam-prefix-list-resolver-target/*", "ipam-resource-discovery": "arn:${Partition}:ec2::${Account}:ipam-resource-discovery/*", "ipam-resource-discovery-association": "arn:${Partition}:ec2::${Account}:ipam-resource-discovery-association/*", "ipam-scope": "arn:${Partition}:ec2::${Account}:ipam-scope/*", "ipv4pool-ec2": "arn:${Partition}:ec2:${Region}:${Account}:ipv4pool-ec2/*", "ipv6pool-ec2": "arn:${Partition}:ec2:${Region}:${Account}:ipv6pool-ec2/*", "key-pair": "arn:${Partition}:ec2:${Region}:${Account}:key-pair/*", "launch-template": "arn:${Partition}:ec2:${Region}:${Account}:launch-template/*", "license-configuration": "arn:${Partition}:license-manager:${Region}:${Account}:license-configuration:*", "local-gateway": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway/*", "local-gateway-route-table": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table/*", "local-gateway-route-table-virtual-interface-group-association": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table-virtual-interface-group-association/*", "local-gateway-route-table-vpc-association": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table-vpc-association/*", "local-gateway-virtual-interface": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-virtual-interface/*", "local-gateway-virtual-interface-group": "arn:${Partition}:ec2:${Region}:${Account}:Line truncated
"operations": {
+54
View File
@@ -433,6 +433,60 @@
"StartConfigurationSession": {"method": "POST", "requestUri": "/configurationsessions"}
}
},
"batch": {
"credentialScope": "batch",
"apiVersion": "2016-08-10",
"operations": {
"CancelJob": {"method": "POST", "requestUri": "/v1/canceljob"},
"CancelJobs": {"method": "POST", "requestUri": "/v1/canceljobs"},
"CreateComputeEnvironment": {"method": "POST", "requestUri": "/v1/createcomputeenvironment"},
"CreateConsumableResource": {"method": "POST", "requestUri": "/v1/createconsumableresource"},
"CreateJobQueue": {"method": "POST", "requestUri": "/v1/createjobqueue"},
"CreateQuotaShare": {"method": "POST", "requestUri": "/v1/createquotashare"},
"CreateSchedulingPolicy": {"method": "POST", "requestUri": "/v1/createschedulingpolicy"},
"CreateServiceEnvironment": {"method": "POST", "requestUri": "/v1/createserviceenvironment"},
"DeleteComputeEnvironment": {"method": "POST", "requestUri": "/v1/deletecomputeenvironment"},
"DeleteConsumableResource": {"method": "POST", "requestUri": "/v1/deleteconsumableresource"},
"DeleteJobQueue": {"method": "POST", "requestUri": "/v1/deletejobqueue"},
"DeleteQuotaShare": {"method": "POST", "requestUri": "/v1/deletequotashare"},
"DeleteSchedulingPolicy": {"method": "POST", "requestUri": "/v1/deleteschedulingpolicy"},
"DeleteServiceEnvironment": {"method": "POST", "requestUri": "/v1/deleteserviceenvironment"},
"DeregisterJobDefinition": {"method": "POST", "requestUri": "/v1/deregisterjobdefinition"},
"DescribeComputeEnvironments": {"method": "POST", "requestUri": "/v1/describecomputeenvironments"},
"DescribeConsumableResource": {"method": "POST", "requestUri": "/v1/describeconsumableresource"},
"DescribeJobDefinitions": {"method": "POST", "requestUri": "/v1/describejobdefinitions"},
"DescribeJobQueues": {"method": "POST", "requestUri": "/v1/describejobqueues"},
"DescribeJobs": {"method": "POST", "requestUri": "/v1/describejobs"},
"DescribeQuotaShare": {"method": "POST", "requestUri": "/v1/describequotashare"},
"DescribeSchedulingPolicies": {"method": "POST", "requestUri": "/v1/describeschedulingpolicies"},
"DescribeServiceEnvironments": {"method": "POST", "requestUri": "/v1/describeserviceenvironments"},
"DescribeServiceJob": {"method": "POST", "requestUri": "/v1/describeservicejob"},
"GetJobQueueSnapshot": {"method": "POST", "requestUri": "/v1/getjobqueuesnapshot"},
"ListConsumableResources": {"method": "POST", "requestUri": "/v1/listconsumableresources"},
"ListJobs": {"method": "POST", "requestUri": "/v1/listjobs"},
"ListJobsByConsumableResource": {"method": "POST", "requestUri": "/v1/listjobsbyconsumableresource"},
"ListQuotaShares": {"method": "POST", "requestUri": "/v1/listquotashares"},
"ListSchedulingPolicies": {"method": "POST", "requestUri": "/v1/listschedulingpolicies"},
"ListServiceJobs": {"method": "POST", "requestUri": "/v1/listservicejobs"},
"ListTagsForResource": {"method": "GET", "requestUri": "/v1/tags/{resourceArn}"},
"RegisterJobDefinition": {"method": "POST", "requestUri": "/v1/registerjobdefinition"},
"SubmitJob": {"method": "POST", "requestUri": "/v1/submitjob"},
"SubmitServiceJob": {"method": "POST", "requestUri": "/v1/submitservicejob"},
"TagResource": {"method": "POST", "requestUri": "/v1/tags/{resourceArn}"},
"TerminateJob": {"method": "POST", "requestUri": "/v1/terminatejob"},
"TerminateJobs": {"method": "POST", "requestUri": "/v1/terminatejobs"},
"TerminateServiceJob": {"method": "POST", "requestUri": "/v1/terminateservicejob"},
"TerminateServiceJobs": {"method": "POST", "requestUri": "/v1/terminateservicejobs"},
"UntagResource": {"method": "DELETE", "requestUri": "/v1/tags/{resourceArn}"},
"UpdateComputeEnvironment": {"method": "POST", "requestUri": "/v1/updatecomputeenvironment"},
"UpdateConsumableResource": {"method": "POST", "requestUri": "/v1/updateconsumableresource"},
"UpdateJobQueue": {"method": "POST", "requestUri": "/v1/updatejobqueue"},
"UpdateQuotaShare": {"method": "POST", "requestUri": "/v1/updatequotashare"},
"UpdateSchedulingPolicy": {"method": "POST", "requestUri": "/v1/updateschedulingpolicy"},
"UpdateServiceEnvironment": {"method": "POST", "requestUri": "/v1/updateserviceenvironment"},
"UpdateServiceJob": {"method": "POST", "requestUri": "/v1/updateservicejob"}
}
},
"bedrock": {
"credentialScope": "bedrock",
"apiVersion": "2023-04-20",
@@ -4,6 +4,8 @@ import io.quarkus.test.junit.QuarkusTest;
import io.restassured.specification.RequestSpecification;
import org.junit.jupiter.api.Test;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import static io.restassured.RestAssured.given;
@@ -764,22 +766,34 @@ class BatchIntegrationTest {
void tagRoutesTagListAndUntagAResource() {
String suffix = uniqueSuffix();
String computeArn = createComputeEnvironment("batch-tags-ce-" + suffix);
// AWS serves Batch's tagging on /v1/tags/{resourceArn}, the ARN's slash encoded as an SDK sends it: one sent
// unencoded is no route of Batch's.
given()
.header("Authorization", AUTH)
.when()
.get("/v1/tags/" + computeArn)
.then()
.statusCode(400)
.body("message", equalTo("Invalid resource ARN: " + computeArn));
givenJson("{\"tags\":{\"team\":\"a\",\"tier\":\"gold\"}}")
.urlEncodingEnabled(false)
.when()
.post("/v1/tags/" + computeArn)
.post(tagsPath(computeArn))
.then()
.statusCode(200);
givenJson("{\"tags\":{\"env\":\"blue\"}}")
.urlEncodingEnabled(false)
.when()
.post("/v1/tags/" + computeArn)
.post(tagsPath(computeArn))
.then()
.statusCode(200);
given()
.header("Authorization", AUTH)
.urlEncodingEnabled(false)
.when()
.get("/v1/tags/" + computeArn)
.get(tagsPath(computeArn))
.then()
.statusCode(200)
.body("tags.team", equalTo("a"))
@@ -789,15 +803,17 @@ class BatchIntegrationTest {
given()
.header("Authorization", AUTH)
.queryParam("tagKeys", "tier", "env")
.urlEncodingEnabled(false)
.when()
.delete("/v1/tags/" + computeArn)
.delete(tagsPath(computeArn))
.then()
.statusCode(200);
given()
.header("Authorization", AUTH)
.urlEncodingEnabled(false)
.when()
.get("/v1/tags/" + computeArn)
.get(tagsPath(computeArn))
.then()
.statusCode(200)
.body("tags.team", equalTo("a"))
@@ -805,8 +821,9 @@ class BatchIntegrationTest {
given()
.header("Authorization", AUTH)
.urlEncodingEnabled(false)
.when()
.get("/v1/tags/arn:aws:batch:us-east-1:000000000000:job-queue/never-" + suffix)
.get(tagsPath("arn:aws:batch:us-east-1:000000000000:job-queue/never-" + suffix))
.then()
.statusCode(400)
.header("X-Amzn-Errortype", "ClientException");
@@ -887,8 +904,9 @@ class BatchIntegrationTest {
.header("X-Amzn-Errortype", "ClientException");
given()
.header("Authorization", EU_AUTH)
.urlEncodingEnabled(false)
.when()
.get("/v1/tags/" + ceArn)
.get(tagsPath(ceArn))
.then()
.statusCode(400)
.header("X-Amzn-Errortype", "ClientException");
@@ -967,8 +985,9 @@ class BatchIntegrationTest {
.body("jobDefinitions", hasSize(0));
given()
.header("Authorization", EU_AUTH)
.urlEncodingEnabled(false)
.when()
.get("/v1/tags/" + usArn)
.get(tagsPath(usArn))
.then()
.statusCode(400)
.header("X-Amzn-Errortype", "ClientException");
@@ -1023,6 +1042,11 @@ class BatchIntegrationTest {
.statusCode(200);
}
/** The tag route of a resource, its ARN encoded as an SDK sends it. */
private static String tagsPath(String arn) {
return "/v1/tags/" + URLEncoder.encode(arn, StandardCharsets.UTF_8);
}
private static RequestSpecification givenJson(String body) {
return givenJson(AUTH, body);
}
@@ -180,6 +180,55 @@ class IamPassRoleEnforcementIntegrationTest {
.post("/"));
}
@Test
void aBatchComputeEnvironmentNeedsPassRoleOnEachOfItsRolesForTheServiceItIsFor() {
// serviceRole goes to Batch, the role of the instance profile instanceRole names to EC2 and spotIamFleetRole to
// Spot Fleet, as the Batch API reference and user guide give them; each is needed.
String service = role("batch-service");
String instance = role("batch-instance");
String fleet = role("batch-fleet");
String profile = instanceProfile(instance.substring(instance.lastIndexOf('/') + 1));
User user = user("passrole-batch");
String name = "passrole-batch-" + suffix();
String body = """
{"computeEnvironmentName":"%s","type":"MANAGED","serviceRole":"%s","computeResources":{"type":"SPOT",
"minvCpus":0,"maxvCpus":4,"instanceTypes":["optimal"],"subnets":["subnet-1"],"instanceRole":"%s",
"spotIamFleetRole":"%s"}}""".formatted(name, service, profile, fleet);
String create = allow("batch:CreateComputeEnvironment", "*");
String serviceRole = passRole(service, "batch.amazonaws.com");
String instanceRole = passRole(instance, "ec2.amazonaws.com");
String fleetRole = passRole(fleet, "spotfleet.amazonaws.com");
user.policy(create + "," + instanceRole + "," + fleetRole);
denied(user.rest("batch").body(body).post("/v1/createcomputeenvironment").then());
user.policy(create + "," + serviceRole + "," + fleetRole);
denied(user.rest("batch").body(body).post("/v1/createcomputeenvironment").then());
user.policy(create + "," + serviceRole + "," + instanceRole);
denied(user.rest("batch").body(body).post("/v1/createcomputeenvironment").then());
// A role passed to another of the services the Service Reference names does not cover it.
user.policy(create + "," + passRole(service, "ecs.amazonaws.com") + "," + instanceRole + "," + fleetRole);
denied(user.rest("batch").body(body).post("/v1/createcomputeenvironment").then());
user.policy(create + "," + serviceRole + "," + instanceRole + "," + fleetRole);
user.rest("batch").body(body).post("/v1/createcomputeenvironment").then().statusCode(200);
cleanup.register(() -> admin("batch").contentType("application/json")
.body("{\"computeEnvironment\":\"" + name + "\"}").post("/v1/deletecomputeenvironment"));
// "If a role with the name bar has a path of /foo/, specify /foo/bar as the role name": that is the role IAM
// holds under the name and path.
String pathed = role("/team/", "batch-pathed");
String prefixed = pathed.substring(pathed.indexOf(":role") + ":role".length());
String unmanaged = "{\"computeEnvironmentName\":\"passrole-batch-pathed-" + suffix() + "\",\"type\":"
+ "\"UNMANAGED\",\"serviceRole\":\"" + prefixed + "\"}";
user.policy(create + "," + passRole(service, "batch.amazonaws.com"));
denied(user.rest("batch").body(unmanaged).post("/v1/createcomputeenvironment").then());
user.policy(create + "," + passRole(pathed, "batch.amazonaws.com"));
String created = user.rest("batch").body(unmanaged).post("/v1/createcomputeenvironment").then().statusCode(200)
.extract().path("computeEnvironmentName");
cleanup.register(() -> admin("batch").contentType("application/json")
.body("{\"computeEnvironment\":\"" + created + "\"}").post("/v1/deletecomputeenvironment"));
}
@Test
void apiGatewayNeedsPassRoleOnTheRolesAnIntegrationAnUpdateOrAnImportNames() {
// API Gateway is authorized by HTTP method, and its roles are checked for the operation its route resolves:
@@ -2209,6 +2209,69 @@ class IamRestRouteEnforcementIntegrationTest {
.body(not(containsString("rds-data:ExecuteStatement")));
}
/**
* A Batch route is checked on the resource its request names, read by the generated table: a job queue by its name,
* the compute environments a queue's order names, the job definition revision a name and revision names, and the
* revision a definition's name alone names when a job is submitted, its latest active one, as Batch resolves them
* ("the request ARN includes the revision"), so a grant on one revision does not cover another.
*/
@Test
void aBatchRouteIsCheckedOnTheQueueOrTheJobDefinitionRevisionItNames() {
String user = user("route-batch");
String environment = "route-env-" + suffix();
String queue = "route-queue-" + suffix();
String other = "route-queue-other-" + suffix();
String definition = "route-def-" + suffix();
adminOf("batch").body("{\"computeEnvironmentName\":\"" + environment + "\",\"type\":\"UNMANAGED\"}")
.post("/v1/createcomputeenvironment").then().statusCode(200);
cleanup.register(() -> adminOf("batch").body("{\"computeEnvironment\":\"" + environment + "\"}")
.post("/v1/deletecomputeenvironment"));
for (String name : List.of(queue, other)) {
adminOf("batch").body("{\"jobQueueName\":\"" + name + "\",\"priority\":1,\"computeEnvironmentOrder\":"
+ "[{\"order\":1,\"computeEnvironment\":\"" + environment + "\"}]}")
.post("/v1/createjobqueue").then().statusCode(200);
cleanup.register(() -> adminOf("batch").body("{\"jobQueue\":\"" + name + "\"}").post("/v1/deletejobqueue"));
}
for (int i = 0; i < 2; i++) {
adminOf("batch").body("{\"jobDefinitionName\":\"" + definition + "\",\"type\":\"container\","
+ "\"containerProperties\":{\"image\":\"busybox\",\"vcpus\":1,\"memory\":128}}")
.post("/v1/registerjobdefinition").then().statusCode(200);
}
String prefix = "arn:aws:batch:us-east-1:" + ACCOUNT + ":";
policy(user, allow("batch:UpdateJobQueue", prefix + "job-queue/" + queue));
refused(as(user, "batch").body("{\"jobQueue\":\"" + other + "\",\"priority\":2}").post("/v1/updatejobqueue")
.then(), "batch:UpdateJobQueue");
as(user, "batch").body("{\"jobQueue\":\"" + queue + "\",\"priority\":2}").post("/v1/updatejobqueue").then()
.statusCode(200);
// A queue's order attaches compute environments, which a deny on one of them holds against.
String order = "{\"jobQueue\":\"" + queue + "\",\"computeEnvironmentOrder\":[{\"order\":1,"
+ "\"computeEnvironment\":\"" + prefix + "compute-environment/" + environment + "\"}]}";
policy(user, allow("batch:UpdateJobQueue", "*") + ","
+ deny("batch:UpdateJobQueue", prefix + "compute-environment/" + environment));
refused(as(user, "batch").body(order).post("/v1/updatejobqueue").then(), "batch:UpdateJobQueue");
policy(user, allow("batch:UpdateJobQueue", "*"));
as(user, "batch").body(order).post("/v1/updatejobqueue").then().statusCode(200);
// A job submitted from a definition's name runs its latest active revision, the second.
String job = "{\"jobName\":\"route-job\",\"jobQueue\":\"" + queue + "\",\"jobDefinition\":\""
+ definition + "\"}";
String queues = allow("batch:SubmitJob", prefix + "job-queue/*") + "," + allow("batch:SubmitJob", prefix + "job/*");
policy(user, queues + "," + allow("batch:SubmitJob", prefix + "job-definition/" + definition + ":1"));
refused(as(user, "batch").body(job).post("/v1/submitjob").then(), "batch:SubmitJob");
policy(user, queues + "," + allow("batch:SubmitJob", prefix + "job-definition/" + definition));
refused(as(user, "batch").body(job).post("/v1/submitjob").then(), "batch:SubmitJob");
policy(user, queues + "," + allow("batch:SubmitJob", prefix + "job-definition/" + definition + ":2"));
as(user, "batch").body(job).post("/v1/submitjob").then().statusCode(not(403));
policy(user, allow("batch:DeregisterJobDefinition", prefix + "job-definition/" + definition + ":1"));
refused(as(user, "batch").body("{\"jobDefinition\":\"" + definition + ":2\"}")
.post("/v1/deregisterjobdefinition").then(), "batch:DeregisterJobDefinition");
as(user, "batch").body("{\"jobDefinition\":\"" + definition + ":1\"}").post("/v1/deregisterjobdefinition")
.then().statusCode(200);
}
private void checkedAs(String user, String service, String method, String path, String body, String action) {
refused(request(user, service, method, path, body), action);
policy(user, allow(action, "*"));
+278
View File
@@ -0,0 +1,278 @@
#!/usr/bin/env python3
"""Vendor which role an AWS Batch request member names, and the service that role is for, into
tools/aws/sources/batch-roles.json, a source of the passed-roles table.
AWS's Service Reference passes CreateComputeEnvironment's roles to `batch.amazonaws.com`, `ec2.amazonaws.com`,
`ecs.amazonaws.com` and `spotfleet.amazonaws.com`, and UpdateComputeEnvironment's to the first three, without saying
which member's role goes where, and botocore does not say it as data either. The Batch API reference describes each
member as the role it names, linking the user guide's page of that role, whose trust policy gives the service it is
for. A compute resource's `instanceRole` is an instance profile, the guide's page of its role giving the trust policy
on the page it lists:
The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. ... You can specify the
short name or full Amazon Resource Name (ARN) of an instance profile. ... For more information, see Amazon ECS
instance role in the AWS Batch User Guide.
https://docs.aws.amazon.com/batch/latest/APIReference/API_ComputeResource.html
https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html
https://docs.aws.amazon.com/batch/latest/userguide/batch-check-ecsinstancerole.html ("Service": "ec2.amazonaws.com")
and a managed instances provider's `infrastructureRoleArn` names the service in its own description:
... You must have the iam:PassRole permission for this role with the condition iam:PassedToService:
ecs.amazonaws.com.
This script copies each member's description as it stands, the service it names where it names one, and otherwise
the title of the page of its role and the service principals that page's trust policies name, or those of the pages
it lists, as a trust policy written out or the service-linked role's "trusts the following services". Nothing in the
output is written by hand; regen_iam_passed_roles.py reads it to choose, among the services the Service Reference
passes an operation's roles to, the one each member's role is for.
Run from anywhere in the repo:
python3 tools/aws/fetch_batch_roles.py # rewrite the vendored file from the pages
python3 tools/aws/fetch_batch_roles.py --verify # online: the file still says what the pages do
"""
from __future__ import annotations
import argparse
import html
import json
import re
import sys
import urllib.parse
import urllib.request
from datetime import datetime, timezone
from pathlib import Path
API_REFERENCE = "https://docs.aws.amazon.com/batch/latest/APIReference/"
USER_GUIDE = "https://docs.aws.amazon.com/batch/latest/userguide/"
REPO_ROOT = Path(__file__).resolve().parents[2]
OUTPUT = REPO_ROOT / "tools/aws/sources/batch-roles.json"
# The members that name a role, each by the API reference page and anchor describing it: a request member of an
# operation (`operation`) or a member of a type a request holds (`type`). One that updates another's role
# (`updates`) names it in the same words, but for "updated", and its role is that member's.
MEMBERS = (
{"operation": "CreateComputeEnvironment", "member": "serviceRole"},
{"operation": "UpdateComputeEnvironment", "member": "serviceRole"},
{"type": "ComputeResource", "member": "instanceRole"},
{"type": "ComputeResource", "member": "spotIamFleetRole"},
{"type": "ComputeResourceUpdate", "member": "instanceRole"},
{"type": "ManagedInstancesProvider", "member": "infrastructureRoleArn"},
{"type": "UpdateManagedInstancesProviderConfiguration", "member": "infrastructureRoleArn",
"updates": {"type": "ManagedInstancesProvider", "member": "infrastructureRoleArn"}},
)
# A description naming the service the role is passed to.
PASSED_TO_RE = re.compile(r"\biam:PassedToService\s*:\s*(?P<service>[a-z0-9.-]+\.amazonaws\.com)")
# A description of a member naming an instance profile rather than a role.
INSTANCE_PROFILE_RE = re.compile(r"\bof an instance profile\b")
# A trust policy in a code block, written out or as a CLI argument.
TRUST_RE = re.compile(r'"Principal"\s*:\s*\{\s*"Service"')
# The description's sentence linking the guide's page of the role.
SEE_RE = re.compile(r'For more information, see\s*<a[^>]*href="(?P<href>[^"#][^"]*)"')
# A service-linked role page's sentence naming the services the role trusts.
TRUSTS_RE = re.compile(r"\btrusts the following services to assume the role:\s*(?P<services>[a-z0-9.-]+\.amazonaws\.com"
r"(?:\s*(?:,|and)\s*[a-z0-9.-]+\.amazonaws\.com)*)")
SERVICE_RE = re.compile(r"[a-z0-9.-]+\.amazonaws\.com")
def text(fragment: str) -> str:
"""A fragment of a page as text, spaces collapsed."""
return re.sub(r"\s+", " ", html.unescape(re.sub(r"<[^>]+>", " ", fragment))).strip()
def code(fragment: str) -> str:
"""A code block as the text it shows, the page's copy button left out."""
fragment = re.sub(r'<div class="code-btn-container">.*?</div></div>', "", fragment, flags=re.S)
return html.unescape(re.sub(r"<[^>]+>", "", re.sub(r"<!--.*?-->", "", fragment, flags=re.S))).strip()
def body(page: str) -> str:
"""The page's own content, its navigation left out."""
match = re.search(r'<div id="main-col-body">(?P<body>.*?)(?:<div class="prev-next"|$)', page, re.S)
return match.group("body") if match else page
def api_page(member: dict) -> str:
"""The API reference page describing the member: its operation's or its type's."""
return API_REFERENCE + "API_" + (member.get("operation") or member["type"]) + ".html"
def anchor(member: dict) -> str:
"""The id of the member's entry on its API reference page."""
if "operation" in member:
return f"Batch-{member['operation']}-request-{member['member']}"
return f"Batch-Type-{member['type']}-{member['member']}"
def read_description(page: str, member: dict) -> tuple[str, list[str]]:
"""The member's description on its API reference page, as text, and the page its first "For more information,
see" links, the guide's page of the role, a later one linking what the member's rules depend on (none when it
links none)."""
match = re.search(r'id="' + re.escape(anchor(member)) + r'"[^>]*>(?P<entry>.*?)</dd>', page, re.S)
if match is None:
raise ValueError(f"{api_page(member)} has no entry {anchor(member)}: its layout changed")
entry = match.group("entry")
described = re.search(r"<dd[^>]*>(?P<body>.*?)<p>\s*Type:", entry + "<p>Type:", re.S)
found = described.group("body") if described else entry
see = SEE_RE.search(found)
links = [urllib.parse.urljoin(api_page(member), see.group("href"))] if see else []
return text(found), links
def trusted_by(page: str) -> set[str]:
"""The service principals the page's trust policies name, or its service-linked role says it trusts."""
services: set[str] = set()
for block in re.findall(r"<pre[^>]*>(.*?)</pre>", page, re.S):
shown = code(block)
if not TRUST_RE.search(shown):
continue
policy = shown[shown.index("{"):shown.rindex("}") + 1]
for statement in json.loads(policy)["Statement"]:
service = statement["Principal"]["Service"]
services.update([service] if isinstance(service, str) else service)
for match in TRUSTS_RE.finditer(text(body(page))):
services.update(SERVICE_RE.findall(match.group("services")))
return services
def read_role(page: str, url: str, fetch) -> dict:
"""The title of a role's page and the service principals it trusts: those its own trust policies name, or else
those of the user guide's pages it lists."""
title = re.search(r"<title>(?P<title>.*?)</title>", page, re.S)
services = trusted_by(page)
listed = []
if not services:
for href in dict.fromkeys(re.findall(r'href="([^"#][^"]*)"', body(page))):
link = urllib.parse.urljoin(url, href)
if link.startswith(USER_GUIDE) and link != url:
found = trusted_by(fetch(link))
if found:
listed.append(link)
services |= found
if title is None or not services:
raise ValueError(f"{url} gives no trust policy naming a service: its layout changed")
return {"title": text(title.group("title")), "trustedBy": sorted(services),
**({"trustPages": listed} if listed else {})}
def role_page(member: dict, links: list[str], fetch) -> dict:
"""The page of the role the member names: the user guide page its description's "For more information, see"
links, which trusts a service."""
pages = []
for link in dict.fromkeys(links):
if not link.startswith(USER_GUIDE):
continue
try:
pages.append((link, read_role(fetch(link), link, fetch)))
except ValueError:
continue
if len(pages) != 1:
raise ValueError(f"{member['member']}'s description links {len(pages)} pages of a role, not one: "
f"{[link for link, _ in pages] or links}")
link, role = pages[0]
return {"rolePage": link, **role}
def first_sentence(description: str) -> str:
return description.split(". ", 1)[0].rstrip(". ")
def updated_role(member: dict, description: str, members: list[dict]) -> dict:
"""What the member it updates says of the role, when the update names that role in the same words."""
target = member["updates"]
for entry in members:
if entry["member"] == target["member"] and entry.get("type") == target.get("type"):
if first_sentence(description).replace("The updated ", "The ", 1) != first_sentence(entry["description"]):
raise ValueError(f"{api_page(member)} no longer names {member['member']}'s role as "
f"{api_page(target)} does")
return {"sameRoleAs": {"type": target["type"], "member": target["member"]},
**{key: entry[key] for key in ("passedToService", "rolePage", "title", "trustedBy", "trustPages",
"instanceProfile") if key in entry}}
raise ValueError(f"{member['member']} updates a member read after it")
def build(fetch) -> dict:
members = []
pages = []
for member in MEMBERS:
description, links = read_description(fetch(api_page(member)), member)
named = {key: member[key] for key in ("operation", "type") if key in member}
entry = {**named, "member": member["member"], "description": description}
passed_to = PASSED_TO_RE.search(description)
if "updates" in member:
entry.update(updated_role(member, description, members))
pages.append(api_page(member))
elif passed_to:
entry["passedToService"] = [passed_to.group("service")]
pages.append(api_page(member))
else:
role = role_page(member, links, fetch)
entry.update(role)
pages += [api_page(member), role["rolePage"]] + role.get("trustPages", [])
if INSTANCE_PROFILE_RE.search(description) and "updates" not in member:
entry["instanceProfile"] = True
members.append(entry)
return {
"_source": {
"pages": list(dict.fromkeys(pages)),
"fetcher": str(Path(__file__).resolve().relative_to(REPO_ROOT)),
"retrieved": datetime.now(timezone.utc).strftime("%Y-%m-%d"),
"note": "Each member's description on its API reference page, copied as it stands; the service it names "
"where it names one, the role of the member it updates where it names that role in the same words "
"(sameRoleAs), and otherwise the title of the user guide's page of its role and the service "
"principals that page's trust policies name, or those of the pages it lists (trustPages).",
},
"members": members,
}
def fetch_url(url: str) -> str:
request = urllib.request.Request(url, headers={"User-Agent": "floci-tools"})
with urllib.request.urlopen(request, timeout=60) as response:
return response.read().decode("utf-8")
def fetch_all(fetch=fetch_url) -> tuple:
"""The pages, each fetched once, as a reader of them."""
cache: dict[str, str] = {}
def cached(url: str) -> str:
if url not in cache:
cache[url] = fetch(url)
return cache[url]
build(cached)
return (cache,)
def stale(vendored: dict, pages: dict[str, str]) -> bool:
"""Whether the pages now give something other than the vendored file, its date aside."""
return vendored.get("members") != build(lambda url: pages[url])["members"]
def main(argv: list[str] | None = None, fetch=fetch_url) -> int:
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("--verify", action="store_true", help="online: the vendored file matches the pages")
args = parser.parse_args(argv)
try:
(pages,) = fetch_all(fetch)
except OSError as e:
print(f"error: could not read the AWS Batch documentation ({e})", file=sys.stderr)
return 2
if args.verify:
vendored = json.loads(OUTPUT.read_text(encoding="utf-8"))
if stale(vendored, pages):
print(f"error: {OUTPUT.relative_to(REPO_ROOT)} no longer says what the Batch API reference and user "
f"guide do: run tools/aws/fetch_batch_roles.py and then make iam-passed-roles-sync", file=sys.stderr)
return 1
print(f"{OUTPUT.relative_to(REPO_ROOT)} matches the Batch API reference and user guide")
return 0
built = build(lambda url: pages[url])
OUTPUT.write_text(json.dumps(built, indent=2) + "\n", encoding="utf-8")
print(f"wrote {OUTPUT.relative_to(REPO_ROOT)} ({len(built['members'])} members' roles)")
return 0
if __name__ == "__main__":
sys.exit(main())
+16 -4
View File
@@ -79,6 +79,7 @@ from datetime import datetime, timezone
from pathlib import Path
import fetch_apigateway_roles
import fetch_batch_roles
import fetch_eks_roles
import fetch_emr_roles
from regen_iam_authorized_actions import fetch_references
@@ -94,7 +95,8 @@ SERVICE_SUFFIX = ".amazonaws.com"
# The IAM namespaces whose operations this file reads: those Floci serves over the JSON and Query
# protocols and Smithy RPC v2 CBOR, and the REST ones whose routes Floci authorizes by operation.
NAMESPACES = (
"apigateway", "application-autoscaling", "aps", "athena", "autoscaling", "budgets", "cloudformation", "cloudtrail",
"apigateway", "application-autoscaling", "aps", "athena", "autoscaling", "batch", "budgets", "cloudformation",
"cloudtrail",
"cloudwatch", "codebuild", "codedeploy", "codepipeline", "cognito-identity", "cognito-idp",
"comprehend", "config", "datasync", "dms", "dsql", "ec2", "ecr", "ecs", "eks",
"elasticfilesystem", "elasticloadbalancing", "elasticmapreduce",
@@ -115,7 +117,6 @@ NOT_COVERED = {
"appsync": "REST routes no rule maps yet",
"aws-marketplace": "REST routes no rule maps yet",
"backup": "REST routes no rule maps yet",
"batch": "REST routes no rule maps yet",
"bedrock": "REST routes no rule maps yet",
"bedrock-agentcore": "REST routes no rule maps yet",
"cloudfront": "REST routes no rule maps yet",
@@ -254,9 +255,11 @@ NOT_IN_BOTOCORE = "the pinned botocore does not have the operation yet, so its r
# member in, and entry_for reads it.
MEMBER_NOT_IN_BOTOCORE = "the pinned botocore does not have the member naming the role yet, so it cannot be read"
RUNBOOK_PARAMETER = "the role is a parameter of the runbook it runs, not a member of the request"
QUEUED_REQUEST = "the role is a member of the request of the service the job queues, which the request holds as a string"
# Operations whose request names no role this file can read.
NOT_READ = {
"batch:SubmitServiceJob": QUEUED_REQUEST,
"config:PutConformancePack": NO_ROLE_MEMBER,
"config:PutOrganizationConformancePack": NO_ROLE_MEMBER,
"config:PutRemediationConfigurations": RUNBOOK_PARAMETER,
@@ -420,16 +423,25 @@ MEMBER_SERVICES = {
# property is /name"), that an import's body is an OpenAPI definition, and its developer guide which of that
# definition's extensions name a role and where each sits ("an extended property of the OpenAPI Operation object");
# tools/aws/fetch_apigateway_roles.py vendors those pages and `vendored_role_names`, `patch_role_members` and
# `document_members` read them. Each file is written by its own script from the pages, unchanged, and nothing about an
# operation is stated here.
# `document_members` read them. And granted for Batch: its API reference describes CreateComputeEnvironment's and
# UpdateComputeEnvironment's serviceRole as the role "that allows AWS Batch to make calls to other AWS services on your
# behalf", a compute resource's instanceRole as "the Amazon ECS instance profile applied to Amazon EC2 instances" and its
# spotIamFleetRole as "the Amazon EC2 Spot Fleet IAM role", each linking the user guide's page of the role, whose trust
# policies, or the service-linked role's "trusts the following services", name "batch.amazonaws.com",
# "ec2.amazonaws.com" and "spotfleet.amazonaws.com", and a managed instances provider's infrastructureRoleArn as needing
# "the iam:PassRole permission for this role with the condition iam:PassedToService: ecs.amazonaws.com";
# tools/aws/fetch_batch_roles.py vendors those pages and `vendored_service` reads them. Each file is written by its own
# script from the pages, unchanged, and nothing about an operation is stated here.
ROLE_SOURCES: dict[str, Path] = {
"apigateway": REPO_ROOT / "tools/aws/sources/apigateway-roles.json",
"batch": REPO_ROOT / "tools/aws/sources/batch-roles.json",
"eks": REPO_ROOT / "tools/aws/sources/eks-roles.json",
"elasticmapreduce": REPO_ROOT / "tools/aws/sources/emr-roles.json",
}
# The script that writes each namespace's role source, whose pages `verify_role_sources` reads it against.
ROLE_FETCHERS = {
"apigateway": fetch_apigateway_roles,
"batch": fetch_batch_roles,
"eks": fetch_eks_roles,
"elasticmapreduce": fetch_emr_roles,
}
+63 -25
View File
@@ -27,7 +27,8 @@ strings, or, for an ARN, a member of a structure or of each element of a list of
(`SetRulePriorities`' `RulePriorities[].RuleArn`), and:
- holds the resource's ARN: its name ends in `Arn` or `Arns`, or it is an Identifier whose modeled
pattern only accepts an ARN. Any of the action's types may be the
pattern only accepts an ARN, or, in a structure, its documentation says it is "The Amazon Resource Name (ARN) of
the" resource (a Batch job queue's `computeEnvironmentOrder[].computeEnvironment`). Any of the action's types may be the
one it holds (`ResourceArn` holds whatever the action acts on, `RuleArn` a `listener-rule/app`),
and a value names a resource of a type when it matches the type's ARN format, so an ARN of
something the action does not act on is not checked.
@@ -165,9 +166,11 @@ Beyond the members' names, botocore's shapes and documentation say what a member
- a type named only by an optional member documented as holding what the operation is about ("the cluster to which
the instance group belongs") is named, when the request leaves that member out, through each member naming what
the operation is about (`ModifyInstanceGroups`' `InstanceGroups[].InstanceGroupId`);
- a type of two variables no member fills is named by the member whose documentation spells it as its format does
("The family and revision (family:revision) or full ARN of the task definition to run"), which its service finds
as its handler resolves it (`find`), each element of a list; such a member, "or full ARN" coming after something
- a type of two variables is named by the member whose documentation spells it as its format does ("The family and
revision (family:revision) or full ARN of the task definition to run"), or lists it among the forms it takes
("definition-name, definition-name:revision, or the Amazon Resource Name (ARN)"), which its service finds as its
handler resolves it (`find`), each element of a list, rather than the type of one variable its name alone fills
(a Batch job definition, whose revision's format extends it); such a member, "or full ARN" coming after something
else, holds no ARN alone;
- a member documented as a name or an ARN of another type than the one whose variable it fills ("The short name or
full Amazon Resource Name (ARN) of the cluster", "The Amazon Resource Name (ARN) or short name of the cluster",
@@ -383,7 +386,7 @@ NAMESPACES = ("access-analyzer", "account", "acm", "appconfig", "application-aut
"sqs", "sns", "kinesis", "pipes", "dsql", "sts", "eks", "resource-groups", "logs", "ses", "cloudwatch",
"comprehend", "config", "dms", "elasticache", "identitystore", "memorydb", "route53resolver",
"sagemaker", "transcribe", "transfer", "ec2-instance-connect", "s3", "bedrock", "apigateway", "kms",
"dynamodb", "iam", "rds-data")
"dynamodb", "iam", "rds-data", "batch")
# ---------------------------------------------------------------------------------------------------------------------
# MEASURED: what AWS was measured to check where neither botocore nor the Service Reference says it.
@@ -650,7 +653,6 @@ NOT_COVERED: dict[str, str] = {
"which other services (ECS capacity providers) read back; the mint is fixed first",
"aws-marketplace": _LATER,
"backup": _REST,
"batch": _REST,
"bedrock-agentcore": _REST,
"cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and "
"${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the "
@@ -1066,16 +1068,27 @@ def doc_kind(lead: str) -> str | None:
return None
CAMEL_WORD_RE = re.compile(r"[A-Z][a-z0-9]*")
def spelled(kind: str, arn: str) -> str | None:
"""How documentation spells a resource of two variables joined by a colon after its type's word, each variable
without the type's own words and its kind: `(family:revision)` for a task definition,
`task-definition/${TaskDefinitionFamilyName}:${TaskDefinitionRevisionNumber}`; None for any other format."""
without the words it shares with its type's name and then its kind, or its kind alone where nothing else is left:
`(family:revision)` for a task definition, `task-definition/${TaskDefinitionFamilyName}:${TaskDefinitionRevision
Number}`, and `(name:revision)` for a Batch job definition revision, `job-definition/${JobDefinitionName}:${Revision}`;
None for any other format."""
match = re.fullmatch(r"[A-Za-z][A-Za-z0-9-]*/\$\{(\w+)}:\$\{(\w+)}", _resource(arn))
if not match:
return None
own = "".join(part.capitalize() for part in kind.split("-"))
words = [re.sub(r"(?:Name|Number|Id|Identifier)$", "", variable.removeprefix(own)).lower()
for variable in match.groups()]
own = CAMEL_WORD_RE.findall("".join(part.capitalize() for part in kind.split("-")))
words = []
for variable in match.groups():
parts = CAMEL_WORD_RE.findall(variable)
shared = 0
while shared < min(len(parts), len(own)) and parts[shared] == own[shared]:
shared += 1
rest = "".join(parts[shared:])
words.append((re.sub(r"(?:Name|Number|Id|Identifier)$", "", rest) or rest).lower())
return f"({words[0]}:{words[1]})" if all(words) else None
@@ -1139,6 +1152,8 @@ def documented_members(models: dict[str, dict], operation: str) -> dict[str, dic
found.setdefault(path, {"path": path + strings, "nested": "." in path,
"lead": _without_service_name(_lead(item.get("documentation")
or item_shape.get("documentation")), model),
"text": _lead_text(item.get("documentation")
or item_shape.get("documentation")),
"arnValue": bool(re.search(
r"(?:^|\. )this value is an amazon resource name \(arn\)\.",
_lead_text(item.get("documentation") or item_shape.get("documentation")))),
@@ -1339,18 +1354,31 @@ def with_documented(operation: str, types: list[str], formats: dict[str, str], m
current["fill"] = dict(sorted(fill.items()))
else:
resources.append({"type": kind, "fill": dict(sorted(fill.items()))})
# A type of two variables no member fills is named by the one member whose documentation spells it as its format
# does, which its service finds as its handler resolves it, each element of a list: ECS's `taskDefinition`, "The
# family and revision (family:revision) or full ARN of the task definition to run".
# A type of two variables is named by the one member whose documentation spells it as its format does, which its
# service finds as its handler resolves it, each element of a list: ECS's `taskDefinition`, "The family and revision
# (family:revision) or full ARN of the task definition to run", Batch's DeregisterJobDefinition `jobDefinition`,
# "The name and revision (name:revision) or full Amazon Resource Name (ARN) of the job definition to deregister",
# and its SubmitJob `jobDefinition`, "one of definition-name, definition-name:revision, or the Amazon Resource Name
# (ARN) for the job definition, with or without the revision". Such a member names that type whole, not the type
# of one variable its name alone names (Batch's job-definition, whose format the revision's extends: "the request
# ARN includes the revision"); a member of another name filling the type keeps it.
for kind in kinds:
form = spelled(kind, formats[kind])
if form is None or any(resource.get("type") == kind and (resource.get("fill") or "find" in resource)
for resource in resources):
if form is None:
continue
spelling = [fact["path"] for path, fact in sorted(facts.items()) if not fact["nested"] and form in fact["lead"]]
if len(spelling) == 1:
resources = [resource for resource in resources if resource.get("type") != kind]
resources.append({"type": kind, "fill": {}, "find": spelling})
listed = re.compile(r"(?<![a-z0-9-])(?:[a-z0-9]+-)?" + re.escape(form[1:-1]).replace(":", r":(?:[a-z0-9]+-)?")
+ r"(?![a-z0-9])")
spelling = [fact["path"] for path, fact in sorted(facts.items())
if not fact["nested"] and (form in fact["lead"] or listed.search(fact.get("text", "")))]
if len(spelling) != 1 or any(resource.get("type") == kind and (
"find" in resource or set(resource.get("fill", {}).values()) - set(spelling))
for resource in resources):
continue
base = formats[kind].rsplit(":", 1)[0]
resources = [resource for resource in resources if resource.get("type") != kind and not (
formats.get(resource.get("type", "")) == base and resource.get("fill")
and set(resource["fill"].values()) <= set(spelling) and not {"when", "unless"} & set(resource))]
resources.append({"type": kind, "fill": {}, "find": spelling})
# A nested field filling a variable an optional top-level member of its name fills too is read when that member
# is absent.
optional = optional_members(models, name)
@@ -1747,11 +1775,20 @@ def _strings(model: dict, shape: dict) -> str | None:
return None
DOCUMENTED_ARN_RE = re.compile(r"^the (?:amazon resource name \(arn\)|arn) of (?:the|a|an) ")
def _documented_arn(member: dict, shape: dict) -> bool:
"""Whether a member's documentation says it holds an ARN: "The Amazon Resource Name (ARN) of the compute
environment" (a Batch job queue's `computeEnvironmentOrder[].computeEnvironment`)."""
return bool(DOCUMENTED_ARN_RE.match(_lead(member.get("documentation") or shape.get("documentation"))))
def _nested_arns(model: dict, name: str, shape: dict) -> list[str]:
"""The members ending in `Arn` or `Arns` of a structure, or of a list's structures, holding a string or a list
of strings, as `Name.Field` or `Name[].Field`; and those of the structures of each value of a map, or of a
structure inside them, as `Name{}.Field` or `Name{}.Structure.Field` (a QuickSight data set's
`PhysicalTableMap{}.S3Source.DataSourceArn`)."""
"""The members ending in `Arn` or `Arns`, or documented as holding an ARN (`_documented_arn`), of a structure, or of
a list's structures, holding a string or a list of strings, as `Name.Field` or `Name[].Field`; and those ending in
`Arn` or `Arns` of the structures of each value of a map, or of a structure inside them, as `Name{}.Field` or
`Name{}.Structure.Field` (a QuickSight data set's `PhysicalTableMap{}.S3Source.DataSourceArn`)."""
if shape["type"] == "map":
value = model["shapes"][shape["value"]["shape"]]
if value["type"] != "structure":
@@ -1771,7 +1808,8 @@ def _nested_arns(model: dict, name: str, shape: dict) -> list[str]:
prefix = name + ("[]." if shape["type"] == "list" else ".")
return [prefix + field + _strings(model, model["shapes"][member["shape"]])
for field, member in element.get("members", {}).items()
if re.search(r"arns?$", field, re.IGNORECASE) and _strings(model, model["shapes"][member["shape"]]) is not None]
if (re.search(r"arns?$", field, re.IGNORECASE) or _documented_arn(member, model["shapes"][member["shape"]]))
and _strings(model, model["shapes"][member["shape"]]) is not None]
def account_members(models: dict[str, dict], operation: str) -> list[str]:
+3 -1
View File
@@ -129,7 +129,9 @@ _NO_ROUTES = "REST routes no rule maps yet"
NOT_COVERED = {
"airflow": _NO_ROUTES, "app-integrations": _NO_ROUTES, "appsync": _NO_ROUTES,
"aws-marketplace": _NO_ROUTES, "backup": _NO_ROUTES,
"batch": _NO_ROUTES, "bedrock-agentcore": _NO_ROUTES,
"batch": "CreateComputeEnvironment is checked as batch:TagResource or batch:SetCapacityTags, and nothing says "
"which of its tag members each is for",
"bedrock-agentcore": _NO_ROUTES,
"cloudfront": "its creation tags are a Tags structure holding Items, which this file does not read yet",
"connect": _NO_ROUTES,
"detective": _NO_ROUTES, "dlm": _NO_ROUTES,
+1
View File
@@ -67,6 +67,7 @@ MODELS: dict[str, str] = {
"apigatewayv2": "apigateway",
"appconfig": "appconfig",
"appconfigdata": "appconfig",
"batch": "batch",
"bedrock": "bedrock",
"bedrock-agent": "bedrock",
"bedrock-runtime": "bedrock",
+115
View File
@@ -0,0 +1,115 @@
{
"_source": {
"pages": [
"https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateComputeEnvironment.html",
"https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html",
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-general.html",
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-sagemaker.html",
"https://docs.aws.amazon.com/batch/latest/APIReference/API_UpdateComputeEnvironment.html",
"https://docs.aws.amazon.com/batch/latest/APIReference/API_ComputeResource.html",
"https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html",
"https://docs.aws.amazon.com/batch/latest/userguide/batch-check-ecsinstancerole.html",
"https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html",
"https://docs.aws.amazon.com/batch/latest/userguide/spot-fleet-roles-cli.html",
"https://docs.aws.amazon.com/batch/latest/APIReference/API_ComputeResourceUpdate.html",
"https://docs.aws.amazon.com/batch/latest/APIReference/API_ManagedInstancesProvider.html",
"https://docs.aws.amazon.com/batch/latest/APIReference/API_UpdateManagedInstancesProviderConfiguration.html"
],
"fetcher": "tools/aws/fetch_batch_roles.py",
"retrieved": "2026-11-28",
"note": "Each member's description on its API reference page, copied as it stands; the service it names where it names one, the role of the member it updates where it names that role in the same words (sameRoleAs), and otherwise the title of the user guide's page of its role and the service principals that page's trust policies name, or those of the pages it lists (trustPages)."
},
"members": [
{
"operation": "CreateComputeEnvironment",
"member": "serviceRole",
"description": "The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf. For more information, see AWS Batch service IAM role in the AWS Batch User Guide . Important If your account already created the AWS Batch service-linked role, that role is used by default for your compute environment unless you specify a different role here. If the AWS Batch service-linked role doesn't exist in your account, and no role is specified here, the service attempts to create the AWS Batch service-linked role in your account. This automatic service-linked role creation only applies to MANAGED compute environments. For UNMANAGED compute environments, you must explicitly specify a serviceRole . If your specified role has a path other than / , then you must specify either the full role ARN (recommended) or prefix the role name with the path. For example, if a role with the name bar has a path of /foo/ , specify /foo/bar as the role name. For more information, see Friendly names and paths in the IAM User Guide . Note Depending on how you created your AWS Batch service role, its ARN might contain the service-role path prefix. When you only specify the name of the service role, AWS Batch assumes that your ARN doesn't use the service-role path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.",
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html",
"title": "Using service-linked roles for AWS Batch - AWS Batch",
"trustedBy": [
"batch.amazonaws.com",
"sagemaker-queuing.batch.amazonaws.com"
],
"trustPages": [
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-general.html",
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-sagemaker.html"
]
},
{
"operation": "UpdateComputeEnvironment",
"member": "serviceRole",
"description": "The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf. For more information, see AWS Batch service IAM role in the AWS Batch User Guide . Important If the compute environment has a service-linked role, it can't be changed to use a regular IAM role. Likewise, if the compute environment has a regular IAM role, it can't be changed to use a service-linked role. To update the parameters for the compute environment that require an infrastructure update to change, the AWSServiceRoleForBatch service-linked role must be used. For more information, see Updating compute environments in the AWS Batch User Guide . If your specified role has a path other than / , then you must either specify the full role ARN (recommended) or prefix the role name with the path. Note Depending on how you created your AWS Batch service role, its ARN might contain the service-role path prefix. When you only specify the name of the service role, AWS Batch assumes that your ARN doesn't use the service-role path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.",
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html",
"title": "Using service-linked roles for AWS Batch - AWS Batch",
"trustedBy": [
"batch.amazonaws.com",
"sagemaker-queuing.batch.amazonaws.com"
],
"trustPages": [
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-general.html",
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-sagemaker.html"
]
},
{
"type": "ComputeResource",
"member": "instanceRole",
"description": "The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. This parameter is required for Amazon EC2 instances types. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, ecsInstanceRole or arn:aws:iam:: <aws_account_id> :instance-profile/ ecsInstanceRole . For more information, see Amazon ECS instance role in the AWS Batch User Guide . Note This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.",
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html",
"title": "Amazon ECS instance role - AWS Batch",
"trustedBy": [
"ec2.amazonaws.com"
],
"trustPages": [
"https://docs.aws.amazon.com/batch/latest/userguide/batch-check-ecsinstancerole.html"
],
"instanceProfile": true
},
{
"type": "ComputeResource",
"member": "spotIamFleetRole",
"description": "The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This role is required if the allocation strategy set to BEST_FIT or if the allocation strategy isn't specified. For more information, see Amazon EC2 spot fleet role in the AWS Batch User Guide . Note This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it. Important To tag your Spot Instances on creation, the Spot Fleet IAM role specified here must use the newer AmazonEC2SpotFleetTaggingRole managed policy. The previously recommended AmazonEC2SpotFleetRole managed policy doesn't have the required permissions to tag Spot Instances. For more information, see Spot instances not tagged on creation in the AWS Batch User Guide .",
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html",
"title": "Amazon EC2 spot fleet role - AWS Batch",
"trustedBy": [
"spotfleet.amazonaws.com"
],
"trustPages": [
"https://docs.aws.amazon.com/batch/latest/userguide/spot-fleet-roles-cli.html"
]
},
{
"type": "ComputeResourceUpdate",
"member": "instanceRole",
"description": "The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. Required for Amazon EC2 instances. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, ecsInstanceRole or arn:aws:iam:: <aws_account_id> :instance-profile/ ecsInstanceRole . For more information, see Amazon ECS instance role in the AWS Batch User Guide . When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the AWS Batch User Guide . Note This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.",
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html",
"title": "Amazon ECS instance role - AWS Batch",
"trustedBy": [
"ec2.amazonaws.com"
],
"trustPages": [
"https://docs.aws.amazon.com/batch/latest/userguide/batch-check-ecsinstancerole.html"
],
"instanceProfile": true
},
{
"type": "ManagedInstancesProvider",
"member": "infrastructureRoleArn",
"description": "The Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes to manage Amazon EC2 instances on your behalf. This role must have a trust policy for ecs.amazonaws.com . You must have the iam:PassRole permission for this role with the condition iam:PassedToService: ecs.amazonaws.com .",
"passedToService": [
"ecs.amazonaws.com"
]
},
{
"type": "UpdateManagedInstancesProviderConfiguration",
"member": "infrastructureRoleArn",
"description": "The updated Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes to manage Amazon EC2 instances on your behalf.",
"sameRoleAs": {
"type": "ManagedInstancesProvider",
"member": "infrastructureRoleArn"
},
"passedToService": [
"ecs.amazonaws.com"
]
}
]
}
+120
View File
@@ -0,0 +1,120 @@
#!/usr/bin/env python3
"""Tests for fetch_batch_roles.py, on pages in the AWS Batch API reference's and user guide's markup."""
from __future__ import annotations
import pytest
import fetch_batch_roles as f
API = f.API_REFERENCE
GUIDE = f.USER_GUIDE
def entry(anchor: str, member: str, description: str) -> str:
return (f'<dl><dt id="{anchor}"><b><code class="code">{member}</code></b></dt><dd><p>{description}</p>'
f'<p>Type: String</p></dd></dl>')
def see(page: str, name: str) -> str:
return f'For more information, see <a href="{GUIDE}{page}">{name}</a> in the <i>AWS Batch User Guide</i>.'
def trust(service: str) -> str:
return ('<pre class="programlisting"><div class="code-btn-container"><div class="btn-copy-code" title="Copy">'
'<awsui-icon name="copy"></awsui-icon></div></div><code class="json ">{ "Version":"2012-10-17", '
'"Statement": [ { "Effect": "Allow", "Principal": { "Service": "' + service + '" }, '
'"Action": "sts:AssumeRole" } ] }</code></pre>')
def guide(title: str, content: str) -> str:
return f'<title>{title}</title><div id="main-col-body">{content}</div><div class="prev-next"></div>'
SERVICE_ROLE = ("The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS "
"services on your behalf. " + see("service_IAM_role.html", "AWS Batch service IAM role"))
INSTANCE_ROLE = ("The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. You can "
"specify the short name or full Amazon Resource Name (ARN) of an instance profile. "
+ see("instance_IAM_role.html", "Amazon ECS instance role"))
PAGES = {
API + "API_CreateComputeEnvironment.html": entry("Batch-CreateComputeEnvironment-request-serviceRole",
"serviceRole", SERVICE_ROLE),
API + "API_UpdateComputeEnvironment.html": entry(
"Batch-UpdateComputeEnvironment-request-serviceRole", "serviceRole",
SERVICE_ROLE + " " + see("updating-compute-environments.html", "Updating compute environments")),
API + "API_ComputeResource.html": (
entry("Batch-Type-ComputeResource-instanceRole", "instanceRole", INSTANCE_ROLE)
+ entry("Batch-Type-ComputeResource-spotIamFleetRole", "spotIamFleetRole",
"The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute "
"environment. " + see("spot_fleet_IAM_role.html", "Amazon EC2 spot fleet role"))),
API + "API_ComputeResourceUpdate.html": entry("Batch-Type-ComputeResourceUpdate-instanceRole", "instanceRole",
INSTANCE_ROLE),
API + "API_ManagedInstancesProvider.html": entry(
"Batch-Type-ManagedInstancesProvider-infrastructureRoleArn", "infrastructureRoleArn",
"The Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes. You must have the iam:PassRole "
"permission for this role with the condition iam:PassedToService: ecs.amazonaws.com ."),
API + "API_UpdateManagedInstancesProviderConfiguration.html": entry(
"Batch-Type-UpdateManagedInstancesProviderConfiguration-infrastructureRoleArn", "infrastructureRoleArn",
"The updated Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes."),
# The service role's page lists the service-linked roles' pages, each saying which services it trusts.
GUIDE + "service_IAM_role.html": guide("Using service-linked roles for AWS Batch",
'<a href="./using-service-linked-roles-batch-general.html">Using roles</a>'),
GUIDE + "using-service-linked-roles-batch-general.html": guide(
"Using roles for AWS Batch", "<p>The AWSServiceRoleForBatch service-linked role trusts the following services "
"to assume the role: batch.amazonaws.com</p>"),
# The instance role's page lists the page holding its trust policy.
GUIDE + "instance_IAM_role.html": guide("Amazon ECS instance role",
'<a href="./batch-check-ecsinstancerole.html">Check your role</a>'),
GUIDE + "batch-check-ecsinstancerole.html": guide("Check your account's Amazon ECS instance role",
trust("ec2.amazonaws.com")),
# The spot fleet role's trust policy is the argument of the CLI command that creates it.
GUIDE + "spot_fleet_IAM_role.html": guide("Amazon EC2 spot fleet role",
'<a href="./spot-fleet-roles-cli.html">With the AWS CLI</a>'),
GUIDE + "spot-fleet-roles-cli.html": guide(
"Create Amazon EC2 spot fleet roles with the AWS CLI",
"<pre>$ aws iam create-role --role-name AmazonEC2SpotFleetTaggingRole --assume-role-policy-document '{ "
'"Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": '
"\"spotfleet.amazonaws.com\" }, \"Action\": \"sts:AssumeRole\" } ] }'</pre>"),
}
def test_each_member_is_read_with_the_service_its_role_is_for():
built = f.build(lambda url: PAGES[url])
by_member = {(m.get("operation") or m["type"], m["member"]): m for m in built["members"]}
assert by_member[("CreateComputeEnvironment", "serviceRole")]["trustedBy"] == ["batch.amazonaws.com"]
description = by_member[("CreateComputeEnvironment", "serviceRole")]["description"]
assert description.startswith("The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch")
assert "see AWS Batch service IAM role in the AWS Batch User Guide" in description
# The later link names what the update depends on, not the role.
assert by_member[("UpdateComputeEnvironment", "serviceRole")]["rolePage"] == GUIDE + "service_IAM_role.html"
instance = by_member[("ComputeResource", "instanceRole")]
assert (instance["trustedBy"], instance["instanceProfile"]) == (["ec2.amazonaws.com"], True)
assert instance["trustPages"] == [GUIDE + "batch-check-ecsinstancerole.html"]
assert by_member[("ComputeResource", "spotIamFleetRole")]["trustedBy"] == ["spotfleet.amazonaws.com"]
assert "instanceProfile" not in by_member[("ComputeResource", "spotIamFleetRole")]
assert by_member[("ManagedInstancesProvider", "infrastructureRoleArn")]["passedToService"] == ["ecs.amazonaws.com"]
assert "rolePage" not in by_member[("ManagedInstancesProvider", "infrastructureRoleArn")]
# The update names the provider's role in the same words, so its role is that one.
update = by_member[("UpdateManagedInstancesProviderConfiguration", "infrastructureRoleArn")]
assert update["passedToService"] == ["ecs.amazonaws.com"]
assert update["sameRoleAs"] == {"type": "ManagedInstancesProvider", "member": "infrastructureRoleArn"}
def test_a_page_whose_layout_changed_is_refused():
for url, page, message in (
(API + "API_ComputeResource.html", "<dl></dl>", "has no entry"),
(GUIDE + "batch-check-ecsinstancerole.html", guide("Check", "<p>No policy.</p>"), "pages of a role"),
(API + "API_CreateComputeEnvironment.html",
entry("Batch-CreateComputeEnvironment-request-serviceRole", "serviceRole", "A role."), "pages of a role"),
(API + "API_UpdateManagedInstancesProviderConfiguration.html",
entry("Batch-Type-UpdateManagedInstancesProviderConfiguration-infrastructureRoleArn",
"infrastructureRoleArn", "The updated ARN of some other role."), "no longer names")):
changed = dict(PAGES, **{url: page})
with pytest.raises(ValueError, match=message):
f.build(lambda u: changed[u])
def test_the_file_is_stale_when_a_page_says_something_else():
vendored = f.build(lambda url: PAGES[url])
assert not f.stale(vendored, PAGES)
assert f.stale(vendored, dict(PAGES, **{GUIDE + "batch-check-ecsinstancerole.html": guide(
"Check your account's Amazon ECS instance role", trust("ecs-tasks.amazonaws.com"))}))
@@ -2692,6 +2692,47 @@ def test_a_type_of_two_variables_its_documentation_spells_is_found_by_its_servic
{"types": ["task-definition"], "arn": "definition"}]
def test_a_nested_member_documented_as_an_arn_holds_one():
# A Batch job queue's computeEnvironmentOrder[].computeEnvironment: "The Amazon Resource Name (ARN) of the compute
# environment", read like a member ending in Arn; one documented otherwise is not.
shapes = {"String": {"type": "string"},
"Order": {"type": "structure", "members": {
"computeEnvironment": {"shape": "String",
"documentation": "<p>The Amazon Resource Name (ARN) of the compute environment.</p>"},
"order": {"shape": "String", "documentation": "<p>The order of the compute environment.</p>"}}},
"Orders": {"type": "list", "member": {"shape": "Order"}}}
model = {"shapes": shapes}
assert r._nested_arns(model, "computeEnvironmentOrder", shapes["Orders"]) == ["computeEnvironmentOrder[].computeEnvironment"]
def test_a_spelled_form_wins_over_the_name_its_member_fills():
# Batch's job definition revision: a variable sharing words with its type's name is spelled by what is left, and
# a bare name by its kind, so its documentation's "(name:revision)" names the type whole, where the member's name
# alone would fill its name only.
jobs = {"job-definition-revision": "arn:${Partition}:svc:${Region}:${Account}:job-definition/${JobDefinitionName}:"
"${Revision}"}
assert r.spelled("job-definition-revision", jobs["job-definition-revision"]) == "(name:revision)"
deregister = cluster_model("DeregisterJobDefinition", {"jobDefinition": "<p>The name and revision (<code>name:revision"
"</code>) or full Amazon Resource Name (ARN) "
"of the job definition to deregister.</p>"})
named = {"type": "job-definition-revision", "fill": {"JobDefinitionName": "jobDefinition"}}
assert r.with_documented("svc:DeregisterJobDefinition", ["job-definition-revision"], jobs, deregister, [named]) == [
{"type": "job-definition-revision", "fill": {}, "find": ["jobDefinition"]}]
# SubmitJob lists the forms it takes, the revision's among them, so it names the revision, as Batch runs it, and not
# the job definition its name alone fills: "the request ARN includes the revision".
jobs["job-definition"] = "arn:${Partition}:svc:${Region}:${Account}:job-definition/${JobDefinitionName}"
submit = cluster_model("SubmitJob", {"jobDefinition": "<p>The job definition used by this job. This value can be one "
"of <code>definition-name</code>, <code>definition-name:revision"
"</code>, or the Amazon Resource Name (ARN).</p>"})
by_name = {"type": "job-definition", "fill": {"JobDefinitionName": "jobDefinition"}}
assert r.with_documented("svc:SubmitJob", ["job-definition", "job-definition-revision"], jobs, submit,
[by_name]) == [{"type": "job-definition-revision", "fill": {}, "find": ["jobDefinition"]}]
# A member of another name filling the type keeps it.
other = {"type": "job-definition-revision", "fill": {"JobDefinitionName": "definitionName"}}
assert r.with_documented("svc:DeregisterJobDefinition", ["job-definition-revision"], jobs, deregister, [other]) == [
other]
def test_an_arn_patterns_type_words_and_a_clients_versioned_twin():
assert r.pattern_words("arn:aws:svc:[a-z0-9-]+:([0-9]{12}):(bus-v2|subscriber|source-v2\\/(a|b))\\/[A-Za-z]+") == {
"bus-v2", "subscriber", "source-v2"}