mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
feat(emr-containers): emulate the EMR on EKS control plane (#8543)
Floci had no emr-containers service, so Airflow's EmrContainerOperator, the
aws emr-containers CLI and the SDKs had nothing to call. This adds its 25
operations: virtual clusters, job runs, job templates, managed endpoints,
security configurations and tags.
Job runs follow the job run states without running Spark on Kubernetes: a
run completes as soon as it is submitted, or after
floci.services.emrcontainers.job-run-duration-seconds. When Floci's EKS has
no cluster of the virtual cluster's container provider id, the run is FAILED
with "Cluster <id> does not exist." and CLUSTER_UNAVAILABLE, as AWS's "Common
errors when running jobs" page gives it; that page also gives the wording for
a job run on a missing or non-RUNNING virtual cluster. A job template's
${name} placeholders are filled from jobTemplateParameters or the parameter's
default. Deleting a virtual cluster clears its tags, as the development guide
says, only resources in an active state of the request's Region take tags,
and a job run's template and request tags together keep the 50-tag limit. A
virtual cluster created on an EKS cluster whose authenticationMode admits
access entries is access entry integrated, which ListVirtualClusters'
eksAccessEntryIntegrated filters on.
Every request is checked against botocore's emr-containers constraints,
vendored by tools/aws/regen_emr_containers_shapes.py and gated by make
aws-data-check. Routes sit under a signed-service prefix, so a path-style S3
request for a bucket named virtualclusters still reaches S3. The routes are
added to IAM's REST route table, and emr-containers to the IAM generators'
namespaces, so each operation is checked on the resource its path names,
StartJobRun and CreateManagedEndpoint need iam:PassRole on their
executionRoleArn, and the create operations need emr-containers:TagResource
for their tags, all from AWS's Service Reference.
This commit is contained in:
1 parent
039d4fbb26
commit
9eda97cf84
33 files changed
+3623
-17
No files matched your search
@@ -33,6 +33,9 @@
|
||||
# by tools/aws/regen_athena_shapes.py.
|
||||
# src/main/resources/aws/cur-request-shapes.json, the Cost and Usage Reports request constraints
|
||||
# for every operation, is generated from botocore's CUR model by tools/aws/regen_cur_shapes.py.
|
||||
# src/main/resources/aws/emr-containers-request-shapes.json, the EMR on EKS request constraints for
|
||||
# every operation, is generated from botocore's emr-containers model by
|
||||
# tools/aws/regen_emr_containers_shapes.py.
|
||||
# src/main/resources/aws/account-request-shapes.json, the Account Management request constraints of the
|
||||
# contact operations, is generated from botocore's Account model by tools/aws/regen_account_shapes.py.
|
||||
# src/main/resources/aws/payment-cryptography-request-shapes.json, the Payment Cryptography
|
||||
@@ -295,6 +298,7 @@ aws-data-sync-botocore: ## Regenerate only the AWS data derived from botocore, s
|
||||
$(PYTHON) tools/aws/regen_lambda_microvm_shapes.py
|
||||
$(PYTHON) tools/aws/regen_athena_shapes.py
|
||||
$(PYTHON) tools/aws/regen_cur_shapes.py
|
||||
$(PYTHON) tools/aws/regen_emr_containers_shapes.py
|
||||
$(PYTHON) tools/aws/regen_account_shapes.py
|
||||
$(PYTHON) tools/aws/regen_payment_cryptography_shapes.py
|
||||
$(PYTHON) tools/aws/regen_payment_cryptography_data_shapes.py
|
||||
@@ -406,6 +410,10 @@ aws-data-check-botocore: ## The AWS data derived from botocore must match a fres
|
||||
echo "error: CUR request shapes are out of date; run 'make aws-data-sync'."; \
|
||||
exit 1; \
|
||||
}
|
||||
@$(PYTHON) tools/aws/regen_emr_containers_shapes.py --check || { \
|
||||
echo "error: EMR on EKS request shapes are out of date; run 'make aws-data-sync'."; \
|
||||
exit 1; \
|
||||
}
|
||||
@$(PYTHON) tools/aws/regen_account_shapes.py --check || { \
|
||||
echo "error: Account Management request shapes are out of date; run 'make aws-data-sync'."; \
|
||||
exit 1; \
|
||||
|
||||
@@ -300,7 +300,7 @@ Floci supports local emulation for application services, data services, eventing
|
||||
| Events and workflows | EventBridge, EventBridge V2, EventBridge Pipes, EventBridge Scheduler, Step Functions, SWF, CloudWatch Logs, CloudWatch Metrics, CloudWatch OAM, CloudWatch RUM, X-Ray, Managed Prometheus (AMP) |
|
||||
| API and identity | API Gateway REST, API Gateway v2, AppSync, Cognito, Cognito Identity, ACM, Route53, Route 53 Resolver, Cloud Map, Global Accelerator |
|
||||
| Containers and compute | ECS, EC2, EC2 Instance Connect, Lightsail, EKS, MWAA, ECR, EFS, CodeBuild, CodeDeploy, CodePipeline, CodeGuru Reviewer, CodeArtifact, AWS Batch, Auto Scaling, Application Auto Scaling, Elastic Beanstalk, ELB v2, ELB Classic |
|
||||
| Data, analytics, and AI | Athena, Glue, Lake Formation, EMR, EMR Serverless, Redshift, Redshift Data API, Redshift Serverless, Firehose, Managed Service for Apache Flink, OpenSearch, S3 Tables, S3 Vectors, Textract, Transcribe, Comprehend, Rekognition, Translate, Bedrock, Bedrock Runtime, Bedrock AgentCore, Bedrock AgentCore Control, Amazon SageMaker, QuickSight |
|
||||
| Data, analytics, and AI | Athena, Glue, Lake Formation, EMR, EMR on EKS, EMR Serverless, Redshift, Redshift Data API, Redshift Serverless, Firehose, Managed Service for Apache Flink, OpenSearch, S3 Tables, S3 Vectors, Textract, Transcribe, Comprehend, Rekognition, Translate, Bedrock, Bedrock Runtime, Bedrock AgentCore, Bedrock AgentCore Control, Amazon SageMaker, QuickSight |
|
||||
| Databases and caching | Aurora DSQL, RDS, RDS Data API, Neptune, DocumentDB, DMS, MemoryDB, ElastiCache, Timestream for InfluxDB |
|
||||
| Messaging and transfer | SES, Kinesis, MSK, Amazon MQ, Transfer Family, DataSync, IoT Core, Amazon Connect, Amazon AppIntegrations |
|
||||
| Security and governance | AWS Signer, AWS Network Firewall, AWS RAM, Service Quotas, WAF v2, GuardDuty, Amazon Inspector, CloudTrail, CloudFront, AWS Resource Groups, Resource Groups Tagging API, Resource Explorer 2, CloudHSM v2, Organizations, AWS Account Management, IAM Access Analyzer, IAM Identity Center (SSO Admin, OIDC, Access Portal, SCIM), Identity Store, Amazon Macie, Amazon Detective, Security Hub, Amazon Verified Permissions, Control Catalog, Control Tower, Service Catalog, AWS Marketplace |
|
||||
@@ -354,6 +354,7 @@ For operation-level compatibility, see the [Services Overview](https://floci.io/
|
||||
| Athena | In-process with DuckDB sidecar | Real SQL execution over S3 and Glue-backed views |
|
||||
| Glue | In-process | Data Catalog, Schema Registry, tables consumed by Athena |
|
||||
| EMR | In-process | Cluster (job flow) lifecycle, instance groups and fleets (including resizing), bootstrap actions, steps, security configurations, scaling and termination policies, block public access, tagging |
|
||||
| EMR on EKS | In-process | Virtual clusters, job runs through their states, job templates with parameters, managed endpoints, security configurations, tagging; no Spark on Kubernetes |
|
||||
| Data Firehose | In-process | Streaming delivery, buffered flush to S3 with GZIP/ZIP/Snappy compression |
|
||||
| Managed Service for Apache Flink | Real Docker | Kinesis Analytics V2 control plane; StartApplication runs a real Flink cluster (JobManager + TaskManager, image per RuntimeEnvironment), pulls the application JAR from local S3, and submits the job |
|
||||
| ECS | Real Docker | Clusters, task definitions, tasks, services, capacity providers, task sets |
|
||||
|
||||
@@ -387,6 +387,11 @@
|
||||
<groupId>software.amazon.awssdk</groupId>
|
||||
<artifactId>emr</artifactId>
|
||||
</dependency>
|
||||
<!-- EMR on EKS client -->
|
||||
<dependency>
|
||||
<groupId>software.amazon.awssdk</groupId>
|
||||
<artifactId>emrcontainers</artifactId>
|
||||
</dependency>
|
||||
<!-- EMR Serverless client -->
|
||||
<dependency>
|
||||
<groupId>software.amazon.awssdk</groupId>
|
||||
|
||||
@@ -66,6 +66,7 @@ import software.amazon.awssdk.services.elasticache.ElastiCacheClient;
|
||||
import software.amazon.awssdk.services.elasticbeanstalk.ElasticBeanstalkClient;
|
||||
import software.amazon.awssdk.services.elasticloadbalancingv2.ElasticLoadBalancingV2Client;
|
||||
import software.amazon.awssdk.services.emr.EmrClient;
|
||||
import software.amazon.awssdk.services.emrcontainers.EmrContainersClient;
|
||||
import software.amazon.awssdk.services.emrserverless.EmrServerlessClient;
|
||||
import software.amazon.awssdk.services.eventbridge.EventBridgeClient;
|
||||
import software.amazon.awssdk.services.eventbridgev2.EventBridgeV2Client;
|
||||
@@ -1272,6 +1273,14 @@ public final class TestFixtures {
|
||||
.build();
|
||||
}
|
||||
|
||||
public static EmrContainersClient emrContainersClient() {
|
||||
return EmrContainersClient.builder()
|
||||
.endpointOverride(ENDPOINT)
|
||||
.region(REGION)
|
||||
.credentialsProvider(CREDENTIALS)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static EmrServerlessClient emrServerlessClient() {
|
||||
return EmrServerlessClient.builder()
|
||||
.endpointOverride(ENDPOINT)
|
||||
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
package com.floci.test;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import software.amazon.awssdk.services.emrcontainers.EmrContainersClient;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.ContainerProviderType;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.CreateVirtualClusterResponse;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.FailureReason;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.JobRun;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.JobRunState;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.ResourceNotFoundException;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.TemplateParameterConfiguration;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.TemplateParameterDataType;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.VirtualCluster;
|
||||
import software.amazon.awssdk.services.emrcontainers.model.VirtualClusterState;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.within;
|
||||
|
||||
@DisplayName("EMR on EKS")
|
||||
class EmrContainersTest {
|
||||
|
||||
private static final String ROLE = "arn:aws:iam::000000000000:role/emr-job";
|
||||
private static final String RELEASE = "emr-7.5.0-latest";
|
||||
// No EKS cluster of this name exists, so a job run fails the way AWS documents it.
|
||||
private static final String EKS_CLUSTER = "no-such-eks-cluster";
|
||||
|
||||
private static EmrContainersClient emr;
|
||||
private static String virtualClusterId;
|
||||
private static String virtualClusterArn;
|
||||
|
||||
@BeforeAll
|
||||
static void setup() {
|
||||
emr = TestFixtures.emrContainersClient();
|
||||
CreateVirtualClusterResponse created = emr.createVirtualCluster(r -> r
|
||||
.name(TestFixtures.uniqueName("vc"))
|
||||
.clientToken(UUID.randomUUID().toString())
|
||||
.containerProvider(p -> p.type(ContainerProviderType.EKS).id(EKS_CLUSTER)
|
||||
.info(i -> i.eksInfo(e -> e.namespace("spark"))))
|
||||
.tags(Map.of("team", "data")));
|
||||
virtualClusterId = created.id();
|
||||
virtualClusterArn = created.arn();
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void cleanup() {
|
||||
if (emr == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
emr.deleteVirtualCluster(r -> r.id(virtualClusterId));
|
||||
}
|
||||
finally {
|
||||
emr.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("A virtual cluster is RUNNING and its timestamps parse")
|
||||
void describeVirtualCluster() {
|
||||
VirtualCluster cluster = emr.describeVirtualCluster(r -> r.id(virtualClusterId)).virtualCluster();
|
||||
|
||||
assertThat(cluster.state()).isEqualTo(VirtualClusterState.RUNNING);
|
||||
assertThat(cluster.arn()).isEqualTo(virtualClusterArn).contains(":/virtualclusters/" + virtualClusterId);
|
||||
assertThat(cluster.containerProvider().info().eksInfo().namespace()).isEqualTo("spark");
|
||||
assertThat(cluster.createdAt()).isCloseTo(Instant.now(), within(1, ChronoUnit.HOURS));
|
||||
assertThat(emr.listVirtualClusters(r -> r.states(VirtualClusterState.RUNNING)).virtualClusters())
|
||||
.extracting(VirtualCluster::id).contains(virtualClusterId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("A job run on an EKS cluster that does not exist FAILS with CLUSTER_UNAVAILABLE")
|
||||
void jobRunOnMissingEksCluster() {
|
||||
String runId = emr.startJobRun(r -> r
|
||||
.virtualClusterId(virtualClusterId)
|
||||
.name("pi")
|
||||
.clientToken(UUID.randomUUID().toString())
|
||||
.executionRoleArn(ROLE)
|
||||
.releaseLabel(RELEASE)
|
||||
.jobDriver(d -> d.sparkSubmitJobDriver(s -> s.entryPoint("s3://bucket/pi.py")))).id();
|
||||
|
||||
JobRun run = emr.describeJobRun(r -> r.virtualClusterId(virtualClusterId).id(runId)).jobRun();
|
||||
|
||||
assertThat(run.state()).isEqualTo(JobRunState.FAILED);
|
||||
assertThat(run.failureReason()).isEqualTo(FailureReason.CLUSTER_UNAVAILABLE);
|
||||
assertThat(run.stateDetails()).isEqualTo("Cluster " + EKS_CLUSTER + " does not exist.");
|
||||
assertThat(run.finishedAt()).isNotNull();
|
||||
assertThat(emr.listJobRuns(r -> r.virtualClusterId(virtualClusterId).states(JobRunState.FAILED)).jobRuns())
|
||||
.extracting(JobRun::id).contains(runId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("A job template's parameters are filled in on StartJobRun")
|
||||
void jobTemplate() {
|
||||
String templateId = emr.createJobTemplate(r -> r
|
||||
.name(TestFixtures.uniqueName("template"))
|
||||
.clientToken(UUID.randomUUID().toString())
|
||||
.jobTemplateData(d -> d
|
||||
.executionRoleArn(ROLE)
|
||||
.releaseLabel(RELEASE)
|
||||
.jobDriver(j -> j.sparkSubmitJobDriver(s -> s.entryPoint("${EntryPoint}")))
|
||||
.parameterConfiguration(Map.of("EntryPoint",
|
||||
TemplateParameterConfiguration.builder()
|
||||
.type(TemplateParameterDataType.STRING).build())))).id();
|
||||
try {
|
||||
String runId = emr.startJobRun(r -> r
|
||||
.virtualClusterId(virtualClusterId)
|
||||
.clientToken(UUID.randomUUID().toString())
|
||||
.jobTemplateId(templateId)
|
||||
.jobTemplateParameters(Map.of("EntryPoint", "s3://bucket/job.py"))).id();
|
||||
|
||||
JobRun run = emr.describeJobRun(r -> r.virtualClusterId(virtualClusterId).id(runId)).jobRun();
|
||||
assertThat(run.jobDriver().sparkSubmitJobDriver().entryPoint()).isEqualTo("s3://bucket/job.py");
|
||||
assertThat(run.executionRoleArn()).isEqualTo(ROLE);
|
||||
}
|
||||
finally {
|
||||
emr.deleteJobTemplate(r -> r.id(templateId));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("TagResource, UntagResource and ListTagsForResource round trip on the virtual cluster ARN")
|
||||
void tags() {
|
||||
emr.tagResource(r -> r.resourceArn(virtualClusterArn).tags(Map.of("env", "dev")));
|
||||
assertThat(emr.listTagsForResource(r -> r.resourceArn(virtualClusterArn)).tags())
|
||||
.containsOnly(Map.entry("team", "data"), Map.entry("env", "dev"));
|
||||
|
||||
emr.untagResource(r -> r.resourceArn(virtualClusterArn).tagKeys("env"));
|
||||
assertThat(emr.listTagsForResource(r -> r.resourceArn(virtualClusterArn)).tags())
|
||||
.containsOnly(Map.entry("team", "data"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("An unknown virtual cluster is ResourceNotFoundException")
|
||||
void unknownVirtualCluster() {
|
||||
assertThatThrownBy(() -> emr.describeVirtualCluster(r -> r.id("nosuchcluster")))
|
||||
.isInstanceOf(ResourceNotFoundException.class)
|
||||
.hasMessageContaining("Virtual cluster nosuchcluster doesn't exist.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
# EMR on EKS
|
||||
|
||||
- **Protocol:** REST JSON
|
||||
- **Endpoint:** `http://localhost:4566/`
|
||||
- **Credential scope:** `emr-containers`
|
||||
|
||||
Floci implements the Amazon EMR on EKS (`emr-containers`) API: virtual clusters, job runs, job
|
||||
templates, managed endpoints, security configurations and tags. It is the API Airflow's
|
||||
`EmrContainerOperator`, the `aws emr-containers` CLI and the SDKs call. Floci keeps the records and
|
||||
moves job runs through their states; it does not run Spark on Kubernetes.
|
||||
|
||||
## Configuration
|
||||
|
||||
| Key | Description | Default |
|
||||
|-----|-------------|---------|
|
||||
| `floci.services.emrcontainers.enabled` | Whether the EMR on EKS API is enabled | `true` |
|
||||
| `floci.services.emrcontainers.job-run-duration-seconds` | How long a job run stays `RUNNING` before it is `COMPLETED`; `0` completes it as soon as it is submitted | `0` |
|
||||
| `floci.storage.services.emrcontainers.mode` | Storage mode for EMR on EKS resources | the global storage mode |
|
||||
| `floci.storage.services.emrcontainers.flush-interval-ms` | Flush interval for persistent storage | `5000` |
|
||||
|
||||
## Supported Actions
|
||||
|
||||
<!-- floci:actions:start -->
|
||||
| Action | Description |
|
||||
| --- | --- |
|
||||
| `CreateVirtualCluster` | Registers a virtual cluster on an EKS cluster's namespace, `RUNNING` at once (`POST /virtualclusters`) |
|
||||
| `ListVirtualClusters` | Lists virtual clusters, filtered by container provider, creation time and state (`GET /virtualclusters`) |
|
||||
| `DescribeVirtualCluster` | Gets a virtual cluster, with its scheduler status when it has concurrent job limits (`GET /virtualclusters/{virtualClusterId}`) |
|
||||
| `UpdateVirtualCluster` | Sets or clears a virtual cluster's concurrent job limits (`PATCH /virtualclusters/{virtualClusterId}`) |
|
||||
| `DeleteVirtualCluster` | Terminates a virtual cluster and clears its tags (`DELETE /virtualclusters/{virtualClusterId}`) |
|
||||
| `StartJobRun` | Submits a job run, directly or from a job template with its parameters (`POST /virtualclusters/{virtualClusterId}/jobruns`) |
|
||||
| `ListJobRuns` | Lists a virtual cluster's job runs, filtered by name, creation time and state (`GET /virtualclusters/{virtualClusterId}/jobruns`) |
|
||||
| `DescribeJobRun` | Gets a job run (`GET /virtualclusters/{virtualClusterId}/jobruns/{jobRunId}`) |
|
||||
| `CancelJobRun` | Cancels a job run that has not finished (`DELETE /virtualclusters/{virtualClusterId}/jobruns/{jobRunId}`) |
|
||||
| `CreateManagedEndpoint` | Creates a managed endpoint on a virtual cluster, `ACTIVE` at once (`POST /virtualclusters/{virtualClusterId}/endpoints`) |
|
||||
| `ListManagedEndpoints` | Lists a virtual cluster's managed endpoints, filtered by type, creation time and state (`GET /virtualclusters/{virtualClusterId}/endpoints`) |
|
||||
| `DescribeManagedEndpoint` | Gets a managed endpoint (`GET /virtualclusters/{virtualClusterId}/endpoints/{endpointId}`) |
|
||||
| `DeleteManagedEndpoint` | Terminates a managed endpoint (`DELETE /virtualclusters/{virtualClusterId}/endpoints/{endpointId}`) |
|
||||
| `GetManagedEndpointSessionCredentials` | Issues a session token for an active managed endpoint (`POST /virtualclusters/{virtualClusterId}/endpoints/{endpointId}/credentials`) |
|
||||
| `CreateJobTemplate` | Stores a job template (`POST /jobtemplates`) |
|
||||
| `ListJobTemplates` | Lists job templates, filtered by creation time (`GET /jobtemplates`) |
|
||||
| `DescribeJobTemplate` | Gets a job template (`GET /jobtemplates/{templateId}`) |
|
||||
| `DeleteJobTemplate` | Deletes a job template (`DELETE /jobtemplates/{templateId}`) |
|
||||
| `CreateSecurityConfiguration` | Stores a security configuration (`POST /securityconfigurations`) |
|
||||
| `ListSecurityConfigurations` | Lists security configurations, filtered by creation time (`GET /securityconfigurations`) |
|
||||
| `DescribeSecurityConfiguration` | Gets a security configuration (`GET /securityconfigurations/{securityConfigurationId}`) |
|
||||
| `DeleteSecurityConfiguration` | Deletes a security configuration (`DELETE /securityconfigurations/{securityConfigurationId}`) |
|
||||
| `ListTagsForResource` | Lists the tags on a virtual cluster, job run or managed endpoint (`GET /tags/{resourceArn}`) |
|
||||
| `TagResource` | Adds or replaces tags on an active virtual cluster, job run or managed endpoint (`POST /tags/{resourceArn}`) |
|
||||
| `UntagResource` | Removes tag keys from an active virtual cluster, job run or managed endpoint (`DELETE /tags/{resourceArn}`) |
|
||||
<!-- floci:actions:end -->
|
||||
|
||||
## Behaviour
|
||||
|
||||
**Virtual clusters.** A virtual cluster is `RUNNING` as soon as it is created and `TERMINATED` once it is
|
||||
deleted; deleting it again answers its id. Terminating it clears its tags, as the EMR on EKS Development
|
||||
Guide says ("When a virtual cluster is terminated, tags are cleaned and no longer accessible"). Floci
|
||||
does not refuse a container provider its EKS has no cluster for, nor a second virtual cluster on the same
|
||||
namespace: AWS documents no error for either. A `securityConfigurationId` must name a security
|
||||
configuration of the account. `schedulerConfiguration` is stored and returned, an empty object clears it
|
||||
on `UpdateVirtualCluster`, and `DescribeVirtualCluster` adds a `schedulerStatus` with the current queued
|
||||
and running job run counts; the limits are not enforced on `StartJobRun`. A virtual cluster created on an EKS
|
||||
cluster whose `authenticationMode` admits access entries (`API` or `API_AND_CONFIG_MAP`) is EKS access entry
|
||||
integrated, as the guide's cluster access management setup has it, and `ListVirtualClusters`'
|
||||
`eksAccessEntryIntegrated` keeps the ones that are, or are not; one on a cluster Floci's EKS does not have is
|
||||
not.
|
||||
|
||||
**Job runs.** A job run on a virtual cluster that does not exist answers `ResourceNotFoundException`
|
||||
("Virtual cluster *id* doesn't exist."), and one on a virtual cluster that is not `RUNNING`
|
||||
`ValidationException` ("Virtual cluster state *state* is not valid to create resource JobRun."), both as
|
||||
AWS's "Common errors when running jobs" page gives them. When Floci's EKS has no cluster of the virtual
|
||||
cluster's container provider id in the request's account and Region, the run is `FAILED` with
|
||||
`stateDetails` "Cluster *id* does not exist." and `failureReason` `CLUSTER_UNAVAILABLE`, as that page
|
||||
gives it. Otherwise the run is `COMPLETED` at once, or `RUNNING` for
|
||||
`job-run-duration-seconds` and then `COMPLETED`. `CancelJobRun` moves a run that has not finished to
|
||||
`CANCELLED`. A run with a `retryPolicyConfiguration` reports `retryPolicyExecution` with one attempt.
|
||||
The release label is not checked against EMR on EKS's releases.
|
||||
|
||||
**Job templates.** `StartJobRun` with a `jobTemplateId` takes `executionRoleArn`, `releaseLabel`,
|
||||
`jobDriver` and `configurationOverrides` from the template where the request leaves them out, and the
|
||||
template's `jobTags` under the request's `tags`, which together keep the 50-tag limit. Every `${name}` in the template is replaced by the
|
||||
parameter's value in `jobTemplateParameters`, or else its `defaultValue`. A declared parameter with
|
||||
neither, or a `NUMBER` parameter whose value is not a number, is refused with `ValidationException`; a
|
||||
placeholder no parameter declares stays as written.
|
||||
|
||||
**Managed endpoints.** An endpoint is `ACTIVE` as soon as it is created and `TERMINATED` once deleted.
|
||||
Floci runs no Jupyter Enterprise Gateway, so an endpoint has no `serverUrl`.
|
||||
`GetManagedEndpointSessionCredentials` accepts the `TOKEN` credential type alone and a duration of up to
|
||||
12 hours, 15 minutes by default, as the API reference gives them, and answers a random token.
|
||||
|
||||
**Tags.** The model's ARN pattern for the tagging operations names virtual clusters and what sits under
|
||||
them, so a job template or security configuration ARN is refused; their tags are set on creation. As the
|
||||
development guide says, only resources in an active state can be tagged or untagged: a terminated virtual
|
||||
cluster or endpoint, or a finished job run, answers `ValidationException`. A resource holds at most 50
|
||||
tags. An ARN of another Region than the request's names no resource, as for every other operation.
|
||||
|
||||
**IAM.** With IAM enforcement on, each operation is checked as its `emr-containers:` action on the resource its
|
||||
path names, from AWS's Service Reference: `StartJobRun` and `CreateManagedEndpoint` also need `iam:PassRole` on
|
||||
the request's `executionRoleArn`, and the create operations and `StartJobRun` need `emr-containers:TagResource`
|
||||
for the request's `tags`. A role or tags a job template supplies are not part of the request, so they are not
|
||||
checked that way.
|
||||
|
||||
**Idempotency.** A create request with a `clientToken` already used for that kind of resource answers the
|
||||
resource it created, as EMR Serverless does; the model declares no error for a token reused with other
|
||||
parameters.
|
||||
|
||||
**Validation.** Every request is checked against the constraints of botocore's `emr-containers` model
|
||||
(required members, lengths, patterns and enums, vendored by `tools/aws/regen_emr_containers_shapes.py`),
|
||||
and a violation answers `ValidationException`. The messages for the other refusals AWS does not document
|
||||
are Floci's own.
|
||||
|
||||
Resources are scoped to the request's account and Region, and IDs follow AWS's lengths: 25 characters for
|
||||
a virtual cluster, 13 for a managed endpoint and 19 for the others.
|
||||
@@ -85,6 +85,7 @@ Operation counts are exact. For dispatch-table services (Query and JSON 1.1) eac
|
||||
| [Redshift Data API](redshift-data.md) | `POST /` + `X-Amz-Target: RedshiftData.*` | JSON 1.1 | 12 |
|
||||
| [Redshift Serverless](redshift-serverless.md) | `POST /` + `X-Amz-Target: RedshiftServerless.*` | JSON 1.1 | 58 |
|
||||
| [EMR](emr.md) | `POST /` + `X-Amz-Target: ElasticMapReduce.*` | JSON 1.1 | 40 |
|
||||
| [EMR on EKS](emr-containers.md) | `/virtualclusters/*`, `/jobtemplates/*`, `/securityconfigurations/*`, `/tags/*` | REST JSON | 25 |
|
||||
| [EMR Serverless](emr-serverless.md) | `/applications/*`, `/tags/*` | REST JSON | 15 |
|
||||
| [Data Firehose](firehose.md) | `POST /` + `X-Amz-Target: Firehose_20150804.*` | JSON 1.1 | 12 |
|
||||
| [ECS](ecs.md) | `POST /` + `X-Amz-Target: AmazonEC2ContainerServiceV20141113.*` | JSON 1.1 | 59 |
|
||||
|
||||
@@ -220,6 +220,7 @@ nav:
|
||||
- DataSync: services/datasync.md
|
||||
- AWS Config: services/config.md
|
||||
- EMR: services/emr.md
|
||||
- EMR on EKS: services/emr-containers.md
|
||||
- EMR Serverless: services/emr-serverless.md
|
||||
- WAF v2: services/wafv2.md
|
||||
- AWS Network Firewall: services/network-firewall.md
|
||||
|
||||
@@ -420,6 +420,7 @@ public interface EmulatorConfig {
|
||||
RumStorageConfig rum();
|
||||
GuardDutyStorageConfig guardduty();
|
||||
EmrServerlessStorageConfig emrserverless();
|
||||
EmrContainersStorageConfig emrcontainers();
|
||||
|
||||
ControlTowerStorageConfig controltower();
|
||||
|
||||
@@ -734,6 +735,13 @@ public interface EmulatorConfig {
|
||||
long flushIntervalMs();
|
||||
}
|
||||
|
||||
interface EmrContainersStorageConfig {
|
||||
Optional<String> mode();
|
||||
|
||||
@WithDefault("5000")
|
||||
long flushIntervalMs();
|
||||
}
|
||||
|
||||
interface LakeFormationStorageConfig {
|
||||
Optional<String> mode();
|
||||
|
||||
@@ -882,6 +890,7 @@ public interface EmulatorConfig {
|
||||
RumServiceConfig rum();
|
||||
GuardDutyServiceConfig guardduty();
|
||||
EmrServerlessServiceConfig emrserverless();
|
||||
EmrContainersServiceConfig emrcontainers();
|
||||
Route53ResolverServiceConfig route53resolver();
|
||||
NetworkFirewallServiceConfig networkfirewall();
|
||||
ServiceCatalogServiceConfig servicecatalog();
|
||||
@@ -1175,6 +1184,20 @@ public interface EmulatorConfig {
|
||||
boolean enabled();
|
||||
}
|
||||
|
||||
interface EmrContainersServiceConfig {
|
||||
@WithDefault("true")
|
||||
boolean enabled();
|
||||
|
||||
/**
|
||||
* How long a job run stays RUNNING before it completes; 0, the default, completes a job run as
|
||||
* soon as it is submitted. Floci follows the job run states without running Spark on Kubernetes.
|
||||
*
|
||||
* Env var: FLOCI_SERVICES_EMRCONTAINERS_JOB_RUN_DURATION_SECONDS
|
||||
*/
|
||||
@WithDefault("0")
|
||||
int jobRunDurationSeconds();
|
||||
}
|
||||
|
||||
interface EmrServerlessServiceConfig {
|
||||
@WithDefault("true")
|
||||
boolean enabled();
|
||||
|
||||
@@ -44,6 +44,7 @@ import io.floci.aws.services.dlm.DlmController;
|
||||
import io.floci.aws.services.dsql.DsqlController;
|
||||
import io.floci.aws.services.efs.EfsController;
|
||||
import io.floci.aws.services.eks.EksController;
|
||||
import io.floci.aws.services.emrcontainers.EmrContainersController;
|
||||
import io.floci.aws.services.emrserverless.EmrServerlessController;
|
||||
import io.floci.aws.services.fis.FisController;
|
||||
import io.floci.aws.services.glue.iceberg.GlueIcebergController;
|
||||
@@ -288,6 +289,12 @@ public class ResolvedServiceCatalog {
|
||||
protocols(ServiceProtocol.REST_JSON),
|
||||
Set.of(), Set.of("emr-serverless"), Set.of(),
|
||||
Set.of(EmrServerlessController.class)),
|
||||
descriptor("emr-containers", "emrcontainers", config.services().emrcontainers().enabled(), true,
|
||||
"emrcontainers", storageMode(config.storage().services().emrcontainers().mode(), config.storage().mode()),
|
||||
config.storage().services().emrcontainers().flushIntervalMs(), null, ServiceProtocol.REST_JSON,
|
||||
protocols(ServiceProtocol.REST_JSON),
|
||||
Set.of(), Set.of("emr-containers"), Set.of(),
|
||||
Set.of(EmrContainersController.class)),
|
||||
descriptor("wafv2", "wafv2", config.services().wafv2().enabled(), true,
|
||||
"wafv2", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
|
||||
protocols(ServiceProtocol.JSON),
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
package io.floci.aws.services.emrcontainers;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.services.emrcontainers.EmrContainersService.ListQuery;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.DELETE;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.PATCH;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.QueryParam;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** EMR on EKS's routes, under the prefix {@link EmrContainersRouteFilter} moves them to. */
|
||||
@Path(EmrContainersRouteFilter.INTERNAL_PREFIX)
|
||||
@ApplicationScoped
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public class EmrContainersController {
|
||||
|
||||
private final EmrContainersService service;
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
public EmrContainersController(EmrContainersService service, ObjectMapper mapper) {
|
||||
this.service = service;
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/virtualclusters")
|
||||
public ObjectNode createVirtualCluster(String body) {
|
||||
return service.createVirtualCluster(parse(body));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtualclusters")
|
||||
public ObjectNode listVirtualClusters(@QueryParam("containerProviderId") String containerProviderId,
|
||||
@QueryParam("containerProviderType") String containerProviderType,
|
||||
@QueryParam("createdAfter") String createdAfter,
|
||||
@QueryParam("createdBefore") String createdBefore,
|
||||
@QueryParam("states") List<String> states,
|
||||
@QueryParam("maxResults") String maxResults,
|
||||
@QueryParam("nextToken") String nextToken,
|
||||
@QueryParam("eksAccessEntryIntegrated") String eksAccessEntryIntegrated) {
|
||||
return service.listVirtualClusters(ListQuery.of(createdAfter, createdBefore, states, maxResults, nextToken),
|
||||
containerProviderId, containerProviderType, booleanQuery("eksAccessEntryIntegrated",
|
||||
eksAccessEntryIntegrated));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtualclusters/{virtualClusterId}")
|
||||
public ObjectNode describeVirtualCluster(@PathParam("virtualClusterId") String virtualClusterId) {
|
||||
return service.describeVirtualCluster(virtualClusterId);
|
||||
}
|
||||
|
||||
@PATCH
|
||||
@Path("/virtualclusters/{virtualClusterId}")
|
||||
public ObjectNode updateVirtualCluster(@PathParam("virtualClusterId") String virtualClusterId, String body) {
|
||||
return service.updateVirtualCluster(virtualClusterId, parse(body));
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@Path("/virtualclusters/{virtualClusterId}")
|
||||
public ObjectNode deleteVirtualCluster(@PathParam("virtualClusterId") String virtualClusterId) {
|
||||
return service.deleteVirtualCluster(virtualClusterId);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/virtualclusters/{virtualClusterId}/jobruns")
|
||||
public ObjectNode startJobRun(@PathParam("virtualClusterId") String virtualClusterId, String body) {
|
||||
return service.startJobRun(virtualClusterId, parse(body));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtualclusters/{virtualClusterId}/jobruns")
|
||||
public ObjectNode listJobRuns(@PathParam("virtualClusterId") String virtualClusterId,
|
||||
@QueryParam("createdBefore") String createdBefore,
|
||||
@QueryParam("createdAfter") String createdAfter,
|
||||
@QueryParam("name") String name,
|
||||
@QueryParam("states") List<String> states,
|
||||
@QueryParam("maxResults") String maxResults,
|
||||
@QueryParam("nextToken") String nextToken) {
|
||||
return service.listJobRuns(virtualClusterId,
|
||||
ListQuery.of(createdAfter, createdBefore, states, maxResults, nextToken), name);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtualclusters/{virtualClusterId}/jobruns/{jobRunId}")
|
||||
public ObjectNode describeJobRun(@PathParam("virtualClusterId") String virtualClusterId,
|
||||
@PathParam("jobRunId") String jobRunId) {
|
||||
return service.describeJobRun(virtualClusterId, jobRunId);
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@Path("/virtualclusters/{virtualClusterId}/jobruns/{jobRunId}")
|
||||
public ObjectNode cancelJobRun(@PathParam("virtualClusterId") String virtualClusterId,
|
||||
@PathParam("jobRunId") String jobRunId) {
|
||||
return service.cancelJobRun(virtualClusterId, jobRunId);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/virtualclusters/{virtualClusterId}/endpoints")
|
||||
public ObjectNode createManagedEndpoint(@PathParam("virtualClusterId") String virtualClusterId, String body) {
|
||||
return service.createManagedEndpoint(virtualClusterId, parse(body));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtualclusters/{virtualClusterId}/endpoints")
|
||||
public ObjectNode listManagedEndpoints(@PathParam("virtualClusterId") String virtualClusterId,
|
||||
@QueryParam("createdBefore") String createdBefore,
|
||||
@QueryParam("createdAfter") String createdAfter,
|
||||
@QueryParam("types") List<String> types,
|
||||
@QueryParam("states") List<String> states,
|
||||
@QueryParam("maxResults") String maxResults,
|
||||
@QueryParam("nextToken") String nextToken) {
|
||||
return service.listManagedEndpoints(virtualClusterId,
|
||||
ListQuery.of(createdAfter, createdBefore, states, maxResults, nextToken), types);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/virtualclusters/{virtualClusterId}/endpoints/{endpointId}")
|
||||
public ObjectNode describeManagedEndpoint(@PathParam("virtualClusterId") String virtualClusterId,
|
||||
@PathParam("endpointId") String endpointId) {
|
||||
return service.describeManagedEndpoint(virtualClusterId, endpointId);
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@Path("/virtualclusters/{virtualClusterId}/endpoints/{endpointId}")
|
||||
public ObjectNode deleteManagedEndpoint(@PathParam("virtualClusterId") String virtualClusterId,
|
||||
@PathParam("endpointId") String endpointId) {
|
||||
return service.deleteManagedEndpoint(virtualClusterId, endpointId);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/virtualclusters/{virtualClusterId}/endpoints/{endpointId}/credentials")
|
||||
public ObjectNode getManagedEndpointSessionCredentials(@PathParam("virtualClusterId") String virtualClusterId,
|
||||
@PathParam("endpointId") String endpointId,
|
||||
String body) {
|
||||
return service.getManagedEndpointSessionCredentials(virtualClusterId, endpointId, parse(body));
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/jobtemplates")
|
||||
public ObjectNode createJobTemplate(String body) {
|
||||
return service.createJobTemplate(parse(body));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/jobtemplates")
|
||||
public ObjectNode listJobTemplates(@QueryParam("createdAfter") String createdAfter,
|
||||
@QueryParam("createdBefore") String createdBefore,
|
||||
@QueryParam("maxResults") String maxResults,
|
||||
@QueryParam("nextToken") String nextToken) {
|
||||
return service.listJobTemplates(ListQuery.of(createdAfter, createdBefore, null, maxResults, nextToken));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/jobtemplates/{templateId}")
|
||||
public ObjectNode describeJobTemplate(@PathParam("templateId") String templateId) {
|
||||
return service.describeJobTemplate(templateId);
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@Path("/jobtemplates/{templateId}")
|
||||
public ObjectNode deleteJobTemplate(@PathParam("templateId") String templateId) {
|
||||
return service.deleteJobTemplate(templateId);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/securityconfigurations")
|
||||
public ObjectNode createSecurityConfiguration(String body) {
|
||||
return service.createSecurityConfiguration(parse(body));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/securityconfigurations")
|
||||
public ObjectNode listSecurityConfigurations(@QueryParam("createdAfter") String createdAfter,
|
||||
@QueryParam("createdBefore") String createdBefore,
|
||||
@QueryParam("maxResults") String maxResults,
|
||||
@QueryParam("nextToken") String nextToken) {
|
||||
return service.listSecurityConfigurations(
|
||||
ListQuery.of(createdAfter, createdBefore, null, maxResults, nextToken));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/securityconfigurations/{securityConfigurationId}")
|
||||
public ObjectNode describeSecurityConfiguration(
|
||||
@PathParam("securityConfigurationId") String securityConfigurationId) {
|
||||
return service.describeSecurityConfiguration(securityConfigurationId);
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@Path("/securityconfigurations/{securityConfigurationId}")
|
||||
public ObjectNode deleteSecurityConfiguration(
|
||||
@PathParam("securityConfigurationId") String securityConfigurationId) {
|
||||
return service.deleteSecurityConfiguration(securityConfigurationId);
|
||||
}
|
||||
|
||||
// A query parameter the model types Boolean, refused unless it reads true or false.
|
||||
private static Boolean booleanQuery(String name, String value) {
|
||||
if (value == null || value.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
if ("true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value)) {
|
||||
return Boolean.valueOf(value);
|
||||
}
|
||||
throw new AwsException("ValidationException", name + " must be true or false.", 400);
|
||||
}
|
||||
|
||||
private ObjectNode parse(String body) {
|
||||
if (body == null || body.isBlank()) {
|
||||
return mapper.createObjectNode();
|
||||
}
|
||||
try {
|
||||
JsonNode parsed = mapper.readTree(body);
|
||||
if (parsed instanceof ObjectNode object) {
|
||||
return object;
|
||||
}
|
||||
} catch (JsonProcessingException malformed) {
|
||||
throw new AwsException("ValidationException", "The request body is not valid JSON.", 400);
|
||||
}
|
||||
throw new AwsException("ValidationException", "The request body must be a JSON object.", 400);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package io.floci.aws.services.emrcontainers;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import io.floci.aws.core.common.RequestConstraintCheck;
|
||||
|
||||
/**
|
||||
* Checks every EMR on EKS request, its body with the members its path and query string bind,
|
||||
* against the constraints generated by {@code tools/aws/regen_emr_containers_shapes.py}.
|
||||
*/
|
||||
final class EmrContainersRequestShapes {
|
||||
|
||||
private static final RequestConstraintCheck CHECK = RequestConstraintCheck.load(
|
||||
"aws/emr-containers-request-shapes.json", "EMR on EKS request shapes",
|
||||
RequestConstraintCheck.standardMessages("ValidationException"));
|
||||
|
||||
private EmrContainersRequestShapes() {
|
||||
}
|
||||
|
||||
static void check(String operation, JsonNode request) {
|
||||
CHECK.check(operation, request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package io.floci.aws.services.emrcontainers;
|
||||
|
||||
import io.floci.aws.core.common.ResolvedServiceCatalog;
|
||||
import io.floci.aws.core.common.SignedServiceRoute;
|
||||
import jakarta.annotation.Priority;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.container.ContainerRequestContext;
|
||||
import jakarta.ws.rs.container.ContainerRequestFilter;
|
||||
import jakarta.ws.rs.container.PreMatching;
|
||||
import jakarta.ws.rs.ext.Provider;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* Rewrites EMR on EKS requests to an internal prefix before JAX-RS route matching. Its paths are
|
||||
* literal ({@code /virtualclusters}, {@code /jobtemplates}, {@code /securityconfigurations}), which
|
||||
* S3's path-style routes would read as a bucket, so only a request signed for
|
||||
* {@code emr-containers} is moved and any other request keeps its path.
|
||||
*/
|
||||
@Provider
|
||||
@PreMatching
|
||||
@Priority(5000)
|
||||
public class EmrContainersRouteFilter implements ContainerRequestFilter {
|
||||
|
||||
static final String INTERNAL_PREFIX = "/_emrcontainers";
|
||||
|
||||
private static final Predicate<String> PUBLIC_PATHS = SignedServiceRoute.under("/virtualclusters")
|
||||
.or(SignedServiceRoute.under("/jobtemplates"))
|
||||
.or(SignedServiceRoute.under("/securityconfigurations"));
|
||||
|
||||
private final SignedServiceRoute route;
|
||||
|
||||
@Inject
|
||||
public EmrContainersRouteFilter(ResolvedServiceCatalog catalog) {
|
||||
this.route = new SignedServiceRoute(catalog, "emr-containers", INTERNAL_PREFIX, PUBLIC_PATHS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void filter(ContainerRequestContext ctx) {
|
||||
route.apply(ctx);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,992 @@
|
||||
package io.floci.aws.services.emrcontainers;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.fasterxml.jackson.databind.node.TextNode;
|
||||
import io.floci.aws.config.EmulatorConfig;
|
||||
import io.floci.aws.core.common.AwsArnUtils;
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.core.common.PaginatedResult;
|
||||
import io.floci.aws.core.common.Pagination;
|
||||
import io.floci.aws.core.common.RegionResolver;
|
||||
import io.floci.aws.core.common.RequestContext;
|
||||
import io.floci.aws.core.common.Resettable;
|
||||
import io.floci.aws.core.common.SmithyValidationErrors;
|
||||
import io.floci.aws.core.storage.AccountAwareStorageBackend;
|
||||
import io.floci.aws.core.storage.StorageFactory;
|
||||
import io.floci.aws.services.eks.EksService;
|
||||
import io.floci.aws.services.eks.model.AccessConfig;
|
||||
import io.floci.aws.services.eks.model.Cluster;
|
||||
import io.floci.aws.services.iam.IamService;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Clock;
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* EMR on EKS ({@code emr-containers}): virtual clusters, job runs, job templates, managed endpoints
|
||||
* and security configurations, as control-plane records. A job run follows the job run states
|
||||
* without running Spark on Kubernetes: it completes as soon as it is submitted, or after
|
||||
* {@code floci.services.emrcontainers.job-run-duration-seconds}, and fails as AWS documents when
|
||||
* Floci's EKS has no cluster of the virtual cluster's name.
|
||||
*
|
||||
* <p>Every resource is stored as the JSON AWS answers for it, under its ARN. Members whose name
|
||||
* starts with {@code _} are Floci's own and never leave the service.
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class EmrContainersService implements Resettable {
|
||||
|
||||
static final String SERVICE = "emr-containers";
|
||||
static final String VIRTUAL_CLUSTERS = "/virtualclusters/";
|
||||
static final String JOB_RUNS = "/jobruns/";
|
||||
static final String ENDPOINTS = "/endpoints/";
|
||||
static final String JOB_TEMPLATES = "/jobtemplates/";
|
||||
static final String SECURITY_CONFIGURATIONS = "/securityconfigurations/";
|
||||
|
||||
static final int VIRTUAL_CLUSTER_ID_LENGTH = 25;
|
||||
static final int JOB_RUN_ID_LENGTH = 19;
|
||||
static final int ENDPOINT_ID_LENGTH = 13;
|
||||
|
||||
private static final String CLIENT_TOKEN = "_clientToken";
|
||||
private static final String DUE_AT = "_dueAt";
|
||||
private static final String ACCESS_ENTRY_INTEGRATED = "_eksAccessEntryIntegrated";
|
||||
private static final Set<String> ACCESS_ENTRY_MODES = Set.of("API", "API_AND_CONFIG_MAP");
|
||||
private static final String RUNNING = "RUNNING";
|
||||
private static final String TERMINATED = "TERMINATED";
|
||||
private static final String COMPLETED = "COMPLETED";
|
||||
private static final String CANCELLED = "CANCELLED";
|
||||
private static final String FAILED = "FAILED";
|
||||
private static final String ACTIVE = "ACTIVE";
|
||||
private static final Set<String> FINISHED_JOB_RUN_STATES = Set.of(COMPLETED, CANCELLED, FAILED);
|
||||
private static final Set<String> QUEUED_JOB_RUN_STATES = Set.of("PENDING", "SUBMITTED");
|
||||
private static final Set<String> FINISHED_ENDPOINT_STATES = Set.of(TERMINATED, "TERMINATED_WITH_ERRORS");
|
||||
private static final String TOKEN_CREDENTIAL = "TOKEN";
|
||||
private static final int DEFAULT_SESSION_SECONDS = 15 * 60;
|
||||
private static final int MAX_SESSION_SECONDS = 12 * 60 * 60;
|
||||
private static final int MAX_TAGS = 50;
|
||||
private static final int DEFAULT_PAGE_SIZE = 50;
|
||||
private static final String ID_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
private static final Pattern TEMPLATE_PARAMETER = Pattern.compile("\\$\\{([.\\-_#A-Za-z0-9]+)}");
|
||||
private static final Pattern NUMBER = Pattern.compile("-?\\d+(\\.\\d+)?");
|
||||
private static final Pattern VIRTUAL_CLUSTER_ARN = Pattern.compile("/virtualclusters/([0-9a-z]+)");
|
||||
private static final Pattern NESTED_ARN =
|
||||
Pattern.compile("/virtualclusters/([0-9a-z]+)/(jobruns|endpoints)/([0-9a-z]+)");
|
||||
|
||||
private final AccountAwareStorageBackend<ObjectNode> virtualClusters;
|
||||
private final AccountAwareStorageBackend<ObjectNode> jobRuns;
|
||||
private final AccountAwareStorageBackend<ObjectNode> endpoints;
|
||||
private final AccountAwareStorageBackend<ObjectNode> jobTemplates;
|
||||
private final AccountAwareStorageBackend<ObjectNode> securityConfigurations;
|
||||
private final ObjectMapper mapper;
|
||||
private final RegionResolver regionResolver;
|
||||
private final EksService eksService;
|
||||
private final IamService iamService;
|
||||
private final RequestContext requestContext;
|
||||
private final Clock clock;
|
||||
private final int jobRunDurationSeconds;
|
||||
|
||||
@Inject
|
||||
public EmrContainersService(StorageFactory storageFactory, ObjectMapper mapper, RegionResolver regionResolver,
|
||||
EksService eksService, IamService iamService, RequestContext requestContext,
|
||||
Clock clock, EmulatorConfig config) {
|
||||
this(storage(storageFactory, "emr-containers-virtual-clusters.json"),
|
||||
storage(storageFactory, "emr-containers-job-runs.json"),
|
||||
storage(storageFactory, "emr-containers-endpoints.json"),
|
||||
storage(storageFactory, "emr-containers-job-templates.json"),
|
||||
storage(storageFactory, "emr-containers-security-configurations.json"),
|
||||
mapper, regionResolver, eksService, iamService, requestContext, clock,
|
||||
config.services().emrcontainers().jobRunDurationSeconds());
|
||||
}
|
||||
|
||||
EmrContainersService(AccountAwareStorageBackend<ObjectNode> virtualClusters,
|
||||
AccountAwareStorageBackend<ObjectNode> jobRuns,
|
||||
AccountAwareStorageBackend<ObjectNode> endpoints,
|
||||
AccountAwareStorageBackend<ObjectNode> jobTemplates,
|
||||
AccountAwareStorageBackend<ObjectNode> securityConfigurations,
|
||||
ObjectMapper mapper, RegionResolver regionResolver, EksService eksService,
|
||||
IamService iamService, RequestContext requestContext, Clock clock,
|
||||
int jobRunDurationSeconds) {
|
||||
this.virtualClusters = virtualClusters;
|
||||
this.jobRuns = jobRuns;
|
||||
this.endpoints = endpoints;
|
||||
this.jobTemplates = jobTemplates;
|
||||
this.securityConfigurations = securityConfigurations;
|
||||
this.mapper = mapper;
|
||||
this.regionResolver = regionResolver;
|
||||
this.eksService = eksService;
|
||||
this.iamService = iamService;
|
||||
this.requestContext = requestContext;
|
||||
this.clock = clock;
|
||||
this.jobRunDurationSeconds = jobRunDurationSeconds;
|
||||
}
|
||||
|
||||
private static AccountAwareStorageBackend<ObjectNode> storage(StorageFactory storageFactory, String file) {
|
||||
return storageFactory.create("emrcontainers", file, new TypeReference<Map<String, ObjectNode>>() {});
|
||||
}
|
||||
|
||||
// ── Virtual clusters ─────────────────────────────────────────────────────────
|
||||
|
||||
public synchronized ObjectNode createVirtualCluster(ObjectNode request) {
|
||||
EmrContainersRequestShapes.check("CreateVirtualCluster", request);
|
||||
String clientToken = request.get("clientToken").textValue();
|
||||
Optional<ObjectNode> existing = byClientToken(virtualClusters, arn(VIRTUAL_CLUSTERS), clientToken);
|
||||
if (existing.isPresent()) {
|
||||
return pick(existing.get(), "id", "name", "arn");
|
||||
}
|
||||
if (request.hasNonNull("securityConfigurationId")) {
|
||||
String securityConfigurationId = request.get("securityConfigurationId").textValue();
|
||||
if (securityConfigurations.get(arn(SECURITY_CONFIGURATIONS + securityConfigurationId)).isEmpty()) {
|
||||
throw notFound("Security configuration " + securityConfigurationId + " doesn't exist.");
|
||||
}
|
||||
}
|
||||
String id = newId(VIRTUAL_CLUSTER_ID_LENGTH);
|
||||
String arn = arn(VIRTUAL_CLUSTERS + id);
|
||||
ObjectNode cluster = mapper.createObjectNode();
|
||||
cluster.put("id", id);
|
||||
cluster.set("name", request.get("name"));
|
||||
cluster.put("arn", arn);
|
||||
cluster.put("state", RUNNING);
|
||||
cluster.set("containerProvider", request.get("containerProvider").deepCopy());
|
||||
cluster.put("createdAt", timestamp(now()));
|
||||
cluster.set("tags", tags(request.get("tags")));
|
||||
copy(request, cluster, "securityConfigurationId", "sessionEnabled", "schedulerConfiguration");
|
||||
cluster.put(CLIENT_TOKEN, clientToken);
|
||||
cluster.put(ACCESS_ENTRY_INTEGRATED, accessEntryIntegrated(request.get("containerProvider")));
|
||||
virtualClusters.put(arn, cluster);
|
||||
return pick(cluster, "id", "name", "arn");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode describeVirtualCluster(String id) {
|
||||
EmrContainersRequestShapes.check("DescribeVirtualCluster", object("id", id));
|
||||
ObjectNode cluster = virtualCluster(id).orElseThrow(() -> notFound(virtualClusterMissing(id)));
|
||||
return wrap("virtualCluster", withSchedulerStatus(cluster));
|
||||
}
|
||||
|
||||
public synchronized ObjectNode listVirtualClusters(ListQuery query, String containerProviderId,
|
||||
String containerProviderType,
|
||||
Boolean eksAccessEntryIntegrated) {
|
||||
ObjectNode shape = query.shape();
|
||||
putText(shape, "containerProviderId", containerProviderId);
|
||||
putText(shape, "containerProviderType", containerProviderType);
|
||||
if (eksAccessEntryIntegrated != null) {
|
||||
shape.put("eksAccessEntryIntegrated", eksAccessEntryIntegrated);
|
||||
}
|
||||
EmrContainersRequestShapes.check("ListVirtualClusters", shape);
|
||||
List<ObjectNode> matching = virtualClusters.scan(key -> key.startsWith(arn(VIRTUAL_CLUSTERS))).stream()
|
||||
.filter(query::matches)
|
||||
.filter(cluster -> containerProviderId == null
|
||||
|| containerProviderId.equals(cluster.path("containerProvider").path("id").textValue()))
|
||||
.filter(cluster -> containerProviderType == null
|
||||
|| containerProviderType.equals(cluster.path("containerProvider").path("type").textValue()))
|
||||
.filter(cluster -> eksAccessEntryIntegrated == null
|
||||
|| eksAccessEntryIntegrated == cluster.path(ACCESS_ENTRY_INTEGRATED).asBoolean())
|
||||
.map(this::withSchedulerStatus)
|
||||
.toList();
|
||||
return page(matching, query, "virtualClusters");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode deleteVirtualCluster(String id) {
|
||||
EmrContainersRequestShapes.check("DeleteVirtualCluster", object("id", id));
|
||||
ObjectNode cluster = virtualCluster(id).orElseThrow(() -> invalid(virtualClusterMissing(id)));
|
||||
if (!TERMINATED.equals(cluster.path("state").textValue())) {
|
||||
ObjectNode terminated = cluster.deepCopy();
|
||||
terminated.put("state", TERMINATED);
|
||||
// AWS: "When a virtual cluster is terminated, tags are cleaned and no longer accessible."
|
||||
terminated.set("tags", mapper.createObjectNode());
|
||||
virtualClusters.put(terminated.get("arn").textValue(), terminated);
|
||||
}
|
||||
return object("id", id);
|
||||
}
|
||||
|
||||
public synchronized ObjectNode updateVirtualCluster(String id, ObjectNode request) {
|
||||
request.put("id", id);
|
||||
EmrContainersRequestShapes.check("UpdateVirtualCluster", request);
|
||||
ObjectNode cluster = virtualCluster(id).orElseThrow(() -> notFound(virtualClusterMissing(id)));
|
||||
requireState(cluster, RUNNING, "VirtualCluster", "update");
|
||||
ObjectNode updated = cluster.deepCopy();
|
||||
JsonNode scheduler = request.get("schedulerConfiguration");
|
||||
if (scheduler != null && !scheduler.isNull()) {
|
||||
// An empty object clears the limits; leaving the member out keeps them.
|
||||
if (scheduler.isEmpty()) {
|
||||
updated.remove("schedulerConfiguration");
|
||||
} else {
|
||||
updated.set("schedulerConfiguration", scheduler.deepCopy());
|
||||
}
|
||||
}
|
||||
virtualClusters.put(updated.get("arn").textValue(), updated);
|
||||
return wrap("virtualCluster", withSchedulerStatus(updated));
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a new virtual cluster is EKS access entry integrated, "the virtual cluster created using access entry
|
||||
* API operations from Amazon EKS": the development guide has EMR configure its access that way when the EKS
|
||||
* cluster's authenticationMode admits access entries, and only for virtual clusters created from then on. A
|
||||
* cluster Floci's EKS does not have reads as not integrated.
|
||||
*/
|
||||
private boolean accessEntryIntegrated(JsonNode containerProvider) {
|
||||
String eksCluster = containerProvider.path("id").textValue();
|
||||
return eksService.findAuthenticationCluster(regionResolver.getAccountId(), regionResolver.getRegion(),
|
||||
eksCluster)
|
||||
.map(Cluster::getAccessConfig)
|
||||
.map(AccessConfig::authenticationMode)
|
||||
.filter(ACCESS_ENTRY_MODES::contains)
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
// ── Job runs ─────────────────────────────────────────────────────────────────
|
||||
|
||||
public synchronized ObjectNode startJobRun(String virtualClusterId, ObjectNode request) {
|
||||
request.put("virtualClusterId", virtualClusterId);
|
||||
EmrContainersRequestShapes.check("StartJobRun", request);
|
||||
ObjectNode cluster = virtualCluster(virtualClusterId)
|
||||
.orElseThrow(() -> notFound(virtualClusterMissing(virtualClusterId)));
|
||||
requireState(cluster, RUNNING, "JobRun", "create");
|
||||
String clusterArn = cluster.get("arn").textValue();
|
||||
String clientToken = request.get("clientToken").textValue();
|
||||
Optional<ObjectNode> existing = jobRuns.scan(key -> key.startsWith(clusterArn + JOB_RUNS)).stream()
|
||||
.filter(run -> clientToken.equals(run.path("clientToken").textValue()))
|
||||
.findFirst();
|
||||
if (existing.isPresent()) {
|
||||
return pick(existing.get(), "id", "name", "arn", "virtualClusterId");
|
||||
}
|
||||
|
||||
ObjectNode template = mapper.createObjectNode();
|
||||
if (request.hasNonNull("jobTemplateId")) {
|
||||
template = jobTemplateData(request.get("jobTemplateId").textValue(), request.get("jobTemplateParameters"));
|
||||
}
|
||||
List<String> missing = new ArrayList<>();
|
||||
for (String member : List.of("executionRoleArn", "releaseLabel", "jobDriver")) {
|
||||
if (!request.hasNonNull(member) && !template.hasNonNull(member)) {
|
||||
missing.add(SmithyValidationErrors.notNull(member));
|
||||
}
|
||||
}
|
||||
if (!missing.isEmpty()) {
|
||||
throw SmithyValidationErrors.validationException(missing);
|
||||
}
|
||||
|
||||
String id = newId(JOB_RUN_ID_LENGTH);
|
||||
String arn = clusterArn + JOB_RUNS + id;
|
||||
Instant now = now();
|
||||
ObjectNode run = mapper.createObjectNode();
|
||||
run.put("id", id);
|
||||
copy(request, run, "name");
|
||||
run.put("virtualClusterId", virtualClusterId);
|
||||
run.put("arn", arn);
|
||||
run.put("clientToken", clientToken);
|
||||
for (String member : List.of("executionRoleArn", "releaseLabel", "configurationOverrides", "jobDriver")) {
|
||||
JsonNode value = request.hasNonNull(member) ? request.get(member) : template.get(member);
|
||||
if (value != null && !value.isNull()) {
|
||||
run.set(member, value.deepCopy());
|
||||
}
|
||||
}
|
||||
run.put("createdAt", timestamp(now));
|
||||
run.put("createdBy", createdBy());
|
||||
ObjectNode tags = tags(template.get("jobTags"));
|
||||
tags.setAll(tags(request.get("tags")));
|
||||
if (tags.size() > MAX_TAGS) {
|
||||
throw tooManyTags();
|
||||
}
|
||||
run.set("tags", tags);
|
||||
if (request.hasNonNull("retryPolicyConfiguration")) {
|
||||
run.set("retryPolicyConfiguration", request.get("retryPolicyConfiguration").deepCopy());
|
||||
run.set("retryPolicyExecution", object("currentAttemptCount", 1));
|
||||
}
|
||||
|
||||
String eksCluster = cluster.path("containerProvider").path("id").textValue();
|
||||
if (eksService.findAuthenticationCluster(regionResolver.getAccountId(), regionResolver.getRegion(), eksCluster)
|
||||
.isEmpty()) {
|
||||
// AWS's "Common errors when running jobs": a job run on a cluster EKS does not have.
|
||||
finish(run, FAILED, now);
|
||||
run.put("stateDetails", "Cluster " + eksCluster + " does not exist.");
|
||||
run.put("failureReason", "CLUSTER_UNAVAILABLE");
|
||||
} else if (jobRunDurationSeconds <= 0) {
|
||||
finish(run, COMPLETED, now);
|
||||
} else {
|
||||
run.put("state", RUNNING);
|
||||
run.put(DUE_AT, now.plusSeconds(jobRunDurationSeconds).toEpochMilli());
|
||||
}
|
||||
jobRuns.put(arn, run);
|
||||
return pick(run, "id", "name", "arn", "virtualClusterId");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode describeJobRun(String virtualClusterId, String id) {
|
||||
EmrContainersRequestShapes.check("DescribeJobRun", object("id", id).put("virtualClusterId", virtualClusterId));
|
||||
ObjectNode run = jobRun(virtualClusterId, id).orElseThrow(() -> notFound(jobRunMissing(id)));
|
||||
return wrap("jobRun", run);
|
||||
}
|
||||
|
||||
public synchronized ObjectNode listJobRuns(String virtualClusterId, ListQuery query, String name) {
|
||||
ObjectNode shape = query.shape().put("virtualClusterId", virtualClusterId);
|
||||
putText(shape, "name", name);
|
||||
EmrContainersRequestShapes.check("ListJobRuns", shape);
|
||||
String prefix = arn(VIRTUAL_CLUSTERS + virtualClusterId + JOB_RUNS);
|
||||
List<ObjectNode> matching = jobRuns.scan(key -> key.startsWith(prefix)).stream()
|
||||
.map(this::advance)
|
||||
.filter(query::matches)
|
||||
.filter(run -> name == null || name.equals(run.path("name").textValue()))
|
||||
.toList();
|
||||
return page(matching, query, "jobRuns");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode cancelJobRun(String virtualClusterId, String id) {
|
||||
EmrContainersRequestShapes.check("CancelJobRun", object("id", id).put("virtualClusterId", virtualClusterId));
|
||||
ObjectNode run = jobRun(virtualClusterId, id).orElseThrow(() -> invalid(jobRunMissing(id)));
|
||||
String state = run.path("state").textValue();
|
||||
if (FINISHED_JOB_RUN_STATES.contains(state)) {
|
||||
throw invalid("Job run " + id + " is " + state + " and can't be cancelled.");
|
||||
}
|
||||
ObjectNode cancelled = run.deepCopy();
|
||||
finish(cancelled, CANCELLED, now());
|
||||
jobRuns.put(cancelled.get("arn").textValue(), cancelled);
|
||||
return object("id", id).put("virtualClusterId", virtualClusterId);
|
||||
}
|
||||
|
||||
// ── Job templates ────────────────────────────────────────────────────────────
|
||||
|
||||
public synchronized ObjectNode createJobTemplate(ObjectNode request) {
|
||||
EmrContainersRequestShapes.check("CreateJobTemplate", request);
|
||||
String clientToken = request.get("clientToken").textValue();
|
||||
Optional<ObjectNode> existing = byClientToken(jobTemplates, arn(JOB_TEMPLATES), clientToken);
|
||||
if (existing.isPresent()) {
|
||||
return pick(existing.get(), "id", "name", "arn", "createdAt");
|
||||
}
|
||||
String id = newId(JOB_RUN_ID_LENGTH);
|
||||
String arn = arn(JOB_TEMPLATES + id);
|
||||
ObjectNode template = mapper.createObjectNode();
|
||||
template.set("name", request.get("name"));
|
||||
template.put("id", id);
|
||||
template.put("arn", arn);
|
||||
template.put("createdAt", timestamp(now()));
|
||||
template.put("createdBy", createdBy());
|
||||
template.set("tags", tags(request.get("tags")));
|
||||
template.set("jobTemplateData", request.get("jobTemplateData").deepCopy());
|
||||
copy(request, template, "kmsKeyArn");
|
||||
template.put(CLIENT_TOKEN, clientToken);
|
||||
jobTemplates.put(arn, template);
|
||||
return pick(template, "id", "name", "arn", "createdAt");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode describeJobTemplate(String id) {
|
||||
EmrContainersRequestShapes.check("DescribeJobTemplate", object("id", id));
|
||||
ObjectNode template = jobTemplates.get(arn(JOB_TEMPLATES + id))
|
||||
.orElseThrow(() -> notFound(jobTemplateMissing(id)));
|
||||
return wrap("jobTemplate", template);
|
||||
}
|
||||
|
||||
public synchronized ObjectNode listJobTemplates(ListQuery query) {
|
||||
EmrContainersRequestShapes.check("ListJobTemplates", query.shape());
|
||||
List<ObjectNode> matching = jobTemplates.scan(key -> key.startsWith(arn(JOB_TEMPLATES))).stream()
|
||||
.filter(query::matches)
|
||||
.toList();
|
||||
return page(matching, query, "templates");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode deleteJobTemplate(String id) {
|
||||
EmrContainersRequestShapes.check("DeleteJobTemplate", object("id", id));
|
||||
String arn = arn(JOB_TEMPLATES + id);
|
||||
if (jobTemplates.get(arn).isEmpty()) {
|
||||
throw invalid(jobTemplateMissing(id));
|
||||
}
|
||||
jobTemplates.delete(arn);
|
||||
return object("id", id);
|
||||
}
|
||||
|
||||
// ── Managed endpoints ────────────────────────────────────────────────────────
|
||||
|
||||
public synchronized ObjectNode createManagedEndpoint(String virtualClusterId, ObjectNode request) {
|
||||
request.put("virtualClusterId", virtualClusterId);
|
||||
EmrContainersRequestShapes.check("CreateManagedEndpoint", request);
|
||||
ObjectNode cluster = virtualCluster(virtualClusterId)
|
||||
.orElseThrow(() -> notFound(virtualClusterMissing(virtualClusterId)));
|
||||
requireState(cluster, RUNNING, "Endpoint", "create");
|
||||
String prefix = cluster.get("arn").textValue() + ENDPOINTS;
|
||||
String clientToken = request.get("clientToken").textValue();
|
||||
Optional<ObjectNode> existing = byClientToken(endpoints, prefix, clientToken);
|
||||
if (existing.isPresent()) {
|
||||
return pick(existing.get(), "id", "name", "arn", "virtualClusterId");
|
||||
}
|
||||
String id = newId(ENDPOINT_ID_LENGTH);
|
||||
String arn = prefix + id;
|
||||
ObjectNode endpoint = mapper.createObjectNode();
|
||||
endpoint.put("id", id);
|
||||
endpoint.set("name", request.get("name"));
|
||||
endpoint.put("arn", arn);
|
||||
endpoint.put("virtualClusterId", virtualClusterId);
|
||||
endpoint.set("type", request.get("type"));
|
||||
endpoint.put("state", ACTIVE);
|
||||
endpoint.set("releaseLabel", request.get("releaseLabel"));
|
||||
endpoint.set("executionRoleArn", request.get("executionRoleArn"));
|
||||
copy(request, endpoint, "certificateArn", "configurationOverrides");
|
||||
endpoint.put("createdAt", timestamp(now()));
|
||||
endpoint.set("tags", tags(request.get("tags")));
|
||||
endpoint.put(CLIENT_TOKEN, clientToken);
|
||||
endpoints.put(arn, endpoint);
|
||||
return pick(endpoint, "id", "name", "arn", "virtualClusterId");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode describeManagedEndpoint(String virtualClusterId, String id) {
|
||||
EmrContainersRequestShapes.check("DescribeManagedEndpoint",
|
||||
object("id", id).put("virtualClusterId", virtualClusterId));
|
||||
ObjectNode endpoint = endpoint(virtualClusterId, id).orElseThrow(() -> notFound(endpointMissing(id)));
|
||||
return wrap("endpoint", endpoint);
|
||||
}
|
||||
|
||||
public synchronized ObjectNode listManagedEndpoints(String virtualClusterId, ListQuery query, List<String> types) {
|
||||
ObjectNode shape = query.shape().put("virtualClusterId", virtualClusterId);
|
||||
putList(shape, "types", types);
|
||||
EmrContainersRequestShapes.check("ListManagedEndpoints", shape);
|
||||
String prefix = arn(VIRTUAL_CLUSTERS + virtualClusterId + ENDPOINTS);
|
||||
List<ObjectNode> matching = endpoints.scan(key -> key.startsWith(prefix)).stream()
|
||||
.filter(query::matches)
|
||||
.filter(endpoint -> types == null || types.isEmpty()
|
||||
|| types.contains(endpoint.path("type").textValue()))
|
||||
.toList();
|
||||
return page(matching, query, "endpoints");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode deleteManagedEndpoint(String virtualClusterId, String id) {
|
||||
EmrContainersRequestShapes.check("DeleteManagedEndpoint",
|
||||
object("id", id).put("virtualClusterId", virtualClusterId));
|
||||
ObjectNode endpoint = endpoint(virtualClusterId, id).orElseThrow(() -> invalid(endpointMissing(id)));
|
||||
if (!FINISHED_ENDPOINT_STATES.contains(endpoint.path("state").textValue())) {
|
||||
ObjectNode terminated = endpoint.deepCopy();
|
||||
terminated.put("state", TERMINATED);
|
||||
endpoints.put(terminated.get("arn").textValue(), terminated);
|
||||
}
|
||||
return object("id", id).put("virtualClusterId", virtualClusterId);
|
||||
}
|
||||
|
||||
public synchronized ObjectNode getManagedEndpointSessionCredentials(String virtualClusterId, String endpointId,
|
||||
ObjectNode request) {
|
||||
request.put("virtualClusterIdentifier", virtualClusterId);
|
||||
request.put("endpointIdentifier", endpointId);
|
||||
EmrContainersRequestShapes.check("GetManagedEndpointSessionCredentials", request);
|
||||
ObjectNode endpoint = endpoint(virtualClusterId, endpointId)
|
||||
.orElseThrow(() -> notFound(endpointMissing(endpointId)));
|
||||
if (!ACTIVE.equals(endpoint.path("state").textValue())) {
|
||||
throw invalid("Endpoint " + endpointId + " is " + endpoint.path("state").textValue()
|
||||
+ " and can't issue session credentials.");
|
||||
}
|
||||
// The API reference: TOKEN is the only credential type, and the default.
|
||||
if (!TOKEN_CREDENTIAL.equals(request.get("credentialType").textValue())) {
|
||||
throw invalid("Credential type " + request.get("credentialType").textValue() + " is not supported.");
|
||||
}
|
||||
// The API reference: "The default duration is 15 minutes and the maximum is 12 hours."
|
||||
int seconds = request.hasNonNull("durationInSeconds")
|
||||
? request.get("durationInSeconds").intValue() : DEFAULT_SESSION_SECONDS;
|
||||
if (seconds < 1 || seconds > MAX_SESSION_SECONDS) {
|
||||
throw invalid("durationInSeconds must be between 1 and " + MAX_SESSION_SECONDS + ".");
|
||||
}
|
||||
ObjectNode credentials = object("token", sessionToken());
|
||||
ObjectNode response = object("id", newId(JOB_RUN_ID_LENGTH));
|
||||
response.set("credentials", credentials);
|
||||
response.set("endpointCredentials", credentials.deepCopy());
|
||||
response.put("expiresAt", timestamp(now().plusSeconds(seconds)));
|
||||
return response;
|
||||
}
|
||||
|
||||
// ── Security configurations ──────────────────────────────────────────────────
|
||||
|
||||
public synchronized ObjectNode createSecurityConfiguration(ObjectNode request) {
|
||||
EmrContainersRequestShapes.check("CreateSecurityConfiguration", request);
|
||||
String clientToken = request.get("clientToken").textValue();
|
||||
Optional<ObjectNode> existing = byClientToken(securityConfigurations, arn(SECURITY_CONFIGURATIONS),
|
||||
clientToken);
|
||||
if (existing.isPresent()) {
|
||||
return pick(existing.get(), "id", "name", "arn");
|
||||
}
|
||||
String id = newId(JOB_RUN_ID_LENGTH);
|
||||
String arn = arn(SECURITY_CONFIGURATIONS + id);
|
||||
ObjectNode configuration = mapper.createObjectNode();
|
||||
configuration.put("id", id);
|
||||
configuration.set("name", request.get("name"));
|
||||
configuration.put("arn", arn);
|
||||
configuration.put("createdAt", timestamp(now()));
|
||||
configuration.put("createdBy", createdBy());
|
||||
configuration.set("securityConfigurationData", request.get("securityConfigurationData").deepCopy());
|
||||
configuration.set("tags", tags(request.get("tags")));
|
||||
configuration.put(CLIENT_TOKEN, clientToken);
|
||||
securityConfigurations.put(arn, configuration);
|
||||
return pick(configuration, "id", "name", "arn");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode describeSecurityConfiguration(String id) {
|
||||
EmrContainersRequestShapes.check("DescribeSecurityConfiguration", object("id", id));
|
||||
ObjectNode configuration = securityConfigurations.get(arn(SECURITY_CONFIGURATIONS + id))
|
||||
.orElseThrow(() -> notFound(securityConfigurationMissing(id)));
|
||||
return wrap("securityConfiguration", configuration);
|
||||
}
|
||||
|
||||
public synchronized ObjectNode listSecurityConfigurations(ListQuery query) {
|
||||
EmrContainersRequestShapes.check("ListSecurityConfigurations", query.shape());
|
||||
List<ObjectNode> matching = securityConfigurations.scan(key -> key.startsWith(arn(SECURITY_CONFIGURATIONS)))
|
||||
.stream()
|
||||
.filter(query::matches)
|
||||
.toList();
|
||||
return page(matching, query, "securityConfigurations");
|
||||
}
|
||||
|
||||
public synchronized ObjectNode deleteSecurityConfiguration(String id) {
|
||||
EmrContainersRequestShapes.check("DeleteSecurityConfiguration", object("id", id));
|
||||
String arn = arn(SECURITY_CONFIGURATIONS + id);
|
||||
if (securityConfigurations.get(arn).isEmpty()) {
|
||||
throw invalid(securityConfigurationMissing(id));
|
||||
}
|
||||
securityConfigurations.delete(arn);
|
||||
return object("id", id);
|
||||
}
|
||||
|
||||
// ── Tags ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
public synchronized Map<String, String> listTags(String resourceArn) {
|
||||
EmrContainersRequestShapes.check("ListTagsForResource", object("resourceArn", resourceArn));
|
||||
return tagMap(taggable(resourceArn).resource());
|
||||
}
|
||||
|
||||
public synchronized void tagResource(String resourceArn, Map<String, String> tags) {
|
||||
ObjectNode request = object("resourceArn", resourceArn);
|
||||
request.set("tags", mapper.valueToTree(tags));
|
||||
EmrContainersRequestShapes.check("TagResource", request);
|
||||
Taggable target = activeTaggable(resourceArn);
|
||||
ObjectNode updated = target.resource().deepCopy();
|
||||
ObjectNode merged = tags(updated.get("tags"));
|
||||
merged.setAll(tags(request.get("tags")));
|
||||
if (merged.size() > MAX_TAGS) {
|
||||
throw tooManyTags();
|
||||
}
|
||||
updated.set("tags", merged);
|
||||
target.storage().put(resourceArn, updated);
|
||||
}
|
||||
|
||||
public synchronized void untagResource(String resourceArn, List<String> tagKeys) {
|
||||
ObjectNode request = object("resourceArn", resourceArn);
|
||||
putList(request, "tagKeys", tagKeys == null ? List.of() : tagKeys);
|
||||
EmrContainersRequestShapes.check("UntagResource", request);
|
||||
Taggable target = activeTaggable(resourceArn);
|
||||
ObjectNode updated = target.resource().deepCopy();
|
||||
ObjectNode remaining = tags(updated.get("tags"));
|
||||
if (tagKeys != null) {
|
||||
remaining.remove(tagKeys);
|
||||
}
|
||||
updated.set("tags", remaining);
|
||||
target.storage().put(resourceArn, updated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void clear() {
|
||||
virtualClusters.clear();
|
||||
jobRuns.clear();
|
||||
endpoints.clear();
|
||||
jobTemplates.clear();
|
||||
securityConfigurations.clear();
|
||||
}
|
||||
|
||||
// ── Paging and filtering ─────────────────────────────────────────────────────
|
||||
|
||||
/** The query members every List operation shares, parsed from the query string. */
|
||||
public record ListQuery(Instant createdAfter, Instant createdBefore, List<String> states, Integer maxResults,
|
||||
String nextToken) {
|
||||
|
||||
public static ListQuery of(String createdAfter, String createdBefore, List<String> states,
|
||||
String maxResults, String nextToken) {
|
||||
return new ListQuery(instant("createdAfter", createdAfter), instant("createdBefore", createdBefore),
|
||||
states == null || states.isEmpty() ? null : List.copyOf(states),
|
||||
Pagination.parseMaxResults(maxResults, "ValidationException"), nextToken);
|
||||
}
|
||||
|
||||
/** The members the request shapes check, as the request carries them; timestamps are parsed above. */
|
||||
ObjectNode shape() {
|
||||
ObjectNode shape = JsonNodeFactory.instance.objectNode();
|
||||
putList(shape, "states", states);
|
||||
if (maxResults != null) {
|
||||
shape.put("maxResults", maxResults);
|
||||
}
|
||||
putText(shape, "nextToken", nextToken);
|
||||
return shape;
|
||||
}
|
||||
|
||||
boolean matches(ObjectNode resource) {
|
||||
Instant createdAt = Instant.parse(resource.get("createdAt").textValue());
|
||||
return (createdAfter == null || !createdAt.isBefore(createdAfter))
|
||||
&& (createdBefore == null || !createdAt.isAfter(createdBefore))
|
||||
&& (states == null || states.contains(resource.path("state").textValue()));
|
||||
}
|
||||
|
||||
private static Instant instant(String member, String value) {
|
||||
if (value == null || value.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Instant.parse(value);
|
||||
} catch (DateTimeParseException notIso) {
|
||||
try {
|
||||
BigDecimal seconds = new BigDecimal(value);
|
||||
return Instant.ofEpochMilli(seconds.movePointRight(3).longValue());
|
||||
} catch (NumberFormatException notEpoch) {
|
||||
throw new AwsException("ValidationException", "Invalid value for " + member + ": " + value, 400);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ObjectNode page(List<ObjectNode> resources, ListQuery query, String member) {
|
||||
if (query.maxResults() != null && query.maxResults() < 1) {
|
||||
throw invalid("maxResults must be at least 1.");
|
||||
}
|
||||
int limit = query.maxResults() != null ? query.maxResults() : DEFAULT_PAGE_SIZE;
|
||||
PaginatedResult<ObjectNode> page = Pagination.paginate(resources, resource -> resource.get("id").textValue(),
|
||||
limit, query.nextToken(), member, token -> invalid("Invalid nextToken."));
|
||||
ArrayNode items = mapper.createArrayNode();
|
||||
for (ObjectNode resource : page.items()) {
|
||||
items.add(view(resource));
|
||||
}
|
||||
ObjectNode response = mapper.createObjectNode();
|
||||
response.set(member, items);
|
||||
if (page.nextToken() != null) {
|
||||
response.put("nextToken", page.nextToken());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
// ── Lookups ──────────────────────────────────────────────────────────────────
|
||||
|
||||
private Optional<ObjectNode> virtualCluster(String id) {
|
||||
return virtualClusters.get(arn(VIRTUAL_CLUSTERS + id));
|
||||
}
|
||||
|
||||
private Optional<ObjectNode> jobRun(String virtualClusterId, String id) {
|
||||
return jobRuns.get(arn(VIRTUAL_CLUSTERS + virtualClusterId + JOB_RUNS + id)).map(this::advance);
|
||||
}
|
||||
|
||||
private Optional<ObjectNode> endpoint(String virtualClusterId, String id) {
|
||||
return endpoints.get(arn(VIRTUAL_CLUSTERS + virtualClusterId + ENDPOINTS + id));
|
||||
}
|
||||
|
||||
private Optional<ObjectNode> byClientToken(AccountAwareStorageBackend<ObjectNode> storage, String prefix,
|
||||
String clientToken) {
|
||||
return storage.scan(key -> key.startsWith(prefix)).stream()
|
||||
.filter(resource -> clientToken.equals(resource.path(CLIENT_TOKEN).textValue()))
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* A resource TagResource can name, as the model's ARN pattern limits it to: a virtual cluster, or
|
||||
* one of its job runs or managed endpoints.
|
||||
*/
|
||||
private record Taggable(AccountAwareStorageBackend<ObjectNode> storage, ObjectNode resource, boolean active) {}
|
||||
|
||||
private Taggable taggable(String resourceArn) {
|
||||
AwsArnUtils.Arn parsed;
|
||||
try {
|
||||
parsed = AwsArnUtils.parse(resourceArn);
|
||||
} catch (IllegalArgumentException malformed) {
|
||||
throw invalid("Invalid resourceArn: " + resourceArn);
|
||||
}
|
||||
// A resource is the request's Region's, as every other operation finds it: another Region's ARN names none.
|
||||
if (!regionResolver.getRegion().equals(parsed.region())) {
|
||||
throw resourceMissing(resourceArn);
|
||||
}
|
||||
String resource = parsed.resource();
|
||||
if (VIRTUAL_CLUSTER_ARN.matcher(resource).matches()) {
|
||||
ObjectNode cluster = virtualClusters.get(resourceArn).orElseThrow(() -> resourceMissing(resourceArn));
|
||||
return new Taggable(virtualClusters, cluster, !TERMINATED.equals(cluster.path("state").textValue()));
|
||||
}
|
||||
Matcher nested = NESTED_ARN.matcher(resource);
|
||||
if (nested.matches() && "jobruns".equals(nested.group(2))) {
|
||||
ObjectNode run = jobRuns.get(resourceArn).map(this::advance)
|
||||
.orElseThrow(() -> resourceMissing(resourceArn));
|
||||
return new Taggable(jobRuns, run, !FINISHED_JOB_RUN_STATES.contains(run.path("state").textValue()));
|
||||
}
|
||||
if (nested.matches()) {
|
||||
ObjectNode endpoint = endpoints.get(resourceArn).orElseThrow(() -> resourceMissing(resourceArn));
|
||||
return new Taggable(endpoints, endpoint,
|
||||
!FINISHED_ENDPOINT_STATES.contains(endpoint.path("state").textValue()));
|
||||
}
|
||||
throw resourceMissing(resourceArn);
|
||||
}
|
||||
|
||||
/** AWS: "You can tag new or existing virtual clusters and job runs that are in active states." */
|
||||
private Taggable activeTaggable(String resourceArn) {
|
||||
Taggable target = taggable(resourceArn);
|
||||
if (!target.active()) {
|
||||
throw invalid("Resource " + resourceArn + " is " + target.resource().path("state").textValue()
|
||||
+ " and can't be tagged.");
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
// ── Job templates in a job run ───────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* The template's job data with every {@code ${name}} replaced by the parameter's value in the
|
||||
* request, or else its default. A declared parameter with neither is refused, as is a value a
|
||||
* {@code NUMBER} parameter cannot read as a number; a placeholder no parameter declares stays.
|
||||
*/
|
||||
private ObjectNode jobTemplateData(String templateId, JsonNode parameters) {
|
||||
ObjectNode template = jobTemplates.get(arn(JOB_TEMPLATES + templateId))
|
||||
.orElseThrow(() -> notFound(jobTemplateMissing(templateId)));
|
||||
ObjectNode data = template.get("jobTemplateData").deepCopy();
|
||||
JsonNode declared = data.remove("parameterConfiguration");
|
||||
Map<String, String> values = new HashMap<>();
|
||||
if (declared != null) {
|
||||
for (Map.Entry<String, JsonNode> parameter : declared.properties()) {
|
||||
String name = parameter.getKey();
|
||||
JsonNode given = parameters == null ? null : parameters.get(name);
|
||||
String value = given != null && !given.isNull()
|
||||
? given.asText() : parameter.getValue().path("defaultValue").textValue();
|
||||
if (value == null) {
|
||||
throw invalid("Job template parameter " + name + " requires a value.");
|
||||
}
|
||||
boolean number = "NUMBER".equals(parameter.getValue().path("type").textValue());
|
||||
if (number && !NUMBER.matcher(value).matches()) {
|
||||
throw invalid("Job template parameter " + name + " must be a number.");
|
||||
}
|
||||
values.put(name, value);
|
||||
}
|
||||
}
|
||||
return (ObjectNode) substitute(data, values);
|
||||
}
|
||||
|
||||
private JsonNode substitute(JsonNode node, Map<String, String> values) {
|
||||
if (node.isTextual()) {
|
||||
Matcher matcher = TEMPLATE_PARAMETER.matcher(node.textValue());
|
||||
StringBuilder replaced = new StringBuilder();
|
||||
while (matcher.find()) {
|
||||
matcher.appendReplacement(replaced,
|
||||
Matcher.quoteReplacement(values.getOrDefault(matcher.group(1), matcher.group())));
|
||||
}
|
||||
matcher.appendTail(replaced);
|
||||
return TextNode.valueOf(replaced.toString());
|
||||
}
|
||||
if (node.isObject()) {
|
||||
ObjectNode copy = mapper.createObjectNode();
|
||||
for (Map.Entry<String, JsonNode> field : node.properties()) {
|
||||
copy.set(field.getKey(), substitute(field.getValue(), values));
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
if (node.isArray()) {
|
||||
ArrayNode copy = mapper.createArrayNode();
|
||||
for (JsonNode item : node) {
|
||||
copy.add(substitute(item, values));
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
// ── States ───────────────────────────────────────────────────────────────────
|
||||
|
||||
/** Completes a RUNNING job run whose duration has passed, and stores the change. */
|
||||
private ObjectNode advance(ObjectNode run) {
|
||||
if (!RUNNING.equals(run.path("state").textValue()) || !run.has(DUE_AT)) {
|
||||
return run;
|
||||
}
|
||||
Instant dueAt = Instant.ofEpochMilli(run.get(DUE_AT).longValue());
|
||||
if (now().isBefore(dueAt)) {
|
||||
return run;
|
||||
}
|
||||
ObjectNode completed = run.deepCopy();
|
||||
finish(completed, COMPLETED, dueAt);
|
||||
jobRuns.put(completed.get("arn").textValue(), completed);
|
||||
return completed;
|
||||
}
|
||||
|
||||
private void finish(ObjectNode run, String state, Instant at) {
|
||||
run.put("state", state);
|
||||
run.put("finishedAt", timestamp(at));
|
||||
run.remove(DUE_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* AWS's "Common errors when running jobs": "Virtual cluster state {state} is not valid to create
|
||||
* resource JobRun."; the same wording names the resource and the action for the others.
|
||||
*/
|
||||
private void requireState(ObjectNode cluster, String state, String resource, String action) {
|
||||
String current = cluster.path("state").textValue();
|
||||
if (!state.equals(current)) {
|
||||
throw invalid("Virtual cluster state " + current + " is not valid to " + action + " resource "
|
||||
+ resource + ".");
|
||||
}
|
||||
}
|
||||
|
||||
private ObjectNode withSchedulerStatus(ObjectNode cluster) {
|
||||
JsonNode scheduler = cluster.get("schedulerConfiguration");
|
||||
if (scheduler == null || scheduler.isEmpty()) {
|
||||
return cluster;
|
||||
}
|
||||
String prefix = cluster.get("arn").textValue() + JOB_RUNS;
|
||||
List<ObjectNode> runs = jobRuns.scan(key -> key.startsWith(prefix)).stream().map(this::advance).toList();
|
||||
ObjectNode status = mapper.createObjectNode();
|
||||
status.put("currentInQueueJobRuns", count(runs, QUEUED_JOB_RUN_STATES::contains));
|
||||
status.put("currentConcurrentJobRuns", count(runs, RUNNING::equals));
|
||||
ObjectNode withStatus = cluster.deepCopy();
|
||||
withStatus.set("schedulerStatus", status);
|
||||
return withStatus;
|
||||
}
|
||||
|
||||
private static long count(Collection<ObjectNode> runs, Predicate<String> state) {
|
||||
return runs.stream().filter(run -> state.test(run.path("state").textValue())).count();
|
||||
}
|
||||
|
||||
// ── JSON helpers ─────────────────────────────────────────────────────────────
|
||||
|
||||
private ObjectNode wrap(String member, ObjectNode resource) {
|
||||
ObjectNode response = mapper.createObjectNode();
|
||||
response.set(member, view(resource));
|
||||
return response;
|
||||
}
|
||||
|
||||
/** The resource as AWS answers it: without Floci's own members. */
|
||||
private static ObjectNode view(ObjectNode resource) {
|
||||
ObjectNode copy = resource.deepCopy();
|
||||
List<String> internal = new ArrayList<>();
|
||||
copy.fieldNames().forEachRemaining(name -> {
|
||||
if (name.startsWith("_")) {
|
||||
internal.add(name);
|
||||
}
|
||||
});
|
||||
copy.remove(internal);
|
||||
return copy;
|
||||
}
|
||||
|
||||
private ObjectNode pick(ObjectNode resource, String... members) {
|
||||
ObjectNode picked = mapper.createObjectNode();
|
||||
copy(resource, picked, members);
|
||||
return picked;
|
||||
}
|
||||
|
||||
private static void copy(JsonNode from, ObjectNode to, String... members) {
|
||||
for (String member : members) {
|
||||
JsonNode value = from.get(member);
|
||||
if (value != null && !value.isNull()) {
|
||||
to.set(member, value.deepCopy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ObjectNode object(String member, String value) {
|
||||
return mapper.createObjectNode().put(member, value);
|
||||
}
|
||||
|
||||
private ObjectNode object(String member, int value) {
|
||||
return mapper.createObjectNode().put(member, value);
|
||||
}
|
||||
|
||||
private ObjectNode tags(JsonNode tags) {
|
||||
return tags != null && tags.isObject() ? ((ObjectNode) tags).deepCopy() : mapper.createObjectNode();
|
||||
}
|
||||
|
||||
private static Map<String, String> tagMap(ObjectNode resource) {
|
||||
Map<String, String> tags = new HashMap<>();
|
||||
resource.path("tags").properties().forEach(tag -> tags.put(tag.getKey(), tag.getValue().asText()));
|
||||
return tags;
|
||||
}
|
||||
|
||||
private static void putText(ObjectNode node, String member, String value) {
|
||||
if (value != null) {
|
||||
node.put(member, value);
|
||||
}
|
||||
}
|
||||
|
||||
private static void putList(ObjectNode node, String member, List<String> values) {
|
||||
if (values != null) {
|
||||
ArrayNode array = node.putArray(member);
|
||||
values.forEach(array::add);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Identity, time and errors ────────────────────────────────────────────────
|
||||
|
||||
private String arn(String resource) {
|
||||
return regionResolver.buildArn(SERVICE, regionResolver.getRegion(), regionResolver.getAccountId(), resource);
|
||||
}
|
||||
|
||||
private String createdBy() {
|
||||
String accessKeyId = requestContext != null ? requestContext.getAccessKeyId() : null;
|
||||
return iamService.resolveCallerArn(accessKeyId)
|
||||
.orElseGet(() -> regionResolver.buildGlobalArn("iam", regionResolver.getAccountId(), "root"));
|
||||
}
|
||||
|
||||
private Instant now() {
|
||||
return clock.instant().truncatedTo(ChronoUnit.SECONDS);
|
||||
}
|
||||
|
||||
private static String timestamp(Instant instant) {
|
||||
return instant.toString();
|
||||
}
|
||||
|
||||
/** An id of {@code length} lowercase letters and digits, as the model's {@code [0-9a-z]+} allows. */
|
||||
static String newId(int length) {
|
||||
StringBuilder id = new StringBuilder(length);
|
||||
ThreadLocalRandom random = ThreadLocalRandom.current();
|
||||
for (int i = 0; i < length; i++) {
|
||||
id.append(ID_ALPHABET.charAt(random.nextInt(ID_ALPHABET.length())));
|
||||
}
|
||||
return id.toString();
|
||||
}
|
||||
|
||||
private static String sessionToken() {
|
||||
byte[] bytes = new byte[48];
|
||||
ThreadLocalRandom.current().nextBytes(bytes);
|
||||
return Base64.getEncoder().encodeToString(bytes);
|
||||
}
|
||||
|
||||
private static String virtualClusterMissing(String id) {
|
||||
// AWS's "Common errors when running jobs" for StartJobRun.
|
||||
return "Virtual cluster " + id + " doesn't exist.";
|
||||
}
|
||||
|
||||
private static String jobRunMissing(String id) {
|
||||
return "Job run " + id + " doesn't exist.";
|
||||
}
|
||||
|
||||
private static String endpointMissing(String id) {
|
||||
return "Endpoint " + id + " doesn't exist.";
|
||||
}
|
||||
|
||||
private static String jobTemplateMissing(String id) {
|
||||
return "Job template " + id + " doesn't exist.";
|
||||
}
|
||||
|
||||
private static String securityConfigurationMissing(String id) {
|
||||
return "Security configuration " + id + " doesn't exist.";
|
||||
}
|
||||
|
||||
private static AwsException tooManyTags() {
|
||||
// The development guide's tag restrictions: "Maximum number of tags per resource – 50".
|
||||
return invalid("A resource can have at most " + MAX_TAGS + " tags.");
|
||||
}
|
||||
|
||||
private static AwsException resourceMissing(String resourceArn) {
|
||||
return notFound("Resource " + resourceArn + " doesn't exist.");
|
||||
}
|
||||
|
||||
private static AwsException notFound(String message) {
|
||||
return new AwsException("ResourceNotFoundException", message, 400);
|
||||
}
|
||||
|
||||
private static AwsException invalid(String message) {
|
||||
return new AwsException("ValidationException", message, 400);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package io.floci.aws.services.emrcontainers;
|
||||
|
||||
import io.floci.aws.core.common.TagHandler;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* EMR on EKS on the shared {@code /tags/{resourceArn}} path, for virtual clusters and their job runs
|
||||
* and managed endpoints: the model's ARN pattern names no other resource. The wire shape is the
|
||||
* common one (a lowercase {@code tags} map, a {@code tagKeys} query and {@code POST}), except that
|
||||
* TagResource and UntagResource answer 200 rather than 204, and payloads are validated strictly.
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class EmrContainersTagHandler implements TagHandler {
|
||||
|
||||
private final EmrContainersService service;
|
||||
|
||||
@Inject
|
||||
public EmrContainersTagHandler(EmrContainersService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String serviceKey() {
|
||||
return EmrContainersService.SERVICE;
|
||||
}
|
||||
|
||||
/** Tag values must be JSON strings, as the model's TagMap declares; nothing is coerced. */
|
||||
@Override
|
||||
public boolean strictTagValidation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** The model gives TagResource and UntagResource no other response code, so they answer 200. */
|
||||
@Override
|
||||
public int tagResourceSuccessStatus() {
|
||||
return 200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int untagResourceSuccessStatus() {
|
||||
return 200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> listTags(String region, String arn) {
|
||||
return service.listTags(arn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tagResource(String region, String arn, Map<String, String> tags) {
|
||||
service.tagResource(arn, tags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void untagResource(String region, String arn, List<String> tagKeys) {
|
||||
service.untagResource(arn, tagKeys);
|
||||
}
|
||||
}
|
||||
@@ -305,6 +305,8 @@ floci:
|
||||
flush-interval-ms: 5000
|
||||
emrserverless:
|
||||
flush-interval-ms: 5000
|
||||
emrcontainers:
|
||||
flush-interval-ms: 5000
|
||||
lakeformation:
|
||||
flush-interval-ms: 5000
|
||||
|
||||
@@ -1078,6 +1080,9 @@ floci:
|
||||
# Remove the drivers and executors a previous run of this deployment left on the daemon before
|
||||
# the first job run starts. Scoped to this deployment's own containers.
|
||||
reconcile-containers-on-startup: true
|
||||
emrcontainers:
|
||||
enabled: true
|
||||
job-run-duration-seconds: 0 # 0 = a job run completes as soon as it is submitted
|
||||
ssoadmin:
|
||||
enabled: true
|
||||
ssooidc:
|
||||
|
||||
@@ -0,0 +1,958 @@
|
||||
{
|
||||
"_source": {
|
||||
"generator": "tools/aws/regen_emr_containers_shapes.py",
|
||||
"botocore": "botocore 1.43.118 (installed package)"
|
||||
},
|
||||
"operations": {
|
||||
"CancelJobRun": "CancelJobRunRequest",
|
||||
"CreateJobTemplate": "CreateJobTemplateRequest",
|
||||
"CreateManagedEndpoint": "CreateManagedEndpointRequest",
|
||||
"CreateSecurityConfiguration": "CreateSecurityConfigurationRequest",
|
||||
"CreateVirtualCluster": "CreateVirtualClusterRequest",
|
||||
"DeleteJobTemplate": "DeleteJobTemplateRequest",
|
||||
"DeleteManagedEndpoint": "DeleteManagedEndpointRequest",
|
||||
"DeleteSecurityConfiguration": "DeleteSecurityConfigurationRequest",
|
||||
"DeleteVirtualCluster": "DeleteVirtualClusterRequest",
|
||||
"DescribeJobRun": "DescribeJobRunRequest",
|
||||
"DescribeJobTemplate": "DescribeJobTemplateRequest",
|
||||
"DescribeManagedEndpoint": "DescribeManagedEndpointRequest",
|
||||
"DescribeSecurityConfiguration": "DescribeSecurityConfigurationRequest",
|
||||
"DescribeVirtualCluster": "DescribeVirtualClusterRequest",
|
||||
"GetManagedEndpointSessionCredentials": "GetManagedEndpointSessionCredentialsRequest",
|
||||
"ListJobRuns": "ListJobRunsRequest",
|
||||
"ListJobTemplates": "ListJobTemplatesRequest",
|
||||
"ListManagedEndpoints": "ListManagedEndpointsRequest",
|
||||
"ListSecurityConfigurations": "ListSecurityConfigurationsRequest",
|
||||
"ListTagsForResource": "ListTagsForResourceRequest",
|
||||
"ListVirtualClusters": "ListVirtualClustersRequest",
|
||||
"StartJobRun": "StartJobRunRequest",
|
||||
"TagResource": "TagResourceRequest",
|
||||
"UntagResource": "UntagResourceRequest",
|
||||
"UpdateVirtualCluster": "UpdateVirtualClusterRequest"
|
||||
},
|
||||
"shapes": {
|
||||
"ACMCertArn": {
|
||||
"type": "string",
|
||||
"min": 44,
|
||||
"max": 2048,
|
||||
"pattern": "^arn:(aws[a-zA-Z0-9-]*):acm:.+:(\\d{12}):certificate/.+$"
|
||||
},
|
||||
"AllowAWSToRetainLogs": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ENABLED",
|
||||
"DISABLED"
|
||||
]
|
||||
},
|
||||
"AuthenticationConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"identityCenterConfiguration": "IdentityCenterConfiguration",
|
||||
"iamConfiguration": "IAMConfiguration"
|
||||
}
|
||||
},
|
||||
"AuthorizationConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"lakeFormationConfiguration": "LakeFormationConfiguration",
|
||||
"encryptionConfiguration": "EncryptionConfiguration"
|
||||
}
|
||||
},
|
||||
"Boolean": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"CancelJobRunRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id",
|
||||
"virtualClusterId"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString",
|
||||
"virtualClusterId": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"CertificateProviderType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"PEM"
|
||||
]
|
||||
},
|
||||
"ClientToken": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 64,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"CloudWatchMonitoringConfiguration": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"logGroupName"
|
||||
],
|
||||
"members": {
|
||||
"logGroupName": "LogGroupName",
|
||||
"logStreamNamePrefix": "String256"
|
||||
}
|
||||
},
|
||||
"ClusterId": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 100,
|
||||
"pattern": "^[0-9A-Za-z][A-Za-z0-9\\-_]*"
|
||||
},
|
||||
"Configuration": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"classification"
|
||||
],
|
||||
"members": {
|
||||
"classification": "String1024",
|
||||
"properties": "SensitivePropertiesMap",
|
||||
"configurations": "ConfigurationList"
|
||||
}
|
||||
},
|
||||
"ConfigurationList": {
|
||||
"type": "list",
|
||||
"max": 100,
|
||||
"member": "Configuration"
|
||||
},
|
||||
"ConfigurationOverrides": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"applicationConfiguration": "ConfigurationList",
|
||||
"monitoringConfiguration": "MonitoringConfiguration"
|
||||
}
|
||||
},
|
||||
"ContainerInfo": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"eksInfo": "EksInfo"
|
||||
}
|
||||
},
|
||||
"ContainerLogRotationConfiguration": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"rotationSize",
|
||||
"maxFilesToKeep"
|
||||
],
|
||||
"members": {
|
||||
"rotationSize": "RotationSize",
|
||||
"maxFilesToKeep": "MaxFilesToKeep"
|
||||
}
|
||||
},
|
||||
"ContainerProvider": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"type",
|
||||
"id"
|
||||
],
|
||||
"members": {
|
||||
"type": "ContainerProviderType",
|
||||
"id": "ClusterId",
|
||||
"info": "ContainerInfo"
|
||||
}
|
||||
},
|
||||
"ContainerProviderType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"EKS"
|
||||
]
|
||||
},
|
||||
"CreateJobTemplateRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"name",
|
||||
"clientToken",
|
||||
"jobTemplateData"
|
||||
],
|
||||
"members": {
|
||||
"name": "ResourceNameString",
|
||||
"clientToken": "ClientToken",
|
||||
"jobTemplateData": "JobTemplateData",
|
||||
"tags": "TagMap",
|
||||
"kmsKeyArn": "KmsKeyArn"
|
||||
}
|
||||
},
|
||||
"CreateManagedEndpointRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"name",
|
||||
"virtualClusterId",
|
||||
"type",
|
||||
"releaseLabel",
|
||||
"executionRoleArn",
|
||||
"clientToken"
|
||||
],
|
||||
"members": {
|
||||
"name": "ResourceNameString",
|
||||
"virtualClusterId": "ResourceIdString",
|
||||
"type": "EndpointType",
|
||||
"releaseLabel": "ReleaseLabel",
|
||||
"executionRoleArn": "IAMRoleArn",
|
||||
"certificateArn": "ACMCertArn",
|
||||
"configurationOverrides": "ConfigurationOverrides",
|
||||
"clientToken": "ClientToken",
|
||||
"tags": "TagMap",
|
||||
"sessionIdleTimeoutInMinutes": "SessionIdleTimeoutInMinutes"
|
||||
}
|
||||
},
|
||||
"CreateSecurityConfigurationRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"clientToken",
|
||||
"name",
|
||||
"securityConfigurationData"
|
||||
],
|
||||
"members": {
|
||||
"clientToken": "ClientToken",
|
||||
"name": "ResourceNameString",
|
||||
"containerProvider": "ContainerProvider",
|
||||
"securityConfigurationData": "SecurityConfigurationData",
|
||||
"tags": "TagMap"
|
||||
}
|
||||
},
|
||||
"CreateVirtualClusterRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"name",
|
||||
"containerProvider",
|
||||
"clientToken"
|
||||
],
|
||||
"members": {
|
||||
"name": "ResourceNameString",
|
||||
"containerProvider": "ContainerProvider",
|
||||
"clientToken": "ClientToken",
|
||||
"tags": "TagMap",
|
||||
"securityConfigurationId": "ResourceIdString",
|
||||
"sessionEnabled": "Boolean",
|
||||
"schedulerConfiguration": "SchedulerConfiguration"
|
||||
}
|
||||
},
|
||||
"CredentialType": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 64,
|
||||
"pattern": "^.*\\S.*$"
|
||||
},
|
||||
"Date": {
|
||||
"type": "timestamp"
|
||||
},
|
||||
"DeleteJobTemplateRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"DeleteManagedEndpointRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id",
|
||||
"virtualClusterId"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString",
|
||||
"virtualClusterId": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"DeleteSecurityConfigurationRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"DeleteVirtualClusterRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"DescribeJobRunRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id",
|
||||
"virtualClusterId"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString",
|
||||
"virtualClusterId": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"DescribeJobTemplateRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"DescribeManagedEndpointRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id",
|
||||
"virtualClusterId"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString",
|
||||
"virtualClusterId": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"DescribeSecurityConfigurationRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"DescribeVirtualClusterRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString"
|
||||
}
|
||||
},
|
||||
"EksInfo": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"namespace": "KubernetesNamespace",
|
||||
"nodeLabel": "NodeLabelString"
|
||||
}
|
||||
},
|
||||
"EmrIdentityCenterApplicationARN": {
|
||||
"type": "string",
|
||||
"pattern": "^arn:(aws[a-zA-Z0-9-]*):sso:::application/ssoins-[0-9a-zA-Z/\\\\-_]+/apl-[0-9a-zA-Z/\\\\-_]+"
|
||||
},
|
||||
"EncryptionConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"inTransitEncryptionConfiguration": "InTransitEncryptionConfiguration"
|
||||
}
|
||||
},
|
||||
"EndpointState": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"CREATING",
|
||||
"ACTIVE",
|
||||
"TERMINATING",
|
||||
"TERMINATED",
|
||||
"TERMINATED_WITH_ERRORS"
|
||||
]
|
||||
},
|
||||
"EndpointStates": {
|
||||
"type": "list",
|
||||
"max": 10,
|
||||
"member": "EndpointState"
|
||||
},
|
||||
"EndpointType": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 64,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"EndpointTypes": {
|
||||
"type": "list",
|
||||
"max": 10,
|
||||
"member": "EndpointType"
|
||||
},
|
||||
"EntryPointArgument": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 10280,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"EntryPointArguments": {
|
||||
"type": "list",
|
||||
"member": "EntryPointArgument"
|
||||
},
|
||||
"EntryPointPath": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 256,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"GetManagedEndpointSessionCredentialsRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"executionRoleArn",
|
||||
"credentialType",
|
||||
"endpointIdentifier",
|
||||
"virtualClusterIdentifier"
|
||||
],
|
||||
"members": {
|
||||
"endpointIdentifier": "String2048",
|
||||
"virtualClusterIdentifier": "String2048",
|
||||
"executionRoleArn": "IAMRoleArn",
|
||||
"credentialType": "CredentialType",
|
||||
"durationInSeconds": "JavaInteger",
|
||||
"logContext": "LogContext",
|
||||
"clientToken": "ClientToken"
|
||||
}
|
||||
},
|
||||
"IAMConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"systemRole": "IAMRoleArn"
|
||||
}
|
||||
},
|
||||
"IAMRoleArn": {
|
||||
"type": "string",
|
||||
"min": 20,
|
||||
"max": 2048,
|
||||
"pattern": "^arn:(aws[a-zA-Z0-9-]*):iam::(\\d{12})?:(role((\\u002F)|(\\u002F[\\u0021-\\u007F]+\\u002F))[\\w+=,.@-]+)$"
|
||||
},
|
||||
"IdentityCenterConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"enableIdentityCenter": "Boolean",
|
||||
"identityCenterApplicationAssignmentRequired": "Boolean",
|
||||
"identityCenterInstanceARN": "IdentityCenterInstanceARN",
|
||||
"emrIdentityCenterApplicationARN": "EmrIdentityCenterApplicationARN"
|
||||
}
|
||||
},
|
||||
"IdentityCenterInstanceARN": {
|
||||
"type": "string",
|
||||
"min": 10,
|
||||
"max": 1224,
|
||||
"pattern": "^arn:(aws[a-zA-Z0-9-]*):sso:::instance/ssoins-[0-9a-zA-Z/\\\\-_]+"
|
||||
},
|
||||
"InQueueJobLimitInteger": {
|
||||
"type": "integer",
|
||||
"min": 100,
|
||||
"max": 10000
|
||||
},
|
||||
"InTransitEncryptionConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"tlsCertificateConfiguration": "TLSCertificateConfiguration"
|
||||
}
|
||||
},
|
||||
"JavaInteger": {
|
||||
"type": "integer"
|
||||
},
|
||||
"JobDriver": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"sparkSubmitJobDriver": "SparkSubmitJobDriver",
|
||||
"sparkSqlJobDriver": "SparkSqlJobDriver"
|
||||
}
|
||||
},
|
||||
"JobLimitInteger": {
|
||||
"type": "integer",
|
||||
"min": 1,
|
||||
"max": 10000
|
||||
},
|
||||
"JobRunState": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"PENDING",
|
||||
"SUBMITTED",
|
||||
"RUNNING",
|
||||
"FAILED",
|
||||
"CANCELLED",
|
||||
"CANCEL_PENDING",
|
||||
"COMPLETED"
|
||||
]
|
||||
},
|
||||
"JobRunStates": {
|
||||
"type": "list",
|
||||
"max": 10,
|
||||
"member": "JobRunState"
|
||||
},
|
||||
"JobTemplateData": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"executionRoleArn",
|
||||
"releaseLabel",
|
||||
"jobDriver"
|
||||
],
|
||||
"members": {
|
||||
"executionRoleArn": "ParametricIAMRoleArn",
|
||||
"releaseLabel": "ParametricReleaseLabel",
|
||||
"configurationOverrides": "ParametricConfigurationOverrides",
|
||||
"jobDriver": "JobDriver",
|
||||
"parameterConfiguration": "TemplateParameterConfigurationMap",
|
||||
"jobTags": "TagMap"
|
||||
}
|
||||
},
|
||||
"KmsKeyArn": {
|
||||
"type": "string",
|
||||
"min": 3,
|
||||
"max": 2048,
|
||||
"pattern": "^(arn:(aws[a-zA-Z0-9-]*):kms:.+:(\\d{12})?:key\\/[(0-9a-zA-Z)-?]+|\\$\\{[a-zA-Z]\\w*\\})$"
|
||||
},
|
||||
"KubernetesNamespace": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 63,
|
||||
"pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?"
|
||||
},
|
||||
"LakeFormationConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"authorizedSessionTagValue": "SessionTagValue",
|
||||
"secureNamespaceInfo": "SecureNamespaceInfo",
|
||||
"queryEngineRoleArn": "IAMRoleArn"
|
||||
}
|
||||
},
|
||||
"ListJobRunsRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"virtualClusterId"
|
||||
],
|
||||
"members": {
|
||||
"virtualClusterId": "ResourceIdString",
|
||||
"createdBefore": "Date",
|
||||
"createdAfter": "Date",
|
||||
"name": "ResourceNameString",
|
||||
"states": "JobRunStates",
|
||||
"maxResults": "JavaInteger",
|
||||
"nextToken": "NextToken"
|
||||
}
|
||||
},
|
||||
"ListJobTemplatesRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"createdAfter": "Date",
|
||||
"createdBefore": "Date",
|
||||
"maxResults": "JavaInteger",
|
||||
"nextToken": "NextToken"
|
||||
}
|
||||
},
|
||||
"ListManagedEndpointsRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"virtualClusterId"
|
||||
],
|
||||
"members": {
|
||||
"virtualClusterId": "ResourceIdString",
|
||||
"createdBefore": "Date",
|
||||
"createdAfter": "Date",
|
||||
"types": "EndpointTypes",
|
||||
"states": "EndpointStates",
|
||||
"maxResults": "JavaInteger",
|
||||
"nextToken": "NextToken"
|
||||
}
|
||||
},
|
||||
"ListSecurityConfigurationsRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"createdAfter": "Date",
|
||||
"createdBefore": "Date",
|
||||
"maxResults": "JavaInteger",
|
||||
"nextToken": "NextToken"
|
||||
}
|
||||
},
|
||||
"ListTagsForResourceRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"resourceArn"
|
||||
],
|
||||
"members": {
|
||||
"resourceArn": "RsiArn"
|
||||
}
|
||||
},
|
||||
"ListVirtualClustersRequest": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"containerProviderId": "String1024",
|
||||
"containerProviderType": "ContainerProviderType",
|
||||
"createdAfter": "Date",
|
||||
"createdBefore": "Date",
|
||||
"states": "VirtualClusterStates",
|
||||
"maxResults": "JavaInteger",
|
||||
"nextToken": "NextToken",
|
||||
"eksAccessEntryIntegrated": "Boolean"
|
||||
}
|
||||
},
|
||||
"LogContext": {
|
||||
"type": "string",
|
||||
"min": 3,
|
||||
"max": 63,
|
||||
"pattern": "^((?!.*-s3alias)(?!xn--.*)[a-z0-9][-a-z0-9.]*)?[a-z0-9]$"
|
||||
},
|
||||
"LogGroupName": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 512,
|
||||
"pattern": "[\\.\\-_/#A-Za-z0-9]+"
|
||||
},
|
||||
"ManagedLogs": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"allowAWSToRetainLogs": "AllowAWSToRetainLogs",
|
||||
"encryptionKeyArn": "KmsKeyArn"
|
||||
}
|
||||
},
|
||||
"MaxFilesToKeep": {
|
||||
"type": "integer",
|
||||
"min": 1,
|
||||
"max": 50
|
||||
},
|
||||
"MonitoringConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"managedLogs": "ManagedLogs",
|
||||
"persistentAppUI": "PersistentAppUI",
|
||||
"cloudWatchMonitoringConfiguration": "CloudWatchMonitoringConfiguration",
|
||||
"s3MonitoringConfiguration": "S3MonitoringConfiguration",
|
||||
"containerLogRotationConfiguration": "ContainerLogRotationConfiguration"
|
||||
}
|
||||
},
|
||||
"NextToken": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 1024,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"NodeLabelString": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 64,
|
||||
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"
|
||||
},
|
||||
"ParametricCloudWatchMonitoringConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"logGroupName": "TemplateParameter",
|
||||
"logStreamNamePrefix": "String256"
|
||||
}
|
||||
},
|
||||
"ParametricConfigurationOverrides": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"applicationConfiguration": "ConfigurationList",
|
||||
"monitoringConfiguration": "ParametricMonitoringConfiguration"
|
||||
}
|
||||
},
|
||||
"ParametricIAMRoleArn": {
|
||||
"type": "string",
|
||||
"min": 4,
|
||||
"max": 2048,
|
||||
"pattern": "(^arn:(aws[a-zA-Z0-9-]*):iam::(\\d{12})?:(role((\\u002F)|(\\u002F[\\u0021-\\u007F]+\\u002F))[\\w+=,.@-]+)$)|([\\.\\-_\\#A-Za-z0-9\\$\\{\\}]+)"
|
||||
},
|
||||
"ParametricMonitoringConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"persistentAppUI": "TemplateParameter",
|
||||
"cloudWatchMonitoringConfiguration": "ParametricCloudWatchMonitoringConfiguration",
|
||||
"s3MonitoringConfiguration": "ParametricS3MonitoringConfiguration"
|
||||
}
|
||||
},
|
||||
"ParametricReleaseLabel": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 64,
|
||||
"pattern": "([\\.\\-_/A-Za-z0-9]+|\\$\\{[a-zA-Z]\\w*\\})"
|
||||
},
|
||||
"ParametricS3MonitoringConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"logUri": "UriString"
|
||||
}
|
||||
},
|
||||
"PersistentAppUI": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ENABLED",
|
||||
"DISABLED"
|
||||
]
|
||||
},
|
||||
"ReleaseLabel": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 64,
|
||||
"pattern": "[\\.\\-_/A-Za-z0-9]+"
|
||||
},
|
||||
"ResourceIdString": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 64,
|
||||
"pattern": "[0-9a-z]+"
|
||||
},
|
||||
"ResourceNameString": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 64,
|
||||
"pattern": "[\\.\\-_/#A-Za-z0-9]+"
|
||||
},
|
||||
"RetryPolicyConfiguration": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"maxAttempts"
|
||||
],
|
||||
"members": {
|
||||
"maxAttempts": "JavaInteger"
|
||||
}
|
||||
},
|
||||
"RotationSize": {
|
||||
"type": "string",
|
||||
"min": 3,
|
||||
"max": 12,
|
||||
"pattern": "^\\d+(\\.\\d+)?[KMG][Bb]?$"
|
||||
},
|
||||
"RsiArn": {
|
||||
"type": "string",
|
||||
"min": 60,
|
||||
"max": 500,
|
||||
"pattern": "^arn:(aws[a-zA-Z0-9-]*):emr-containers:.+:(\\d{12}):/virtualclusters/.+$"
|
||||
},
|
||||
"S3MonitoringConfiguration": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"logUri"
|
||||
],
|
||||
"members": {
|
||||
"logUri": "UriString",
|
||||
"encryptionKeyArn": "KmsKeyArn"
|
||||
}
|
||||
},
|
||||
"SchedulerConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"maxInQueueJobRuns": "InQueueJobLimitInteger",
|
||||
"maxConcurrentJobRuns": "JobLimitInteger"
|
||||
}
|
||||
},
|
||||
"SecretsManagerArn": {
|
||||
"type": "string",
|
||||
"min": 3,
|
||||
"max": 2048,
|
||||
"pattern": "^arn:(aws[a-zA-Z0-9-]*):secretsmanager:.+:(\\d{12}):secret:[0-9a-zA-Z/_+=.@-]+$"
|
||||
},
|
||||
"SecureNamespaceInfo": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"clusterId": "ClusterId",
|
||||
"namespace": "KubernetesNamespace"
|
||||
}
|
||||
},
|
||||
"SecurityConfigurationData": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"authorizationConfiguration": "AuthorizationConfiguration",
|
||||
"authenticationConfiguration": "AuthenticationConfiguration"
|
||||
}
|
||||
},
|
||||
"SensitivePropertiesMap": {
|
||||
"type": "map",
|
||||
"max": 100,
|
||||
"key": "String1024",
|
||||
"value": "String1024"
|
||||
},
|
||||
"SessionIdleTimeoutInMinutes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"SessionTagValue": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 512,
|
||||
"pattern": "[\\.\\-_/#A-Za-z0-9 ]+"
|
||||
},
|
||||
"SparkSqlJobDriver": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"entryPoint": "EntryPointPath",
|
||||
"sparkSqlParameters": "SparkSqlParameters"
|
||||
}
|
||||
},
|
||||
"SparkSqlParameters": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 102400,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"SparkSubmitJobDriver": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"entryPoint"
|
||||
],
|
||||
"members": {
|
||||
"entryPoint": "EntryPointPath",
|
||||
"entryPointArguments": "EntryPointArguments",
|
||||
"sparkSubmitParameters": "SparkSubmitParameters"
|
||||
}
|
||||
},
|
||||
"SparkSubmitParameters": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 102400,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"StartJobRunRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"virtualClusterId",
|
||||
"clientToken"
|
||||
],
|
||||
"members": {
|
||||
"name": "ResourceNameString",
|
||||
"virtualClusterId": "ResourceIdString",
|
||||
"clientToken": "ClientToken",
|
||||
"executionRoleArn": "IAMRoleArn",
|
||||
"releaseLabel": "ReleaseLabel",
|
||||
"jobDriver": "JobDriver",
|
||||
"configurationOverrides": "ConfigurationOverrides",
|
||||
"tags": "TagMap",
|
||||
"jobTemplateId": "ResourceIdString",
|
||||
"jobTemplateParameters": "TemplateParameterInputMap",
|
||||
"retryPolicyConfiguration": "RetryPolicyConfiguration"
|
||||
}
|
||||
},
|
||||
"String1024": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 1024,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"String128": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 128,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"String2048": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 2048,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"String256": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 256,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"StringEmpty256": {
|
||||
"type": "string",
|
||||
"min": 0,
|
||||
"max": 256,
|
||||
"pattern": ".*\\S.*"
|
||||
},
|
||||
"TLSCertificateConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"certificateProviderType": "CertificateProviderType",
|
||||
"publicCertificateSecretArn": "SecretsManagerArn",
|
||||
"privateCertificateSecretArn": "SecretsManagerArn"
|
||||
}
|
||||
},
|
||||
"TagKeyList": {
|
||||
"type": "list",
|
||||
"min": 0,
|
||||
"max": 50,
|
||||
"member": "String128"
|
||||
},
|
||||
"TagMap": {
|
||||
"type": "map",
|
||||
"min": 0,
|
||||
"max": 50,
|
||||
"key": "String128",
|
||||
"value": "StringEmpty256"
|
||||
},
|
||||
"TagResourceRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"resourceArn",
|
||||
"tags"
|
||||
],
|
||||
"members": {
|
||||
"resourceArn": "RsiArn",
|
||||
"tags": "TagMap"
|
||||
}
|
||||
},
|
||||
"TemplateParameter": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 512,
|
||||
"pattern": "[\\.\\-_/#A-Za-z0-9\\$\\{\\}]+"
|
||||
},
|
||||
"TemplateParameterConfiguration": {
|
||||
"type": "structure",
|
||||
"members": {
|
||||
"type": "TemplateParameterDataType",
|
||||
"defaultValue": "String1024"
|
||||
}
|
||||
},
|
||||
"TemplateParameterConfigurationMap": {
|
||||
"type": "map",
|
||||
"max": 100,
|
||||
"key": "TemplateParameterName",
|
||||
"value": "TemplateParameterConfiguration"
|
||||
},
|
||||
"TemplateParameterDataType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"NUMBER",
|
||||
"STRING"
|
||||
]
|
||||
},
|
||||
"TemplateParameterInputMap": {
|
||||
"type": "map",
|
||||
"max": 100,
|
||||
"key": "TemplateParameterName",
|
||||
"value": "String1024"
|
||||
},
|
||||
"TemplateParameterName": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 512,
|
||||
"pattern": "[\\.\\-_\\#A-Za-z0-9]+"
|
||||
},
|
||||
"UntagResourceRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"resourceArn",
|
||||
"tagKeys"
|
||||
],
|
||||
"members": {
|
||||
"resourceArn": "RsiArn",
|
||||
"tagKeys": "TagKeyList"
|
||||
}
|
||||
},
|
||||
"UpdateVirtualClusterRequest": {
|
||||
"type": "structure",
|
||||
"required": [
|
||||
"id",
|
||||
"clientToken"
|
||||
],
|
||||
"members": {
|
||||
"id": "ResourceIdString",
|
||||
"schedulerConfiguration": "SchedulerConfiguration",
|
||||
"clientToken": "ClientToken"
|
||||
}
|
||||
},
|
||||
"UriString": {
|
||||
"type": "string",
|
||||
"min": 1,
|
||||
"max": 10280,
|
||||
"pattern": "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDBFF-\\uDC00\\uDFFF\\r\\n\\t]*"
|
||||
},
|
||||
"VirtualClusterState": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"RUNNING",
|
||||
"TERMINATING",
|
||||
"TERMINATED",
|
||||
"ARRESTED"
|
||||
]
|
||||
},
|
||||
"VirtualClusterStates": {
|
||||
"type": "list",
|
||||
"max": 10,
|
||||
"member": "VirtualClusterState"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"_source": {
|
||||
"generator": "tools/aws/regen_iam_authorized_actions.py",
|
||||
"reference": "https://servicereference.us-east-1.amazonaws.com/",
|
||||
"retrieved": "2026-11-15",
|
||||
"retrieved": "2026-11-16",
|
||||
"note": "make iam-authorized-actions-verify checks every entry against AWS."
|
||||
},
|
||||
"authorizedActions": {
|
||||
@@ -502,6 +502,15 @@
|
||||
"ListEksAnywhereSubscriptions",
|
||||
"RegisterCluster"
|
||||
],
|
||||
"emr-containers": [
|
||||
"CreateCertificate",
|
||||
"CreateJobTemplate",
|
||||
"CreateSecurityConfiguration",
|
||||
"CreateVirtualCluster",
|
||||
"ListJobTemplates",
|
||||
"ListSecurityConfigurations",
|
||||
"ListVirtualClusters"
|
||||
],
|
||||
"emr-serverless": [
|
||||
"CreateApplication",
|
||||
"ListApplications"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_source": {"generator": "tools/aws/regen_iam_passed_roles.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-13", "note": "make iam-passed-roles-check re-derives every member from botocore; make iam-passed-roles-verify checks every operation against AWS."},
|
||||
"namespaces": {"application-autoscaling": ["application-autoscaling"], "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"], "elasticmapreduce": ["emr"], "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"]},
|
||||
"_source": {"generator": "tools/aws/regen_iam_passed_roles.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-16", "note": "make iam-passed-roles-check re-derives every member from botocore; make iam-passed-roles-verify checks every operation against AWS."},
|
||||
"namespaces": {"application-autoscaling": ["application-autoscaling"], "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"], "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"]},
|
||||
"notCovered": {"access-analyzer": "REST routes no rule maps yet", "airflow": "REST routes no rule maps yet", "apigateway": "authorized by HTTP method, so no request is checked as one of these operations", "appconfig": "REST routes no rule maps yet", "appsync": "REST routes no rule maps yet", "aps": "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", "elasticfilesystem": "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", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "elemental-inference", "emr-containers", "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"],
|
||||
"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", "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": {
|
||||
"application-autoscaling:RegisterScalableTarget": {"passedTo": ["application-autoscaling"], "byHand": "the scalable target's role"},
|
||||
"athena:CreateWorkGroup": {"passedTo": ["athena"], "roles": [
|
||||
@@ -417,6 +417,12 @@
|
||||
{"member": "ExecutionRoleArn", "passedTo": "managed-compute.elasticmapreduce"}
|
||||
]},
|
||||
"elasticmapreduce:UpdateStudio": {"passedTo": [], "notRead": "no member of the request names a role"},
|
||||
"emr-containers:CreateManagedEndpoint": {"passedTo": ["pods.eks"], "roles": [
|
||||
{"member": "executionRoleArn", "passedTo": "pods.eks"}
|
||||
]},
|
||||
"emr-containers:StartJobRun": {"passedTo": ["pods.eks"], "roles": [
|
||||
{"member": "executionRoleArn", "passedTo": "pods.eks"}
|
||||
]},
|
||||
"emr-serverless:StartJobRun": {"passedTo": ["emr-serverless"], "roles": [
|
||||
{"member": "executionRoleArn", "passedTo": "emr-serverless"}
|
||||
]},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-15", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "inspector2": ["inspector2"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "ram": ["ram"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "route53": ["route53"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
|
||||
"_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-16", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "elasticloadbalancing": ["elb", "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"], "inspector2": ["inspector2"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "ram": ["ram"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "route53": ["route53"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
|
||||
"handBuilt": ["apigateway", "bedrock", "dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "logs", "pipes", "resource-groups", "s3", "sns", "sqs", "sts"],
|
||||
"notCovered": {"airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "aps": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<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", "cloudwatch": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "comprehend": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "config": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dlm": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2-instance-connect": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticache": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment/<application>/<name>`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST rLine truncated
|
||||
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "appfabric", "appflow", "application-signals", "application-signals-mcp", "appmesh", "appmesh-preview", "apprunner", "appstream", "apptest", "arc-region-switch", "arc-zonal-shift", "artifact", "assurance", "auditmanager", "aws-external-anthropic", "b2bi", "backup-gateway", "backup-search", "bedrock-mantle", "bedrock-websearch", "billing", "billingconductor", "braket", "bugbust", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "clouddirectory", "cloudsearch", "cloudshell", "cloudtrail-data", "codecatalyst", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "codewhisperer", "cognito-sync", "connect-campaigns", "consoleapp", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "devops-guru", "directconnect", "docdb-elastic", "drs", "ds", "ds-data", "ebs", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "emr-containers", "end-user-messaging", "entityresolution", "evs", "finspace", "finspace-api", "fms", "forecast", "frauddetector", "freertos", "fsx", "gamelift", "gameliftstreams", "geo", "geo-maps", "geo-places", "geo-routes", "glacier", "grafana", "greengrass", "groundstation", "health", "health-agent", "healthlake", "honeycode", "identity-sync", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotanalytics", "iotdeviceadvisor", "iotfleethub", "iotfleetwise", "iotjobsdata", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "iq", "iq-permission", "ivs", "ivschat", "kafka-cluster", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "lookoutmetrics", "lookoutvision", "m2", "machinelearning", "managedblockchain", "mapcredits", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgh", "mgn", "migrationhub-orchestrator", "mobiletargeting", "monitron", "mpa", "neptune-db", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "nimble", "notifications", "notifications-contacts", "nova-act", "observabilityadmin", "odb", "omics", "one", "opensearch", "opsworks", "osis", "outposts", "panorama", "partnercentral", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "rbin", "rds-db", "refactor-spaces", "repostspace", "resiliencehub", "robomaker", "rolesanywhere", "route53-recovery-cluster", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3-object-lambda", "s3-outposts", "s3express", "s3files", "sagemaker-geospatial", "sagemaker-mlflow", "savingsplans", "schemas", "scn", "sdb", "security-ir", "securityagent", "securitylake", "serverlessrepo", "shield", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "ssmmessages", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "tnb", "transform", "transform-custom", "trustedadvisor", "ts", "vendor-insights", "voiceid", "vpc-lattice", "vpc-lattice-svcs", "vpce", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workdocs", "worklink", "workmail", "workmailmessageflow", "workspaces", "workspaces-instances", "workspaces-web"],
|
||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudformation": {"changeset": "arn:${Partition}:cloudformation:${Region}:${Account}:changeSet/${ChangeSetName}/${Id}", "generatedtemplate": "arn:${Partition}:cloudformation:${Region}:${Account}:generatedTemplate/${Id}", "resourcescan": "arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}", "stack": "arn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id}", "stackset": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset/${StackSetName}:${Id}", "stackset-target": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset-target/${StackSetTarget}", "type": "arn:${Partition}:cloudformation:${Region}:${Account}:type/resource/${Type}", "typeHook": "arn:${Partition}:cloudformation:${Region}:${Account}:type/hook/${Type}"}, "cloudfront": {"anycast-ip-list": "arn:${Partition}:cloudfront::${Account}:anycast-ip-list/${Id}", "cache-policy": "arn:${Partition}:cloudfront::${Account}:cache-policy/${Id}", "connection-function": "arn:${Partition}:cloudfront::${Account}:connection-function/${Id}", "connection-group": "arn:${Partition}:cloudfront::${Account}:connection-group/${Id}", "continuous-deployment-policy": "arn:${Partition}:cloudfront::${Account}:continuous-deployment-policy/${Id}", "distribution": "arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}", "distribution-tenant": "arn:${Partition}:cloudfront::${Account}:distribution-tenant/${Id}", "field-level-encryption-config": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-config/${Id}", "field-level-encryption-profile": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-profile/${Id}", "function": "arn:${Partition}:cloudfront::${Account}:function/${Name}", "key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${Name}", "origin-access-control": "arn:${Partition}:cloudfront::${Account}:origin-access-control/${Id}", "origin-access-identity": "arn:${Partition}:cloudfront::${Account}:origin-access-identity/${Id}", "origin-request-policy": "arn:${Partition}:cloudfront::${Account}:origin-request-policy/${Id}", "realtime-log-config": "arn:${Partition}:cloudfront::${Account}:realtime-log-config/${Name}", "response-headers-policy": "arn:$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/"]}, "application-autoscaling": {"ScalableTarget": ["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-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "budgets": {"budget": ["aws:ResourceTag/"], "budgetAction": ["aws:ResourceTag/"]}, "ce": {"anomalymonitor": ["aws:ResourceTag/"], "anomalysubscription": ["aws:ResourceTag/"], "billingview": ["aws:ResourceTag/"], "costcategory": ["aws:ResourceTag/"]}, "cloudformation": {"changeset": ["aws:ResourceTag/"], "stack": ["aws:ResourceTag/"], "stackset": ["aws:ResourceTag/"]}, "cloudfront": {"anycast-ip-list": ["aws:ResourceTag/"], "connection-function": ["aws:ResourceTag/"], "connection-group": ["aws:ResourceTag/"], "distribution": ["aws:ResourceTag/"], "distribution-tenant": ["aws:ResourceTag/"], "function": ["aws:ResourceTag/"], "key-value-store": ["aws:ResourceTag/"], "streaming-distribution": ["aws:ResourceTag/"], "trust-store": ["aws:ResourceTag/"], "vpcorigin": ["aws:ResourceTag/"]}, "cloudtrail": {"channel": ["aws:ResourceTag/"], "dashboard": ["aws:ResourceTag/"], "eventdatastore": ["aws:ResourceTag/"], "trail": ["aws:ResourceTag/"]}, "codebuild": {"project": ["aws:ResourceTag/"], "report-group": ["aws:ResourceTag/"]}, "codepipeline": {"action": ["aws:ResourceTag/"], "actiontype": ["aws:ResourceTag/"], "pipeline": ["aws:ResourceTag/"], "stage": ["aws:ResourceTag/"], "webhook": ["aws:ResourceTag/"]}, "cognito-identity": {"identitypool": ["aws:ResourceTag/"]}, "cognito-idp": {"userpool": ["aws:ResourceTag/"]}, "controltower": {"EnabledBaseline": ["aws:ResourceTag/"], "EnabledControl": ["aws:ResourceTag/"], "LandingZone": ["aws:ResourceTag/"]}, "datasync": {"agent": ["aws:ResourceTag/"], "discoveryjob": ["aws:ResourceTag/"], "location": ["aws:ResourceTag/"], "storagesystem": ["aws:ResourceTag/"], "task": ["aws:ResourceTag/"], "taskexecution": ["aws:ResourceTag/"]}, "dynamodb": {"index": ["aws:ResourceTag/"], "stream": ["aws:ResourceTag/"], "table": ["aws:ResourceTag/"]}, "ec2": {"application-status-check": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-block": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-manager-data-export": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-cancellation-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-modification-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "carrier-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "client-vpn-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "coip-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "customer-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "declarative-policies-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dedicated-host": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dhcp-options": ["aws:ResourceTag/", "ec2:ResourceTag/"], "egress-only-internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-gpu": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-ip": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-instance-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fpga-image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "host-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image-usage-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-snapshot-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-connect-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-event-window": ["aws:ResourceTag/", "ec2:ResourceTag/"], "internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-external-resource-verification-token": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-internet-registry-association": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-policy": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool-allocation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-resolver": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-resolver-target": ["aws:ResourceTag/", "ec2:Line truncated
|
||||
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "appfabric", "appflow", "application-signals", "application-signals-mcp", "appmesh", "appmesh-preview", "apprunner", "appstream", "apptest", "arc-region-switch", "arc-zonal-shift", "artifact", "assurance", "auditmanager", "aws-external-anthropic", "b2bi", "backup-gateway", "backup-search", "bedrock-mantle", "bedrock-websearch", "billing", "billingconductor", "braket", "bugbust", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "clouddirectory", "cloudsearch", "cloudshell", "cloudtrail-data", "codecatalyst", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "codewhisperer", "cognito-sync", "connect-campaigns", "consoleapp", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "devops-guru", "directconnect", "docdb-elastic", "drs", "ds", "ds-data", "ebs", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "end-user-messaging", "entityresolution", "evs", "finspace", "finspace-api", "fms", "forecast", "frauddetector", "freertos", "fsx", "gamelift", "gameliftstreams", "geo", "geo-maps", "geo-places", "geo-routes", "glacier", "grafana", "greengrass", "groundstation", "health", "health-agent", "healthlake", "honeycode", "identity-sync", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotanalytics", "iotdeviceadvisor", "iotfleethub", "iotfleetwise", "iotjobsdata", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "iq", "iq-permission", "ivs", "ivschat", "kafka-cluster", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "lookoutmetrics", "lookoutvision", "m2", "machinelearning", "managedblockchain", "mapcredits", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgh", "mgn", "migrationhub-orchestrator", "mobiletargeting", "monitron", "mpa", "neptune-db", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "nimble", "notifications", "notifications-contacts", "nova-act", "observabilityadmin", "odb", "omics", "one", "opensearch", "opsworks", "osis", "outposts", "panorama", "partnercentral", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "rbin", "rds-db", "refactor-spaces", "repostspace", "resiliencehub", "robomaker", "rolesanywhere", "route53-recovery-cluster", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3-object-lambda", "s3-outposts", "s3express", "s3files", "sagemaker-geospatial", "sagemaker-mlflow", "savingsplans", "schemas", "scn", "sdb", "security-ir", "securityagent", "securitylake", "serverlessrepo", "shield", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "ssmmessages", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "tnb", "transform", "transform-custom", "trustedadvisor", "ts", "vendor-insights", "voiceid", "vpc-lattice", "vpc-lattice-svcs", "vpce", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workdocs", "worklink", "workmail", "workmailmessageflow", "workspaces", "workspaces-instances", "workspaces-web"],
|
||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudformation": {"changeset": "arn:${Partition}:cloudformation:${Region}:${Account}:changeSet/${ChangeSetName}/${Id}", "generatedtemplate": "arn:${Partition}:cloudformation:${Region}:${Account}:generatedTemplate/${Id}", "resourcescan": "arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}", "stack": "arn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id}", "stackset": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset/${StackSetName}:${Id}", "stackset-target": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset-target/${StackSetTarget}", "type": "arn:${Partition}:cloudformation:${Region}:${Account}:type/resource/${Type}", "typeHook": "arn:${Partition}:cloudformation:${Region}:${Account}:type/hook/${Type}"}, "cloudfront": {"anycast-ip-list": "arn:${Partition}:cloudfront::${Account}:anycast-ip-list/${Id}", "cache-policy": "arn:${Partition}:cloudfront::${Account}:cache-policy/${Id}", "connection-function": "arn:${Partition}:cloudfront::${Account}:connection-function/${Id}", "connection-group": "arn:${Partition}:cloudfront::${Account}:connection-group/${Id}", "continuous-deployment-policy": "arn:${Partition}:cloudfront::${Account}:continuous-deployment-policy/${Id}", "distribution": "arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}", "distribution-tenant": "arn:${Partition}:cloudfront::${Account}:distribution-tenant/${Id}", "field-level-encryption-config": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-config/${Id}", "field-level-encryption-profile": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-profile/${Id}", "function": "arn:${Partition}:cloudfront::${Account}:function/${Name}", "key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${Name}", "origin-access-control": "arn:${Partition}:cloudfront::${Account}:origin-access-control/${Id}", "origin-access-identity": "arn:${Partition}:cloudfront::${Account}:origin-access-identity/${Id}", "origin-request-policy": "arn:${Partition}:cloudfront::${Account}:origin-request-policy/${Id}", "realtime-log-config": "arn:${Partition}:cloudfront::${Account}:realtime-log-config/${Name}", "response-headers-policy": "arn:$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/"]}, "application-autoscaling": {"ScalableTarget": ["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-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "budgets": {"budget": ["aws:ResourceTag/"], "budgetAction": ["aws:ResourceTag/"]}, "ce": {"anomalymonitor": ["aws:ResourceTag/"], "anomalysubscription": ["aws:ResourceTag/"], "billingview": ["aws:ResourceTag/"], "costcategory": ["aws:ResourceTag/"]}, "cloudformation": {"changeset": ["aws:ResourceTag/"], "stack": ["aws:ResourceTag/"], "stackset": ["aws:ResourceTag/"]}, "cloudfront": {"anycast-ip-list": ["aws:ResourceTag/"], "connection-function": ["aws:ResourceTag/"], "connection-group": ["aws:ResourceTag/"], "distribution": ["aws:ResourceTag/"], "distribution-tenant": ["aws:ResourceTag/"], "function": ["aws:ResourceTag/"], "key-value-store": ["aws:ResourceTag/"], "streaming-distribution": ["aws:ResourceTag/"], "trust-store": ["aws:ResourceTag/"], "vpcorigin": ["aws:ResourceTag/"]}, "cloudtrail": {"channel": ["aws:ResourceTag/"], "dashboard": ["aws:ResourceTag/"], "eventdatastore": ["aws:ResourceTag/"], "trail": ["aws:ResourceTag/"]}, "codebuild": {"project": ["aws:ResourceTag/"], "report-group": ["aws:ResourceTag/"]}, "codepipeline": {"action": ["aws:ResourceTag/"], "actiontype": ["aws:ResourceTag/"], "pipeline": ["aws:ResourceTag/"], "stage": ["aws:ResourceTag/"], "webhook": ["aws:ResourceTag/"]}, "cognito-identity": {"identitypool": ["aws:ResourceTag/"]}, "cognito-idp": {"userpool": ["aws:ResourceTag/"]}, "controltower": {"EnabledBaseline": ["aws:ResourceTag/"], "EnabledControl": ["aws:ResourceTag/"], "LandingZone": ["aws:ResourceTag/"]}, "datasync": {"agent": ["aws:ResourceTag/"], "discoveryjob": ["aws:ResourceTag/"], "location": ["aws:ResourceTag/"], "storagesystem": ["aws:ResourceTag/"], "task": ["aws:ResourceTag/"], "taskexecution": ["aws:ResourceTag/"]}, "dynamodb": {"index": ["aws:ResourceTag/"], "stream": ["aws:ResourceTag/"], "table": ["aws:ResourceTag/"]}, "ec2": {"application-status-check": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-block": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-manager-data-export": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-cancellation-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-modification-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "carrier-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "client-vpn-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "coip-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "customer-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "declarative-policies-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dedicated-host": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dhcp-options": ["aws:ResourceTag/", "ec2:ResourceTag/"], "egress-only-internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-gpu": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-ip": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-instance-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fpga-image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "host-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image-usage-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-snapshot-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-connect-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-event-window": ["aws:ResourceTag/", "ec2:ResourceTag/"], "internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-external-resource-verification-token": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-internet-registry-association": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-policy": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool-allocation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-resolver": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-resolver-target": ["aws:ResourceTag/", "ec2:Line 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"]},
|
||||
@@ -2124,6 +2124,31 @@
|
||||
"elasticmapreduce:TerminateSession": {"action": "elasticmapreduce:TerminateSession", "types": ["session"], "resources": [{"type": "session", "fill": {"ClusterId": "ClusterId", "SessionId": "SessionId"}}]},
|
||||
"elasticmapreduce:UpdateStudio": {"action": "elasticmapreduce:UpdateStudio", "types": ["studio"], "resources": [{"types": ["studio"], "arn": "EncryptionKeyArn"}, {"type": "studio", "fill": {"StudioId": "StudioId"}}]},
|
||||
"elasticmapreduce:UpdateStudioSessionMapping": {"action": "elasticmapreduce:UpdateStudioSessionMapping", "types": ["studio"], "resources": [{"types": ["studio"], "arn": "SessionPolicyArn"}, {"type": "studio", "fill": {"StudioId": "StudioId"}}]},
|
||||
"emr-containers:CancelJobRun": {"action": "emr-containers:CancelJobRun", "types": ["jobRun"], "resources": [{"type": "jobRun", "fill": {"JobRunId": "id", "VirtualClusterId": "virtualClusterId"}}], "located": {"id": "{jobRunId}", "virtualClusterId": "{virtualClusterId}"}},
|
||||
"emr-containers:CreateJobTemplate": {"action": "emr-containers:CreateJobTemplate", "types": [], "resources": [], "makes": [{"type": "jobTemplate", "fill": {}}]},
|
||||
"emr-containers:CreateManagedEndpoint": {"action": "emr-containers:CreateManagedEndpoint", "types": ["virtualCluster"], "resources": [{"type": "virtualCluster", "fill": {"VirtualClusterId": "virtualClusterId"}}], "located": {"virtualClusterId": "{virtualClusterId}"}},
|
||||
"emr-containers:CreateSecurityConfiguration": {"action": "emr-containers:CreateSecurityConfiguration", "types": [], "resources": [], "makes": [{"type": "securityConfiguration", "fill": {}}]},
|
||||
"emr-containers:CreateVirtualCluster": {"action": "emr-containers:CreateVirtualCluster", "types": [], "resources": [], "makes": [{"type": "virtualCluster", "fill": {}}]},
|
||||
"emr-containers:DeleteJobTemplate": {"action": "emr-containers:DeleteJobTemplate", "types": ["jobTemplate"], "resources": [{"type": "jobTemplate", "fill": {"JobTemplateId": "id"}}], "located": {"id": "{templateId}"}},
|
||||
"emr-containers:DeleteManagedEndpoint": {"action": "emr-containers:DeleteManagedEndpoint", "types": ["managedEndpoint"], "resources": [{"type": "managedEndpoint", "fill": {"EndpointId": "id", "VirtualClusterId": "virtualClusterId"}}], "located": {"id": "{endpointId}", "virtualClusterId": "{virtualClusterId}"}},
|
||||
"emr-containers:DeleteSecurityConfiguration": {"action": "emr-containers:DeleteSecurityConfiguration", "types": ["securityConfiguration"], "resources": [{"type": "securityConfiguration", "fill": {"SecurityConfigurationId": "id"}}], "located": {"id": "{securityConfigurationId}"}},
|
||||
"emr-containers:DeleteVirtualCluster": {"action": "emr-containers:DeleteVirtualCluster", "types": ["virtualCluster"], "resources": [{"type": "virtualCluster", "fill": {"VirtualClusterId": "id"}}], "located": {"id": "{virtualClusterId}"}},
|
||||
"emr-containers:DescribeJobRun": {"action": "emr-containers:DescribeJobRun", "types": ["jobRun"], "resources": [{"type": "jobRun", "fill": {"JobRunId": "id", "VirtualClusterId": "virtualClusterId"}}], "located": {"id": "{jobRunId}", "virtualClusterId": "{virtualClusterId}"}},
|
||||
"emr-containers:DescribeJobTemplate": {"action": "emr-containers:DescribeJobTemplate", "types": ["jobTemplate"], "resources": [{"type": "jobTemplate", "fill": {"JobTemplateId": "id"}}], "located": {"id": "{templateId}"}},
|
||||
"emr-containers:DescribeManagedEndpoint": {"action": "emr-containers:DescribeManagedEndpoint", "types": ["managedEndpoint"], "resources": [{"type": "managedEndpoint", "fill": {"EndpointId": "id", "VirtualClusterId": "virtualClusterId"}}], "located": {"id": "{endpointId}", "virtualClusterId": "{virtualClusterId}"}},
|
||||
"emr-containers:DescribeSecurityConfiguration": {"action": "emr-containers:DescribeSecurityConfiguration", "types": ["securityConfiguration"], "resources": [{"type": "securityConfiguration", "fill": {"SecurityConfigurationId": "id"}}], "located": {"id": "{securityConfigurationId}"}},
|
||||
"emr-containers:DescribeVirtualCluster": {"action": "emr-containers:DescribeVirtualCluster", "types": ["virtualCluster"], "resources": [{"type": "virtualCluster", "fill": {"VirtualClusterId": "id"}}], "located": {"id": "{virtualClusterId}"}},
|
||||
"emr-containers:GetManagedEndpointSessionCredentials": {"action": "emr-containers:GetManagedEndpointSessionCredentials", "types": ["managedEndpoint"], "resources": [{"types": ["managedEndpoint"], "arn": "endpointIdentifier"}, {"type": "managedEndpoint", "fill": {"EndpointId": "endpointIdentifier", "VirtualClusterId": "virtualClusterIdentifier"}}], "located": {"endpointIdentifier": "{endpointId}", "virtualClusterIdentifier": "{virtualClusterId}"}},
|
||||
"emr-containers:ListJobRuns": {"action": "emr-containers:ListJobRuns", "types": ["virtualCluster"], "resources": [{"type": "virtualCluster", "fill": {"VirtualClusterId": "virtualClusterId"}}], "located": {"virtualClusterId": "{virtualClusterId}"}},
|
||||
"emr-containers:ListJobTemplates": {"action": "emr-containers:ListJobTemplates", "types": [], "resources": []},
|
||||
"emr-containers:ListManagedEndpoints": {"action": "emr-containers:ListManagedEndpoints", "types": ["virtualCluster"], "resources": [{"type": "virtualCluster", "fill": {"VirtualClusterId": "virtualClusterId"}}], "located": {"virtualClusterId": "{virtualClusterId}"}},
|
||||
"emr-containers:ListSecurityConfigurations": {"action": "emr-containers:ListSecurityConfigurations", "types": [], "resources": []},
|
||||
"emr-containers:ListTagsForResource": {"action": "emr-containers:ListTagsForResource", "types": ["jobRun", "jobTemplate", "managedEndpoint", "securityConfiguration", "virtualCluster"], "resources": [{"types": ["jobRun", "jobTemplate", "managedEndpoint", "securityConfiguration", "virtualCluster"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}},
|
||||
"emr-containers:ListVirtualClusters": {"action": "emr-containers:ListVirtualClusters", "types": [], "resources": []},
|
||||
"emr-containers:StartJobRun": {"action": "emr-containers:StartJobRun", "types": ["virtualCluster"], "resources": [{"type": "virtualCluster", "fill": {"VirtualClusterId": "virtualClusterId"}}], "located": {"virtualClusterId": "{virtualClusterId}"}},
|
||||
"emr-containers:TagResource": {"action": "emr-containers:TagResource", "types": ["jobRun", "jobTemplate", "managedEndpoint", "securityConfiguration", "virtualCluster"], "resources": [{"types": ["jobRun", "jobTemplate", "managedEndpoint", "securityConfiguration", "virtualCluster"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}},
|
||||
"emr-containers:UntagResource": {"action": "emr-containers:UntagResource", "types": ["jobRun", "jobTemplate", "managedEndpoint", "securityConfiguration", "virtualCluster"], "resources": [{"types": ["jobRun", "jobTemplate", "managedEndpoint", "securityConfiguration", "virtualCluster"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}},
|
||||
"emr-containers:UpdateVirtualCluster": {"action": "emr-containers:UpdateVirtualCluster", "types": [], "resources": []},
|
||||
"emr-serverless:CancelJobRun": {"action": "emr-serverless:CancelJobRun", "types": ["jobRun"], "resources": [{"type": "jobRun", "fill": {"ApplicationId": "applicationId", "JobRunId": "jobRunId"}}], "located": {"applicationId": "{applicationId}", "jobRunId": "{jobRunId}"}},
|
||||
"emr-serverless:CreateApplication": {"action": "emr-serverless:CreateApplication", "types": [], "resources": [], "makes": [{"type": "application", "fill": {}}]},
|
||||
"emr-serverless:DeleteApplication": {"action": "emr-serverless:DeleteApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationId": "applicationId"}}], "located": {"applicationId": "{applicationId}"}},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_source": {"generator": "tools/aws/regen_iam_tag_on_create.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-15", "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"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "autoscaling": ["autoscaling"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudformation"], "cloudhsm": ["cloudhsmv2"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codedeploy": ["codedeploy"], "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"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "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"]},
|
||||
"_source": {"generator": "tools/aws/regen_iam_tag_on_create.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-16", "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"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "autoscaling": ["autoscaling"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudformation"], "cloudhsm": ["cloudhsmv2"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codedeploy": ["codedeploy"], "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"], "elasticloadbalancing": ["elb", "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", "appconfig": "REST routes no rule maps yet", "appsync": "REST routes no rule maps yet", "aps": "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": "its creation tags are a Tags structure holding Items, which this file does not read yet", "codeguru-reviewer": "REST routes no rule maps yet", "connect": "REST routes no rule maps yet", "detective": "REST routes no rule maps yet", "dlm": "REST routes no rule maps yet", "elasticfilesystem": "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", "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", "emr-containers", "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"],
|
||||
"otherNamespaces": ["account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifyuibuilder", "aoss", "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": {
|
||||
"access-analyzer:CreateAnalyzer": {"tagging": ["access-analyzer:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
@@ -284,11 +284,17 @@
|
||||
"elasticmapreduce:RunJobFlow": {"tagging": ["elasticmapreduce:AddTags"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
"elasticmapreduce:StartNotebookExecution": {"tagging": ["elasticmapreduce:AddTags"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
"elasticmapreduce:StartSession": {"tagging": ["elasticmapreduce:AddTags"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
"emr-containers:CreateJobTemplate": {"tagging": ["emr-containers:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"emr-containers:CreateManagedEndpoint": {"tagging": ["emr-containers:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"emr-containers:CreateSecurityConfiguration": {"tagging": ["emr-containers:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"emr-containers:CreateVirtualCluster": {"tagging": ["emr-containers:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"emr-containers:StartJobRun": {"tagging": ["emr-containers:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"emr-serverless:CreateApplication": {"tagging": ["emr-serverless:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"emr-serverless:StartJobRun": {"tagging": ["emr-serverless:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"emr-serverless:StartSession": {"tagging": ["emr-serverless:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"es:CreateDomain": {"tagging": ["es:AddTags"], "requestTags": true, "tags": [{"member": "TagList[]", "key": "Key", "value": "Value"}]},
|
||||
"es:CreateElasticsearchDomain": {"tagging": ["es:AddTags"], "requestTags": true, "tags": [{"member": "TagList[]", "key": "Key", "value": "Value"}]},
|
||||
"events:CreateArchive": {"tagging": ["events:TagResource"], "notRead": "no member of the request carries tags"},
|
||||
"events:CreateEventBus": {"tagging": ["events:TagResource"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}, {"member": "Tags{}"}]},
|
||||
"events:CreateEventSource": {"tagging": ["events:TagResource"], "requestTags": true, "tags": [{"member": "Tags{}"}]},
|
||||
"events:CreateSubscriber": {"tagging": ["events:TagResource"], "requestTags": true, "tags": [{"member": "Tags{}"}]},
|
||||
|
||||
@@ -650,6 +650,37 @@
|
||||
"UpdatePodIdentityAssociation": {"method": "POST", "requestUri": "/clusters/{name}/pod-identity-associations/{associationId}"}
|
||||
}
|
||||
},
|
||||
"emr-containers": {
|
||||
"credentialScope": "emr-containers",
|
||||
"apiVersion": "2020-10-01",
|
||||
"operations": {
|
||||
"CancelJobRun": {"method": "DELETE", "requestUri": "/virtualclusters/{virtualClusterId}/jobruns/{jobRunId}"},
|
||||
"CreateJobTemplate": {"method": "POST", "requestUri": "/jobtemplates"},
|
||||
"CreateManagedEndpoint": {"method": "POST", "requestUri": "/virtualclusters/{virtualClusterId}/endpoints"},
|
||||
"CreateSecurityConfiguration": {"method": "POST", "requestUri": "/securityconfigurations"},
|
||||
"CreateVirtualCluster": {"method": "POST", "requestUri": "/virtualclusters"},
|
||||
"DeleteJobTemplate": {"method": "DELETE", "requestUri": "/jobtemplates/{templateId}"},
|
||||
"DeleteManagedEndpoint": {"method": "DELETE", "requestUri": "/virtualclusters/{virtualClusterId}/endpoints/{endpointId}"},
|
||||
"DeleteSecurityConfiguration": {"method": "DELETE", "requestUri": "/securityconfigurations/{securityConfigurationId}"},
|
||||
"DeleteVirtualCluster": {"method": "DELETE", "requestUri": "/virtualclusters/{virtualClusterId}"},
|
||||
"DescribeJobRun": {"method": "GET", "requestUri": "/virtualclusters/{virtualClusterId}/jobruns/{jobRunId}"},
|
||||
"DescribeJobTemplate": {"method": "GET", "requestUri": "/jobtemplates/{templateId}"},
|
||||
"DescribeManagedEndpoint": {"method": "GET", "requestUri": "/virtualclusters/{virtualClusterId}/endpoints/{endpointId}"},
|
||||
"DescribeSecurityConfiguration": {"method": "GET", "requestUri": "/securityconfigurations/{securityConfigurationId}"},
|
||||
"DescribeVirtualCluster": {"method": "GET", "requestUri": "/virtualclusters/{virtualClusterId}"},
|
||||
"GetManagedEndpointSessionCredentials": {"method": "POST", "requestUri": "/virtualclusters/{virtualClusterId}/endpoints/{endpointId}/credentials"},
|
||||
"ListJobRuns": {"method": "GET", "requestUri": "/virtualclusters/{virtualClusterId}/jobruns"},
|
||||
"ListJobTemplates": {"method": "GET", "requestUri": "/jobtemplates"},
|
||||
"ListManagedEndpoints": {"method": "GET", "requestUri": "/virtualclusters/{virtualClusterId}/endpoints"},
|
||||
"ListSecurityConfigurations": {"method": "GET", "requestUri": "/securityconfigurations"},
|
||||
"ListTagsForResource": {"method": "GET", "requestUri": "/tags/{resourceArn}"},
|
||||
"ListVirtualClusters": {"method": "GET", "requestUri": "/virtualclusters"},
|
||||
"StartJobRun": {"method": "POST", "requestUri": "/virtualclusters/{virtualClusterId}/jobruns"},
|
||||
"TagResource": {"method": "POST", "requestUri": "/tags/{resourceArn}"},
|
||||
"UntagResource": {"method": "DELETE", "requestUri": "/tags/{resourceArn}"},
|
||||
"UpdateVirtualCluster": {"method": "PATCH", "requestUri": "/virtualclusters/{virtualClusterId}"}
|
||||
}
|
||||
},
|
||||
"emr-serverless": {
|
||||
"credentialScope": "emr-serverless",
|
||||
"apiVersion": "2021-07-13",
|
||||
|
||||
+17
-1
@@ -51,7 +51,7 @@ class PartitionCrossServiceSmokeIntegrationTest {
|
||||
"aps", "autoscaling", "backup", "batch", "bcmdataexports", "bedrock", "bedrockagentcorecontrol", "ce",
|
||||
"cloudfront", "cloudmap", "cloudwatch", "codebuild", "codedeploy", "codepipeline", "cognito",
|
||||
"configservice", "connect", "controlcatalog", "controltower", "datasync", "dlm", "dms", "dsql", "dynamodb", "ec2",
|
||||
"ec2instanceconnect", "ecr", "ecs", "efs", "eks", "elasticache", "elasticbeanstalk", "elb", "elbv2", "emr", "emrserverless",
|
||||
"ec2instanceconnect", "ecr", "ecs", "efs", "eks", "elasticache", "elasticbeanstalk", "elb", "elbv2", "emr", "emrcontainers", "emrserverless",
|
||||
"eventbridge", "eventbridgev2", "firehose", "fis", "glue", "guardduty", "iot", "kinesis", "kinesisanalytics", "lambda",
|
||||
"lambdamicrovms", "lambdaweb", "memorydb", "msk", "mwaa", "networkfirewall", "oam", "opensearch", "organizations",
|
||||
"paymentcryptography", "pipes", "quicksight", "ram", "rds", "redshift", "redshiftserverless",
|
||||
@@ -1337,6 +1337,22 @@ class PartitionCrossServiceSmokeIntegrationTest {
|
||||
PartitionMatrix.assertArnIn(partitionCase, created.jsonPath().getString("arn"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource(PartitionMatrix.NON_COMMERCIAL_CASES)
|
||||
void emrContainersVirtualClusterArn(PartitionCase partitionCase) {
|
||||
String region = offered(partitionCase, "emr-containers");
|
||||
String body = """
|
||||
{"name": "%s", "clientToken": "%s", "containerProvider": {"type": "EKS", "id": "smoke-eks"}}
|
||||
""".formatted(unique("smoke-vc", partitionCase), unique("token", partitionCase));
|
||||
Response created = signed(region, "emr-containers")
|
||||
.contentType(JSON)
|
||||
.body(body)
|
||||
.when().post("/virtualclusters").then().statusCode(200).extract().response();
|
||||
String virtualClusterId = created.jsonPath().getString("id");
|
||||
cleanup.register(() -> signed(region, "emr-containers").when().delete("/virtualclusters/" + virtualClusterId));
|
||||
PartitionMatrix.assertArnIn(partitionCase, created.jsonPath().getString("arn"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource(PartitionMatrix.NON_COMMERCIAL_CASES)
|
||||
void bcmDataExportsExportArn(PartitionCase partitionCase) {
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
package io.floci.aws.services.emrcontainers;
|
||||
|
||||
import io.floci.aws.testing.EksRequests;
|
||||
import io.floci.aws.testing.EnforcementFixtures;
|
||||
import io.floci.aws.testing.RestAssuredJsonUtils;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
import static io.restassured.RestAssured.given;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.hasItem;
|
||||
import static org.hamcrest.Matchers.hasKey;
|
||||
import static org.hamcrest.Matchers.hasSize;
|
||||
import static org.hamcrest.Matchers.matchesPattern;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
|
||||
@QuarkusTest
|
||||
class EmrContainersIntegrationTest {
|
||||
|
||||
private static final String ACCOUNT = "000000000000";
|
||||
private static final String REGION = "us-east-1";
|
||||
private static final String ROLE = "arn:aws:iam::000000000000:role/emr-job";
|
||||
private static final String RELEASE = "emr-7.5.0-latest";
|
||||
|
||||
@BeforeAll
|
||||
static void configureRestAssured() {
|
||||
RestAssuredJsonUtils.configureAwsContentTypes();
|
||||
}
|
||||
|
||||
private static RequestSpecification emr() {
|
||||
return emr(REGION);
|
||||
}
|
||||
|
||||
private static RequestSpecification emr(String region) {
|
||||
return given().header("Authorization", EnforcementFixtures.auth(ACCOUNT, region, "emr-containers"))
|
||||
.contentType("application/json")
|
||||
.urlEncodingEnabled(false);
|
||||
}
|
||||
|
||||
private static String eksCluster() {
|
||||
return eksCluster("CONFIG_MAP");
|
||||
}
|
||||
|
||||
private static String eksCluster(String authenticationMode) {
|
||||
String name = "emr-" + UUID.randomUUID().toString().substring(0, 8);
|
||||
EksRequests.eks(ACCOUNT, REGION)
|
||||
.body("""
|
||||
{"name": "%s", "roleArn": "arn:aws:iam::000000000000:role/eks-role", "version": "1.29",
|
||||
"accessConfig": {"authenticationMode": "%s"}}
|
||||
""".formatted(name, authenticationMode))
|
||||
.post("/clusters")
|
||||
.then().statusCode(200);
|
||||
return name;
|
||||
}
|
||||
|
||||
private static String virtualCluster(String eksCluster) {
|
||||
return emr().body("""
|
||||
{"name": "vc-%s", "clientToken": "%s",
|
||||
"containerProvider": {"type": "EKS", "id": "%s", "info": {"eksInfo": {"namespace": "spark"}}},
|
||||
"tags": {"team": "data"}}
|
||||
""".formatted(UUID.randomUUID().toString().substring(0, 8), UUID.randomUUID(), eksCluster))
|
||||
.post("/virtualclusters")
|
||||
.then().statusCode(200)
|
||||
.body("id", matchesPattern("[0-9a-z]{25}"))
|
||||
.body("arn", matchesPattern(
|
||||
"arn:aws:emr-containers:us-east-1:000000000000:/virtualclusters/[0-9a-z]{25}"))
|
||||
.extract().path("id");
|
||||
}
|
||||
|
||||
private static String startJobRun(String virtualClusterId) {
|
||||
return emr().body("""
|
||||
{"name": "pi", "clientToken": "%s", "executionRoleArn": "%s", "releaseLabel": "%s",
|
||||
"jobDriver": {"sparkSubmitJobDriver": {"entryPoint": "s3://bucket/pi.py",
|
||||
"sparkSubmitParameters": "--conf spark.executor.instances=2"}},
|
||||
"tags": {"run": "nightly"}}
|
||||
""".formatted(UUID.randomUUID(), ROLE, RELEASE))
|
||||
.post("/virtualclusters/" + virtualClusterId + "/jobruns")
|
||||
.then().statusCode(200)
|
||||
.body("virtualClusterId", equalTo(virtualClusterId))
|
||||
.body("name", equalTo("pi"))
|
||||
.extract().path("id");
|
||||
}
|
||||
|
||||
private static String encoded(String arn) {
|
||||
return URLEncoder.encode(arn, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
void virtualClusterLifecycleOverTheWire() {
|
||||
String id = virtualCluster(eksCluster());
|
||||
|
||||
emr().get("/virtualclusters/" + id)
|
||||
.then().statusCode(200)
|
||||
.body("virtualCluster.state", equalTo("RUNNING"))
|
||||
.body("virtualCluster.containerProvider.info.eksInfo.namespace", equalTo("spark"))
|
||||
.body("virtualCluster.createdAt", matchesPattern("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z"))
|
||||
.body("virtualCluster.tags.team", equalTo("data"))
|
||||
.body("virtualCluster", not(hasKey("_clientToken")));
|
||||
|
||||
emr().get("/virtualclusters?states=RUNNING&maxResults=50")
|
||||
.then().statusCode(200)
|
||||
.body("virtualClusters.id", hasItem(id));
|
||||
|
||||
emr().delete("/virtualclusters/" + id)
|
||||
.then().statusCode(200).body("id", equalTo(id));
|
||||
emr().get("/virtualclusters/" + id)
|
||||
.then().statusCode(200)
|
||||
.body("virtualCluster.state", equalTo("TERMINATED"))
|
||||
.body("virtualCluster.tags.size()", equalTo(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobRunCompletesAndIsListedAndDescribed() {
|
||||
String clusterId = virtualCluster(eksCluster());
|
||||
String runId = startJobRun(clusterId);
|
||||
|
||||
emr().get("/virtualclusters/" + clusterId + "/jobruns/" + runId)
|
||||
.then().statusCode(200)
|
||||
.body("jobRun.id", matchesPattern("[0-9a-z]{19}"))
|
||||
.body("jobRun.state", equalTo("COMPLETED"))
|
||||
.body("jobRun.finishedAt", notNullValue())
|
||||
.body("jobRun.createdBy", notNullValue())
|
||||
.body("jobRun.clientToken", notNullValue())
|
||||
.body("jobRun.jobDriver.sparkSubmitJobDriver.entryPoint", equalTo("s3://bucket/pi.py"))
|
||||
.body("jobRun.tags.run", equalTo("nightly"));
|
||||
|
||||
emr().get("/virtualclusters/" + clusterId + "/jobruns?states=COMPLETED&name=pi")
|
||||
.then().statusCode(200)
|
||||
.body("jobRuns", hasSize(1))
|
||||
.body("jobRuns[0].id", equalTo(runId));
|
||||
|
||||
emr().delete("/virtualclusters/" + clusterId + "/jobruns/" + runId)
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ValidationException"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobRunOnAMissingVirtualClusterAnswersAwsDocumentedError() {
|
||||
emr().body("""
|
||||
{"clientToken": "c", "executionRoleArn": "%s", "releaseLabel": "%s",
|
||||
"jobDriver": {"sparkSubmitJobDriver": {"entryPoint": "s3://bucket/pi.py"}}}
|
||||
""".formatted(ROLE, RELEASE))
|
||||
.post("/virtualclusters/nosuchcluster/jobruns")
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ResourceNotFoundException"))
|
||||
.body("message", equalTo("Virtual cluster nosuchcluster doesn't exist."));
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobRunOnAClusterEksDoesNotHaveFails() {
|
||||
String clusterId = virtualCluster("no-such-eks-cluster");
|
||||
String runId = startJobRun(clusterId);
|
||||
|
||||
emr().get("/virtualclusters/" + clusterId + "/jobruns/" + runId)
|
||||
.then().statusCode(200)
|
||||
.body("jobRun.state", equalTo("FAILED"))
|
||||
.body("jobRun.stateDetails", equalTo("Cluster no-such-eks-cluster does not exist."))
|
||||
.body("jobRun.failureReason", equalTo("CLUSTER_UNAVAILABLE"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void modelConstraintsAnswerValidationException() {
|
||||
emr().body("""
|
||||
{"name": "bad name", "clientToken": "c", "containerProvider": {"type": "EKS", "id": "x"}}
|
||||
""")
|
||||
.post("/virtualclusters")
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ValidationException"));
|
||||
emr().body("{\"name\": \"vc\", \"clientToken\": \"c\"}")
|
||||
.post("/virtualclusters")
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ValidationException"))
|
||||
.body("message", containsString("containerProvider"));
|
||||
emr().get("/virtualclusters/NOT-AN-ID")
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ValidationException"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobTemplateRunsWithItsParameters() {
|
||||
String clusterId = virtualCluster(eksCluster());
|
||||
String templateId = emr().body("""
|
||||
{"name": "nightly", "clientToken": "%s", "jobTemplateData": {
|
||||
"executionRoleArn": "%s", "releaseLabel": "%s",
|
||||
"jobDriver": {"sparkSubmitJobDriver": {"entryPoint": "${EntryPoint}"}},
|
||||
"parameterConfiguration": {"EntryPoint": {"type": "STRING"}}}}
|
||||
""".formatted(UUID.randomUUID(), ROLE, RELEASE))
|
||||
.post("/jobtemplates")
|
||||
.then().statusCode(200)
|
||||
.body("arn", containsString(":/jobtemplates/"))
|
||||
.body("createdAt", notNullValue())
|
||||
.extract().path("id");
|
||||
|
||||
emr().get("/jobtemplates/" + templateId)
|
||||
.then().statusCode(200)
|
||||
.body("jobTemplate.jobTemplateData.jobDriver.sparkSubmitJobDriver.entryPoint",
|
||||
equalTo("${EntryPoint}"));
|
||||
|
||||
String runId = emr().body("""
|
||||
{"clientToken": "%s", "jobTemplateId": "%s",
|
||||
"jobTemplateParameters": {"EntryPoint": "s3://bucket/job.py"}}
|
||||
""".formatted(UUID.randomUUID(), templateId))
|
||||
.post("/virtualclusters/" + clusterId + "/jobruns")
|
||||
.then().statusCode(200).extract().path("id");
|
||||
|
||||
emr().get("/virtualclusters/" + clusterId + "/jobruns/" + runId)
|
||||
.then().statusCode(200)
|
||||
.body("jobRun.jobDriver.sparkSubmitJobDriver.entryPoint", equalTo("s3://bucket/job.py"))
|
||||
.body("jobRun.executionRoleArn", equalTo(ROLE));
|
||||
|
||||
emr().delete("/jobtemplates/" + templateId).then().statusCode(200).body("id", equalTo(templateId));
|
||||
emr().get("/jobtemplates/" + templateId)
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ResourceNotFoundException"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void managedEndpointAndSessionCredentials() {
|
||||
String clusterId = virtualCluster(eksCluster());
|
||||
String endpointId = emr().body("""
|
||||
{"name": "studio", "type": "JUPYTER_ENTERPRISE_GATEWAY", "releaseLabel": "%s",
|
||||
"executionRoleArn": "%s", "clientToken": "%s"}
|
||||
""".formatted(RELEASE, ROLE, UUID.randomUUID()))
|
||||
.post("/virtualclusters/" + clusterId + "/endpoints")
|
||||
.then().statusCode(200)
|
||||
.body("id", matchesPattern("[0-9a-z]{13}"))
|
||||
.extract().path("id");
|
||||
|
||||
emr().get("/virtualclusters/" + clusterId + "/endpoints?types=JUPYTER_ENTERPRISE_GATEWAY")
|
||||
.then().statusCode(200)
|
||||
.body("endpoints", hasSize(1))
|
||||
.body("endpoints[0].state", equalTo("ACTIVE"));
|
||||
|
||||
emr().body("{\"executionRoleArn\": \"%s\", \"credentialType\": \"TOKEN\"}".formatted(ROLE))
|
||||
.post("/virtualclusters/" + clusterId + "/endpoints/" + endpointId + "/credentials")
|
||||
.then().statusCode(200)
|
||||
.body("credentials.token", notNullValue())
|
||||
.body("expiresAt", notNullValue());
|
||||
|
||||
emr().delete("/virtualclusters/" + clusterId + "/endpoints/" + endpointId)
|
||||
.then().statusCode(200).body("id", equalTo(endpointId));
|
||||
emr().get("/virtualclusters/" + clusterId + "/endpoints/" + endpointId)
|
||||
.then().statusCode(200).body("endpoint.state", equalTo("TERMINATED"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void securityConfigurationLifecycle() {
|
||||
String id = emr().body("""
|
||||
{"name": "sc", "clientToken": "%s", "securityConfigurationData": {
|
||||
"authorizationConfiguration": {
|
||||
"lakeFormationConfiguration": {"authorizedSessionTagValue": "EMR"}}}}
|
||||
""".formatted(UUID.randomUUID()))
|
||||
.post("/securityconfigurations")
|
||||
.then().statusCode(200)
|
||||
.body("arn", containsString(":/securityconfigurations/"))
|
||||
.extract().path("id");
|
||||
|
||||
emr().get("/securityconfigurations/" + id)
|
||||
.then().statusCode(200)
|
||||
.body("securityConfiguration.securityConfigurationData.authorizationConfiguration"
|
||||
+ ".lakeFormationConfiguration.authorizedSessionTagValue", equalTo("EMR"));
|
||||
emr().get("/securityconfigurations")
|
||||
.then().statusCode(200)
|
||||
.body("securityConfigurations.id", hasItem(id));
|
||||
emr().delete("/securityconfigurations/" + id).then().statusCode(200);
|
||||
emr().delete("/securityconfigurations/" + id)
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ValidationException"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void tagsGoThroughTheSharedTagsPath() {
|
||||
String clusterId = virtualCluster(eksCluster());
|
||||
String arn = emr().get("/virtualclusters/" + clusterId).then().extract().path("virtualCluster.arn");
|
||||
|
||||
emr().body("{\"tags\": {\"env\": \"test\"}}")
|
||||
.post("/tags/" + encoded(arn))
|
||||
.then().statusCode(200);
|
||||
emr().get("/tags/" + encoded(arn))
|
||||
.then().statusCode(200)
|
||||
.body("tags.team", equalTo("data"))
|
||||
.body("tags.env", equalTo("test"));
|
||||
emr().delete("/tags/" + encoded(arn) + "?tagKeys=team")
|
||||
.then().statusCode(200);
|
||||
emr().get("/tags/" + encoded(arn))
|
||||
.then().statusCode(200)
|
||||
.body("tags", not(hasKey("team")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void anAnotherRegionsRequestDoesNotFindTheResourceToTag() {
|
||||
String clusterId = virtualCluster(eksCluster());
|
||||
String arn = emr().get("/virtualclusters/" + clusterId).then().extract().path("virtualCluster.arn");
|
||||
|
||||
emr("eu-west-1").body("{\"tags\": {\"env\": \"test\"}}")
|
||||
.post("/tags/" + encoded(arn))
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ResourceNotFoundException"));
|
||||
emr().get("/tags/" + encoded(arn))
|
||||
.then().statusCode(200)
|
||||
.body("tags", not(hasKey("env")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void theAccessEntryFilterKeepsVirtualClustersOfEksClustersAdmittingAccessEntries() {
|
||||
String plain = virtualCluster(eksCluster("CONFIG_MAP"));
|
||||
String integrated = virtualCluster(eksCluster("API_AND_CONFIG_MAP"));
|
||||
|
||||
emr().get("/virtualclusters?eksAccessEntryIntegrated=true&maxResults=1000")
|
||||
.then().statusCode(200)
|
||||
.body("virtualClusters.id", hasItem(integrated))
|
||||
.body("virtualClusters.id", not(hasItem(plain)));
|
||||
emr().get("/virtualclusters?eksAccessEntryIntegrated=false&maxResults=1000")
|
||||
.then().statusCode(200)
|
||||
.body("virtualClusters.id", hasItem(plain))
|
||||
.body("virtualClusters.id", not(hasItem(integrated)));
|
||||
emr().get("/virtualclusters?eksAccessEntryIntegrated=maybe")
|
||||
.then().statusCode(400)
|
||||
.body("__type", containsString("ValidationException"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aRequestSignedForS3KeepsThePathAsABucket() {
|
||||
given().header("Authorization", EnforcementFixtures.auth(ACCOUNT, REGION, "s3"))
|
||||
.get("/virtualclusters")
|
||||
.then().statusCode(404)
|
||||
.body(containsString("NoSuchBucket"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,492 @@
|
||||
package io.floci.aws.services.emrcontainers;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.core.common.RegionResolver;
|
||||
import io.floci.aws.core.storage.AccountAwareStorageBackend;
|
||||
import io.floci.aws.services.eks.EksService;
|
||||
import io.floci.aws.services.eks.model.AccessConfig;
|
||||
import io.floci.aws.services.eks.model.Cluster;
|
||||
import io.floci.aws.services.emrcontainers.EmrContainersService.ListQuery;
|
||||
import io.floci.aws.services.iam.IamService;
|
||||
import io.floci.aws.testing.MutableClock;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
class EmrContainersServiceTest {
|
||||
|
||||
private static final String REGION = "us-east-1";
|
||||
private static final String ACCOUNT_ID = "000000000000";
|
||||
private static final String EKS_CLUSTER = "analytics";
|
||||
private static final String ACCESS_ENTRY_CLUSTER = "managed-access";
|
||||
private static final String ROLE = "arn:aws:iam::000000000000:role/emr-job";
|
||||
private static final String RELEASE = "emr-7.5.0-latest";
|
||||
|
||||
private final ObjectMapper mapper = new ObjectMapper();
|
||||
private MutableClock clock;
|
||||
private EksService eks;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
clock = new MutableClock();
|
||||
eks = mock(EksService.class);
|
||||
when(eks.findAuthenticationCluster(anyString(), anyString(), anyString())).thenReturn(Optional.empty());
|
||||
when(eks.findAuthenticationCluster(ACCOUNT_ID, REGION, EKS_CLUSTER)).thenReturn(Optional.of(new Cluster()));
|
||||
Cluster withAccessEntries = new Cluster();
|
||||
withAccessEntries.setAccessConfig(new AccessConfig("API_AND_CONFIG_MAP", false));
|
||||
when(eks.findAuthenticationCluster(ACCOUNT_ID, REGION, ACCESS_ENTRY_CLUSTER))
|
||||
.thenReturn(Optional.of(withAccessEntries));
|
||||
}
|
||||
|
||||
private EmrContainersService service(int jobRunDurationSeconds) {
|
||||
return service(jobRunDurationSeconds, REGION, List.of(AccountAwareStorageBackend.inMemory(ACCOUNT_ID),
|
||||
AccountAwareStorageBackend.inMemory(ACCOUNT_ID), AccountAwareStorageBackend.inMemory(ACCOUNT_ID),
|
||||
AccountAwareStorageBackend.inMemory(ACCOUNT_ID), AccountAwareStorageBackend.inMemory(ACCOUNT_ID)));
|
||||
}
|
||||
|
||||
// A service serving requests of region over the given virtual cluster, job run, endpoint, template and security
|
||||
// configuration stores, so two services of different regions can share them.
|
||||
private EmrContainersService service(int jobRunDurationSeconds, String region,
|
||||
List<AccountAwareStorageBackend<ObjectNode>> stores) {
|
||||
IamService iam = mock(IamService.class);
|
||||
when(iam.resolveCallerArn(eq(null))).thenReturn(Optional.empty());
|
||||
return new EmrContainersService(stores.get(0), stores.get(1), stores.get(2), stores.get(3), stores.get(4),
|
||||
mapper, new RegionResolver(region, ACCOUNT_ID), eks, iam, null, clock, jobRunDurationSeconds);
|
||||
}
|
||||
|
||||
private ObjectNode json(String text) {
|
||||
try {
|
||||
return (ObjectNode) mapper.readTree(text);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(text, e);
|
||||
}
|
||||
}
|
||||
|
||||
private String virtualCluster(EmrContainersService service, String eksCluster) {
|
||||
return service.createVirtualCluster(json("""
|
||||
{"name": "vc", "clientToken": "%s",
|
||||
"containerProvider": {"type": "EKS", "id": "%s", "info": {"eksInfo": {"namespace": "spark"}}}}
|
||||
""".formatted(UUID.randomUUID(), eksCluster))).get("id").textValue();
|
||||
}
|
||||
|
||||
private ObjectNode startJobRun(EmrContainersService service, String virtualClusterId) {
|
||||
return service.startJobRun(virtualClusterId, json("""
|
||||
{"name": "pi", "clientToken": "%s", "executionRoleArn": "%s", "releaseLabel": "%s",
|
||||
"jobDriver": {"sparkSubmitJobDriver": {"entryPoint": "s3://bucket/pi.py"}}}
|
||||
""".formatted(UUID.randomUUID(), ROLE, RELEASE)));
|
||||
}
|
||||
|
||||
private JsonNode jobRun(EmrContainersService service, String virtualClusterId, String id) {
|
||||
return service.describeJobRun(virtualClusterId, id).get("jobRun");
|
||||
}
|
||||
|
||||
@Test
|
||||
void virtualClusterIsRunningWithAnArnAndIdOfAwsShape() {
|
||||
EmrContainersService service = service(0);
|
||||
String id = virtualCluster(service, EKS_CLUSTER);
|
||||
|
||||
JsonNode cluster = service.describeVirtualCluster(id).get("virtualCluster");
|
||||
assertEquals(EmrContainersService.VIRTUAL_CLUSTER_ID_LENGTH, id.length());
|
||||
assertTrue(id.matches("[0-9a-z]+"));
|
||||
assertEquals("arn:aws:emr-containers:us-east-1:000000000000:/virtualclusters/" + id,
|
||||
cluster.get("arn").textValue());
|
||||
assertEquals("RUNNING", cluster.get("state").textValue());
|
||||
assertEquals("2026-01-01T00:00:00Z", cluster.get("createdAt").textValue());
|
||||
assertEquals("spark", cluster.at("/containerProvider/info/eksInfo/namespace").textValue());
|
||||
assertFalse(cluster.has("_clientToken"), "Floci's own members never leave the service");
|
||||
}
|
||||
|
||||
@Test
|
||||
void sameClientTokenAnswersTheSameVirtualCluster() {
|
||||
EmrContainersService service = service(0);
|
||||
String body = """
|
||||
{"name": "vc", "clientToken": "once",
|
||||
"containerProvider": {"type": "EKS", "id": "analytics", "info": {"eksInfo": {"namespace": "a"}}}}
|
||||
""";
|
||||
|
||||
String first = service.createVirtualCluster(json(body)).get("id").textValue();
|
||||
String second = service.createVirtualCluster(json(body)).get("id").textValue();
|
||||
|
||||
assertEquals(first, second);
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobRunCompletesAsSoonAsSubmittedByDefault() {
|
||||
EmrContainersService service = service(0);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
|
||||
ObjectNode started = startJobRun(service, clusterId);
|
||||
JsonNode run = jobRun(service, clusterId, started.get("id").textValue());
|
||||
|
||||
assertEquals(EmrContainersService.JOB_RUN_ID_LENGTH, started.get("id").textValue().length());
|
||||
assertEquals("COMPLETED", run.get("state").textValue());
|
||||
assertEquals(run.get("createdAt"), run.get("finishedAt"));
|
||||
assertEquals("arn:aws:iam::000000000000:root", run.get("createdBy").textValue());
|
||||
assertEquals(RELEASE, run.get("releaseLabel").textValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobRunStaysRunningForTheConfiguredDurationThenCompletes() {
|
||||
EmrContainersService service = service(60);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
String id = startJobRun(service, clusterId).get("id").textValue();
|
||||
|
||||
assertEquals("RUNNING", jobRun(service, clusterId, id).get("state").textValue());
|
||||
clock.advance(Duration.ofSeconds(59));
|
||||
assertEquals("RUNNING", jobRun(service, clusterId, id).get("state").textValue());
|
||||
clock.advance(Duration.ofSeconds(1));
|
||||
|
||||
JsonNode run = jobRun(service, clusterId, id);
|
||||
assertEquals("COMPLETED", run.get("state").textValue());
|
||||
assertEquals("2026-01-01T00:01:00Z", run.get("finishedAt").textValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobRunOnAClusterEksDoesNotHaveFailsAsAwsDocuments() {
|
||||
EmrContainersService service = service(0);
|
||||
String clusterId = virtualCluster(service, "gone");
|
||||
|
||||
JsonNode run = jobRun(service, clusterId, startJobRun(service, clusterId).get("id").textValue());
|
||||
|
||||
assertEquals("FAILED", run.get("state").textValue());
|
||||
assertEquals("Cluster gone does not exist.", run.get("stateDetails").textValue());
|
||||
assertEquals("CLUSTER_UNAVAILABLE", run.get("failureReason").textValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void runningJobRunIsCancelledOnceAndThenRefused() {
|
||||
EmrContainersService service = service(600);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
String id = startJobRun(service, clusterId).get("id").textValue();
|
||||
|
||||
service.cancelJobRun(clusterId, id);
|
||||
assertEquals("CANCELLED", jobRun(service, clusterId, id).get("state").textValue());
|
||||
|
||||
AwsException again = assertThrows(AwsException.class, () -> service.cancelJobRun(clusterId, id));
|
||||
assertEquals("ValidationException", again.getErrorCode());
|
||||
clock.advance(Duration.ofHours(1));
|
||||
assertEquals("CANCELLED", jobRun(service, clusterId, id).get("state").textValue(),
|
||||
"a cancelled run never completes when its duration passes");
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobRunOnUnknownOrTerminatedVirtualClusterIsRefusedWithAwsWording() {
|
||||
EmrContainersService service = service(0);
|
||||
AwsException unknown = assertThrows(AwsException.class, () -> startJobRun(service, "nosuchcluster"));
|
||||
assertEquals("ResourceNotFoundException", unknown.getErrorCode());
|
||||
assertEquals(400, unknown.getHttpStatus());
|
||||
assertEquals("Virtual cluster nosuchcluster doesn't exist.", unknown.getMessage());
|
||||
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
service.deleteVirtualCluster(clusterId);
|
||||
AwsException terminated = assertThrows(AwsException.class, () -> startJobRun(service, clusterId));
|
||||
assertEquals("ValidationException", terminated.getErrorCode());
|
||||
assertEquals("Virtual cluster state TERMINATED is not valid to create resource JobRun.",
|
||||
terminated.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobTemplateParametersAreSubstitutedWithDefaultsAndTypes() {
|
||||
EmrContainersService service = service(0);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
String templateId = service.createJobTemplate(json("""
|
||||
{"name": "t", "clientToken": "%s", "jobTemplateData": {
|
||||
"executionRoleArn": "%s", "releaseLabel": "%s",
|
||||
"jobDriver": {"sparkSubmitJobDriver": {"entryPoint": "${EntryPoint}",
|
||||
"sparkSubmitParameters":
|
||||
"--class ${MainClass} --conf spark.executor.instances=${Executors} ${Kept}"}},
|
||||
"parameterConfiguration": {
|
||||
"EntryPoint": {"type": "STRING"},
|
||||
"MainClass": {"type": "STRING", "defaultValue": "Main"},
|
||||
"Executors": {"type": "NUMBER", "defaultValue": "2"}},
|
||||
"jobTags": {"team": "data", "tier": "batch"}}}
|
||||
""".formatted(UUID.randomUUID(), ROLE, RELEASE))).get("id").textValue();
|
||||
|
||||
String id = service.startJobRun(clusterId, json("""
|
||||
{"clientToken": "%s", "jobTemplateId": "%s",
|
||||
"jobTemplateParameters": {"EntryPoint": "s3://bucket/app.jar", "Executors": "4"},
|
||||
"tags": {"tier": "adhoc"}}
|
||||
""".formatted(UUID.randomUUID(), templateId))).get("id").textValue();
|
||||
JsonNode run = jobRun(service, clusterId, id);
|
||||
|
||||
assertEquals("s3://bucket/app.jar", run.at("/jobDriver/sparkSubmitJobDriver/entryPoint").textValue());
|
||||
assertEquals("--class Main --conf spark.executor.instances=4 ${Kept}",
|
||||
run.at("/jobDriver/sparkSubmitJobDriver/sparkSubmitParameters").textValue());
|
||||
assertEquals(ROLE, run.get("executionRoleArn").textValue());
|
||||
assertEquals(Map.of("team", "data", "tier", "adhoc"), mapper.convertValue(run.get("tags"), Map.class));
|
||||
|
||||
AwsException missing = assertThrows(AwsException.class, () -> service.startJobRun(clusterId, json("""
|
||||
{"clientToken": "%s", "jobTemplateId": "%s"}
|
||||
""".formatted(UUID.randomUUID(), templateId))));
|
||||
assertEquals("ValidationException", missing.getErrorCode());
|
||||
assertTrue(missing.getMessage().contains("EntryPoint"), missing.getMessage());
|
||||
|
||||
AwsException notNumber = assertThrows(AwsException.class, () -> service.startJobRun(clusterId, json("""
|
||||
{"clientToken": "%s", "jobTemplateId": "%s",
|
||||
"jobTemplateParameters": {"EntryPoint": "s3://bucket/app.jar", "Executors": "many"}}
|
||||
""".formatted(UUID.randomUUID(), templateId))));
|
||||
assertTrue(notNumber.getMessage().contains("Executors"), notNumber.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobRunWithoutTemplateNeedsItsRoleReleaseAndDriver() {
|
||||
EmrContainersService service = service(0);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
|
||||
AwsException error = assertThrows(AwsException.class, () -> service.startJobRun(clusterId,
|
||||
json("{\"clientToken\": \"t\", \"releaseLabel\": \"emr-7.5.0-latest\"}")));
|
||||
|
||||
assertEquals("ValidationException", error.getErrorCode());
|
||||
assertTrue(error.getMessage().startsWith("2 validation errors detected: "), error.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void schedulerStatusCountsRunningJobRunsAndAnEmptyConfigurationClearsIt() {
|
||||
EmrContainersService service = service(600);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
startJobRun(service, clusterId);
|
||||
startJobRun(service, clusterId);
|
||||
service.updateVirtualCluster(clusterId, json("""
|
||||
{"clientToken": "u1", "schedulerConfiguration": {"maxConcurrentJobRuns": 5, "maxInQueueJobRuns": 100}}
|
||||
"""));
|
||||
|
||||
JsonNode status = service.describeVirtualCluster(clusterId).at("/virtualCluster/schedulerStatus");
|
||||
assertEquals(2, status.get("currentConcurrentJobRuns").intValue());
|
||||
assertEquals(0, status.get("currentInQueueJobRuns").intValue());
|
||||
|
||||
service.updateVirtualCluster(clusterId, json("{\"clientToken\": \"u2\", \"schedulerConfiguration\": {}}"));
|
||||
JsonNode cleared = service.describeVirtualCluster(clusterId).get("virtualCluster");
|
||||
assertFalse(cleared.has("schedulerConfiguration"));
|
||||
assertFalse(cleared.has("schedulerStatus"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void terminatingAVirtualClusterClearsItsTagsAndRefusesNewOnes() {
|
||||
EmrContainersService service = service(0);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
String arn = service.describeVirtualCluster(clusterId).at("/virtualCluster/arn").textValue();
|
||||
service.tagResource(arn, Map.of("team", "data"));
|
||||
assertEquals(Map.of("team", "data"), service.listTags(arn));
|
||||
|
||||
service.deleteVirtualCluster(clusterId);
|
||||
|
||||
assertEquals(Map.of(), service.listTags(arn));
|
||||
AwsException error = assertThrows(AwsException.class, () -> service.tagResource(arn, Map.of("a", "b")));
|
||||
assertEquals("ValidationException", error.getErrorCode());
|
||||
assertEquals("TERMINATED", service.describeVirtualCluster(clusterId).at("/virtualCluster/state").textValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void aResourceOfAnotherRegionIsNotFoundByTheTaggingOperations() {
|
||||
List<AccountAwareStorageBackend<ObjectNode>> stores = List.of(AccountAwareStorageBackend.inMemory(ACCOUNT_ID),
|
||||
AccountAwareStorageBackend.inMemory(ACCOUNT_ID), AccountAwareStorageBackend.inMemory(ACCOUNT_ID),
|
||||
AccountAwareStorageBackend.inMemory(ACCOUNT_ID), AccountAwareStorageBackend.inMemory(ACCOUNT_ID));
|
||||
EmrContainersService east = service(0, REGION, stores);
|
||||
EmrContainersService west = service(0, "eu-west-1", stores);
|
||||
String clusterId = virtualCluster(east, EKS_CLUSTER);
|
||||
String arn = east.describeVirtualCluster(clusterId).at("/virtualCluster/arn").textValue();
|
||||
|
||||
for (Runnable call : List.<Runnable>of(() -> west.listTags(arn), () -> west.tagResource(arn, Map.of("a", "b")),
|
||||
() -> west.untagResource(arn, List.of("team")))) {
|
||||
AwsException error = assertThrows(AwsException.class, call::run);
|
||||
assertEquals("ResourceNotFoundException", error.getErrorCode());
|
||||
}
|
||||
assertEquals(Map.of(), east.listTags(arn));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aJobRunsTemplateAndRequestTagsTogetherKeepTheTagLimit() {
|
||||
EmrContainersService service = service(0);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
ObjectNode template = json("""
|
||||
{"name": "t", "clientToken": "c", "jobTemplateData": {"executionRoleArn": "%s",
|
||||
"releaseLabel": "%s", "jobDriver": {"sparkSqlJobDriver": {"entryPoint": "s3://b/q.sql"}}}}
|
||||
""".formatted(ROLE, RELEASE));
|
||||
ObjectNode jobTags = ((ObjectNode) template.get("jobTemplateData")).putObject("jobTags");
|
||||
ObjectNode request = json("{\"clientToken\": \"r\"}");
|
||||
ObjectNode requestTags = request.putObject("tags");
|
||||
for (int i = 0; i < 30; i++) {
|
||||
jobTags.put("template" + i, "v");
|
||||
requestTags.put("request" + i, "v");
|
||||
}
|
||||
request.put("jobTemplateId", service.createJobTemplate(template).get("id").textValue());
|
||||
|
||||
AwsException error = assertThrows(AwsException.class, () -> service.startJobRun(clusterId, request));
|
||||
|
||||
assertEquals("ValidationException", error.getErrorCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
void theAccessEntryFilterKeepsTheVirtualClustersOfEksClustersThatAdmitAccessEntries() {
|
||||
EmrContainersService service = service(0);
|
||||
String plain = virtualCluster(service, EKS_CLUSTER);
|
||||
String integrated = virtualCluster(service, ACCESS_ENTRY_CLUSTER);
|
||||
ListQuery all = ListQuery.of(null, null, null, null, null);
|
||||
|
||||
JsonNode withEntries = service.listVirtualClusters(all, null, null, true).get("virtualClusters");
|
||||
JsonNode without = service.listVirtualClusters(all, null, null, false).get("virtualClusters");
|
||||
|
||||
assertEquals(List.of(integrated), ids(withEntries));
|
||||
assertEquals(List.of(plain), ids(without));
|
||||
assertEquals(2, service.listVirtualClusters(all, null, null, null).get("virtualClusters").size());
|
||||
}
|
||||
|
||||
private static List<String> ids(JsonNode items) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
items.forEach(item -> ids.add(item.get("id").textValue()));
|
||||
return ids;
|
||||
}
|
||||
|
||||
@Test
|
||||
void jobTemplateArnIsOutsideTheTaggingOperationsModel() {
|
||||
EmrContainersService service = service(0);
|
||||
String arn = service.createJobTemplate(json("""
|
||||
{"name": "t", "clientToken": "c", "jobTemplateData": {"executionRoleArn": "%s",
|
||||
"releaseLabel": "%s", "jobDriver": {"sparkSqlJobDriver": {"entryPoint": "s3://b/q.sql"}}}}
|
||||
""".formatted(ROLE, RELEASE))).get("arn").textValue();
|
||||
|
||||
AwsException error = assertThrows(AwsException.class, () -> service.tagResource(arn, Map.of("a", "b")));
|
||||
|
||||
assertEquals("ValidationException", error.getErrorCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
void listFiltersByStateAndPagesById() {
|
||||
EmrContainersService service = service(0);
|
||||
String running = virtualCluster(service, EKS_CLUSTER);
|
||||
String terminated = virtualCluster(service, EKS_CLUSTER);
|
||||
service.deleteVirtualCluster(terminated);
|
||||
|
||||
JsonNode onlyRunning = service.listVirtualClusters(
|
||||
ListQuery.of(null, null, List.of("RUNNING"), null, null), null, null, null).get("virtualClusters");
|
||||
assertEquals(1, onlyRunning.size());
|
||||
assertEquals(running, onlyRunning.get(0).get("id").textValue());
|
||||
|
||||
ObjectNode first = service.listVirtualClusters(ListQuery.of(null, null, null, "1", null), null, null, null);
|
||||
assertEquals(1, first.get("virtualClusters").size());
|
||||
ObjectNode second = service.listVirtualClusters(
|
||||
ListQuery.of(null, null, null, "1", first.get("nextToken").textValue()), null, null, null);
|
||||
assertEquals(1, second.get("virtualClusters").size());
|
||||
assertFalse(second.has("nextToken"));
|
||||
assertTrue(first.at("/virtualClusters/0/id").textValue()
|
||||
.compareTo(second.at("/virtualClusters/0/id").textValue()) < 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void createdAfterAndBeforeBoundTheList() {
|
||||
EmrContainersService service = service(0);
|
||||
virtualCluster(service, EKS_CLUSTER);
|
||||
clock.advance(Duration.ofHours(1));
|
||||
String later = virtualCluster(service, EKS_CLUSTER);
|
||||
Instant between = Instant.parse("2026-01-01T00:30:00Z");
|
||||
|
||||
JsonNode after = service.listVirtualClusters(ListQuery.of(between.toString(), null, null, null, null),
|
||||
null, null, null).get("virtualClusters");
|
||||
JsonNode before = service.listVirtualClusters(ListQuery.of(null, between.toString(), null, null, null),
|
||||
null, null, null).get("virtualClusters");
|
||||
|
||||
assertEquals(1, after.size());
|
||||
assertEquals(later, after.get(0).get("id").textValue());
|
||||
assertEquals(1, before.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
void managedEndpointIssuesTokensWithinTheDocumentedDuration() {
|
||||
EmrContainersService service = service(0);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
String endpointId = service.createManagedEndpoint(clusterId, json("""
|
||||
{"name": "studio", "type": "JUPYTER_ENTERPRISE_GATEWAY", "releaseLabel": "%s",
|
||||
"executionRoleArn": "%s", "clientToken": "e1"}
|
||||
""".formatted(RELEASE, ROLE))).get("id").textValue();
|
||||
assertEquals(EmrContainersService.ENDPOINT_ID_LENGTH, endpointId.length());
|
||||
|
||||
ObjectNode credentials = service.getManagedEndpointSessionCredentials(clusterId, endpointId,
|
||||
json("{\"executionRoleArn\": \"%s\", \"credentialType\": \"TOKEN\"}".formatted(ROLE)));
|
||||
assertFalse(credentials.at("/credentials/token").textValue().isEmpty());
|
||||
assertEquals(credentials.get("credentials"), credentials.get("endpointCredentials"));
|
||||
assertEquals("2026-01-01T00:15:00Z", credentials.get("expiresAt").textValue(),
|
||||
"the API reference: the default duration is 15 minutes");
|
||||
|
||||
AwsException tooLong = assertThrows(AwsException.class, () -> service.getManagedEndpointSessionCredentials(
|
||||
clusterId, endpointId, json("""
|
||||
{"executionRoleArn": "%s", "credentialType": "TOKEN", "durationInSeconds": 43201}
|
||||
""".formatted(ROLE))));
|
||||
assertEquals("ValidationException", tooLong.getErrorCode());
|
||||
|
||||
service.deleteManagedEndpoint(clusterId, endpointId);
|
||||
assertEquals("TERMINATED",
|
||||
service.describeManagedEndpoint(clusterId, endpointId).at("/endpoint/state").textValue());
|
||||
assertThrows(AwsException.class, () -> service.getManagedEndpointSessionCredentials(clusterId, endpointId,
|
||||
json("{\"executionRoleArn\": \"%s\", \"credentialType\": \"TOKEN\"}".formatted(ROLE))));
|
||||
}
|
||||
|
||||
@Test
|
||||
void virtualClusterNamingAnUnknownSecurityConfigurationIsRefused() {
|
||||
EmrContainersService service = service(0);
|
||||
String body = """
|
||||
{"name": "vc", "clientToken": "%s", "securityConfigurationId": "%s",
|
||||
"containerProvider": {"type": "EKS", "id": "analytics"}}
|
||||
""";
|
||||
|
||||
AwsException error = assertThrows(AwsException.class,
|
||||
() -> service.createVirtualCluster(json(body.formatted("a", "nosuchconfig"))));
|
||||
assertEquals("ResourceNotFoundException", error.getErrorCode());
|
||||
|
||||
String configurationId = service.createSecurityConfiguration(json("""
|
||||
{"name": "sc", "clientToken": "s1", "securityConfigurationData": {}}
|
||||
""")).get("id").textValue();
|
||||
String clusterId = service.createVirtualCluster(json(body.formatted("b", configurationId)))
|
||||
.get("id").textValue();
|
||||
assertEquals(configurationId, service.describeVirtualCluster(clusterId)
|
||||
.at("/virtualCluster/securityConfigurationId").textValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void modelConstraintsAreCheckedBeforeAnythingIsStored() {
|
||||
EmrContainersService service = service(0);
|
||||
|
||||
AwsException badName = assertThrows(AwsException.class, () -> service.createVirtualCluster(json("""
|
||||
{"name": "bad name", "clientToken": "c", "containerProvider": {"type": "EKS", "id": "analytics"}}
|
||||
""")));
|
||||
AwsException badType = assertThrows(AwsException.class, () -> service.createVirtualCluster(json("""
|
||||
{"name": "vc", "clientToken": "c", "containerProvider": {"type": "ECS", "id": "analytics"}}
|
||||
""")));
|
||||
AwsException badId = assertThrows(AwsException.class, () -> service.describeVirtualCluster("UPPER"));
|
||||
|
||||
assertEquals("ValidationException", badName.getErrorCode());
|
||||
assertEquals("ValidationException", badType.getErrorCode());
|
||||
assertEquals("ValidationException", badId.getErrorCode());
|
||||
assertEquals(0, service.listVirtualClusters(ListQuery.of(null, null, null, null, null), null, null, null)
|
||||
.get("virtualClusters").size());
|
||||
}
|
||||
|
||||
@Test
|
||||
void clearRemovesEveryResource() {
|
||||
EmrContainersService service = service(0);
|
||||
String clusterId = virtualCluster(service, EKS_CLUSTER);
|
||||
startJobRun(service, clusterId);
|
||||
|
||||
service.clear();
|
||||
|
||||
assertThrows(AwsException.class, () -> service.describeVirtualCluster(clusterId));
|
||||
}
|
||||
}
|
||||
@@ -95,6 +95,8 @@ floci:
|
||||
flush-interval-ms: 60000
|
||||
emrserverless:
|
||||
flush-interval-ms: 60000
|
||||
emrcontainers:
|
||||
flush-interval-ms: 60000
|
||||
lakeformation:
|
||||
flush-interval-ms: 60000
|
||||
|
||||
@@ -539,6 +541,9 @@ floci:
|
||||
enabled: true
|
||||
job-run-duration-seconds: 0 # 0 = BATCH job runs succeed as soon as they start
|
||||
runner-mode: immediate
|
||||
emrcontainers:
|
||||
enabled: true
|
||||
job-run-duration-seconds: 0 # 0 = a job run completes as soon as it is submitted
|
||||
ssoadmin:
|
||||
enabled: true
|
||||
ssooidc:
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Vendor the EMR on EKS (emr-containers) request constraints from botocore's Apache-2.0 service model.
|
||||
|
||||
EmrContainersRequestShapes checks every operation's request body, with the members its path binds,
|
||||
through RequestConstraintCheck using the model's types, required members, bounds, patterns and enums.
|
||||
|
||||
Run from anywhere in the repo:
|
||||
python3 tools/aws/regen_emr_containers_shapes.py
|
||||
python3 tools/aws/regen_emr_containers_shapes.py --check
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import request_shapes
|
||||
|
||||
OUTPUT = request_shapes.REPO_ROOT / "src/main/resources/aws/emr-containers-request-shapes.json"
|
||||
MODEL = Path("emr-containers/2020-10-01")
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
return request_shapes.main(argv, script=__file__, model=MODEL, output=OUTPUT,
|
||||
description=__doc__, constraints=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -81,7 +81,8 @@ NAMESPACES = (
|
||||
"application-autoscaling", "athena", "autoscaling", "budgets", "cloudformation", "cloudtrail",
|
||||
"cloudwatch", "codebuild", "codedeploy", "codepipeline", "cognito-identity", "cognito-idp",
|
||||
"comprehend", "config", "datasync", "dms", "dsql", "ec2", "ecr", "ecs", "eks", "elasticmapreduce",
|
||||
"emr-serverless", "events", "firehose", "glue", "iam", "kinesis", "kinesisanalytics", "lambda", "logs", "pipes",
|
||||
"emr-containers", "emr-serverless", "events", "firehose", "glue", "iam", "kinesis", "kinesisanalytics", "lambda",
|
||||
"logs", "pipes",
|
||||
"rds", "redshift", "redshift-serverless", "rekognition", "resource-groups", "s3", "s3tables", "sagemaker",
|
||||
"scheduler", "secretsmanager", "servicecatalog", "ses", "sns", "ssm", "states", "swf", "textract",
|
||||
"transcribe", "transfer", "translate",
|
||||
|
||||
@@ -275,7 +275,8 @@ OUTPUT = REPO_ROOT / "src/main/resources/aws/iam-request-resources.json"
|
||||
NAMESPACES = ("access-analyzer", "account", "acm", "application-autoscaling", "athena", "bcm-data-exports",
|
||||
"bcm-pricing-calculator", "budgets", "ce", "cloudfront", "cloudfront-keyvaluestore", "cloudtrail",
|
||||
"codebuild", "codepipeline", "cognito-identity", "cognito-idp", "controlcatalog", "controltower", "cur",
|
||||
"datasync", "ec2", "ecr", "ecs", "elasticloadbalancing", "elasticmapreduce", "emr-serverless", "es", "events",
|
||||
"datasync", "ec2", "ecr", "ecs", "elasticloadbalancing", "elasticmapreduce", "emr-containers",
|
||||
"emr-serverless", "es", "events",
|
||||
"firehose", "fis", "globalaccelerator", "inspector2", "kinesisanalytics", "macie2", "oam",
|
||||
"payment-cryptography", "quicksight", "ram", "redshift", "redshift-data", "redshift-serverless",
|
||||
"rekognition", "resource-explorer-2", "route53", "s3tables", "s3vectors", "servicediscovery",
|
||||
|
||||
@@ -109,7 +109,8 @@ NAMESPACES = (
|
||||
"bcm-pricing-calculator", "budgets", "ce", "cloudformation", "cloudhsm", "cloudtrail", "cloudwatch",
|
||||
"codedeploy", "codepipeline", "cognito-identity", "cognito-idp", "comprehend", "config", "controltower", "cur",
|
||||
"datasync", "dms", "dsql", "dynamodb", "ec2", "ecr", "ecs", "eks", "elasticache", "elasticloadbalancing",
|
||||
"elasticmapreduce", "emr-serverless", "es", "events", "firehose", "fis", "globalaccelerator", "glue",
|
||||
"elasticmapreduce", "emr-containers", "emr-serverless", "es", "events", "firehose", "fis", "globalaccelerator",
|
||||
"glue",
|
||||
"guardduty", "iam", "kinesis", "kinesisanalytics", "kms", "lambda", "lightsail", "logs", "macie2", "memorydb",
|
||||
"network-firewall", "oam", "organizations", "payment-cryptography", "pipes", "ram", "rds", "redshift",
|
||||
"redshift-serverless", "rekognition", "resource-explorer-2", "resource-groups", "route53resolver", "s3tables",
|
||||
|
||||
@@ -70,6 +70,7 @@ MODELS: dict[str, str] = {
|
||||
"controltower": "controltower",
|
||||
"dsql": "dsql",
|
||||
"eks": "eks",
|
||||
"emr-containers": "emr-containers",
|
||||
"emr-serverless": "emr-serverless",
|
||||
"guardduty": "guardduty",
|
||||
"es": "es",
|
||||
|
||||
@@ -27,6 +27,7 @@ import regen_dynamodb_shapes
|
||||
import regen_ecr_shapes
|
||||
import regen_ecs_shapes
|
||||
import regen_eks_shapes
|
||||
import regen_emr_containers_shapes
|
||||
import regen_emr_serverless_shapes
|
||||
import regen_iam_shapes
|
||||
import regen_cloudfront_keyvaluestore_shapes
|
||||
@@ -455,6 +456,7 @@ def vendored(script) -> tuple[str, ...]:
|
||||
regen_rekognition_shapes,
|
||||
regen_athena_shapes,
|
||||
regen_cur_shapes,
|
||||
regen_emr_containers_shapes,
|
||||
regen_lambda_microvm_shapes,
|
||||
regen_account_shapes,
|
||||
])
|
||||
|
||||
@@ -271,6 +271,19 @@ services:
|
||||
doc: docs/services/emr.md
|
||||
sources:
|
||||
- { path: services/emr/EmrHandler.java, mode: switch }
|
||||
- service: emr-containers
|
||||
doc: docs/services/emr-containers.md
|
||||
sources:
|
||||
- { path: services/emrcontainers/EmrContainersController.java, mode: rest }
|
||||
- { path: core/common/SharedTagsController.java, mode: rest }
|
||||
rename_actions:
|
||||
ListTags: ListTagsForResource
|
||||
TagResourcePost: TagResource
|
||||
exclude_actions:
|
||||
- ListTagsByQuery
|
||||
- TagResourceByBody
|
||||
- TagResourcePut
|
||||
- UntagResourceByQuery
|
||||
- service: eventbridge
|
||||
doc: docs/services/eventbridge.md
|
||||
sources:
|
||||
|
||||
Reference in new issue
Block a user