feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes (#5748)

* feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes

None was served, so Terraform's aws_emr_release_labels and
aws_emr_supported_instance_types data sources failed against Floci.

A curated catalogue of EMR releases (emr-7.5.0, Floci's default, and
emr-7.4.0, emr-6.15.0, emr-6.14.0 and emr-5.36.2) carries each
release's applications and versions from the EMR Release Guide and its
recent Amazon Linux releases, with common instance types and their EC2
sizes. The three actions filter and page it as the API documents, and
answer InvalidRequestException for an unknown release, a bad token or
an out-of-range MaxResults. A configured default release outside the
catalogue is still listed.

Closes #5734

* fix(emr): report EMR architecture values and match application versions without regard to case

ListSupportedInstanceTypes returned the EC2 spellings x86_64 and arm64; the EMR model gives X86_64 and AARCH64 for Architecture. The ListReleaseLabels application filter matched the name without regard to case but not the version, so phoenix@4.14.3-hbase-1.4 missed emr-5.36.2.

* refactor(emr): page the release catalogue with the shared Pagination

ListReleaseLabels and ListSupportedInstanceTypes now page through
core.common.Pagination, with the filters in the token namespace so a token
replayed with other filters, or altered, is refused. DescribeReleaseLabel
answers every application, as AWS reserves its MaxResults and NextToken.
The EMR integration tests share one request helper.
This commit is contained in:
David authored and GitHub committed 2026-10-18 15:11:42 -04:00
1 parent e3e06a1122
commit 7dc514b52f
13 files changed
+696 -137

No files matched your search

@@ -323,4 +323,26 @@ class EmrTest {
assertThatThrownBy(() -> emr.describeCluster(r -> r.clusterId("j-DOESNOTEXIST0")))
.isInstanceOf(InvalidRequestException.class);
}
@Test
@Order(22)
void releaseCatalogue() {
assertThat(emr.listReleaseLabels(r -> r.filters(f -> f.prefix("emr-7"))).releaseLabels())
.containsExactly("emr-7.5.0", "emr-7.4.0");
DescribeReleaseLabelResponse release = emr.describeReleaseLabel(r -> r.releaseLabel("emr-6.15.0"));
assertThat(release.applications())
.anySatisfy(a -> {
assertThat(a.name()).isEqualTo("spark");
assertThat(a.version()).isEqualTo("3.4.1");
});
assertThat(release.availableOSReleases()).isNotEmpty();
assertThat(emr.listSupportedInstanceTypes(r -> r.releaseLabel("emr-7.5.0")).supportedInstanceTypes())
.anySatisfy(t -> {
assertThat(t.type()).isEqualTo("r5.xlarge");
assertThat(t.vcpu()).isEqualTo(4);
assertThat(t.memoryGB()).isEqualTo(32f);
});
assertThatThrownBy(() -> emr.listSupportedInstanceTypes(r -> r.releaseLabel("emr-1.0.0")))
.isInstanceOf(InvalidRequestException.class);
}
}