fix(emr): give back a cluster's security configuration and refuse an unknown one (#8422)

RunJobFlow kept the SecurityConfiguration it was given, but
DescribeCluster never wrote it out, so the cluster came back with
none, although the model's Cluster has the member. It is given back
now.

RunJobFlow also took a security configuration that was never created.
A cluster names one CreateSecurityConfiguration made, so one that does
not exist is now refused with ValidationException "Security
configuration does not exist: <name>". No source gives AWS's answer,
so the code is the one RunJobFlow refuses its other input with in
Floci, and the wording that of DescribeSecurityConfiguration and
DeleteSecurityConfiguration; emr.md says so.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-15 00:49:10 -04:00
1 parent e7767b8bac
commit 8ba3f00443
4 files changed
+47

No files matched your search

@@ -703,6 +703,9 @@ public class EmrHandler {
if (c.getServiceRole() != null) {
node.put("ServiceRole", c.getServiceRole());
}
if (c.getSecurityConfiguration() != null) {
node.put("SecurityConfiguration", c.getSecurityConfiguration());
}
node.put("NormalizedInstanceHours", c.getNormalizedInstanceHours());
if (c.getMasterPublicDnsName() != null) {
node.put("MasterPublicDnsName", EmrService.masterDnsName(c.getRegion()));
@@ -382,6 +382,13 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
throw new AwsException("ValidationException", "The RunJobFlow request can contain InstanceFleets"
+ " parameters or InstanceGroups parameters, but not both.", 400);
}
// A security configuration is created first and named here; no source gives AWS's answer for one that is
// not there, so the code is RunJobFlow's own for its input and the wording that of the other calls.
if (cluster.getSecurityConfiguration() != null
&& secConfigStore.get(cluster.getSecurityConfiguration()).isEmpty()) {
throw new AwsException("ValidationException",
"Security configuration does not exist: " + cluster.getSecurityConfiguration(), 400);
}
String id = "j-" + randomId(13);
cluster.setId(id);
cluster.setRegion(region);