mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
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:
1 parent
e7767b8bac
commit
8ba3f00443
4 files changed
+47
No files matched your search
@@ -318,6 +318,39 @@ class EmrIntegrationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(19)
|
||||
void aClusterNamesASecurityConfigurationThatExists() {
|
||||
String instances = "\"Instances\":{\"KeepJobFlowAliveWhenNoSteps\":true}";
|
||||
emr("RunJobFlow", "{\"Name\":\"secured\",\"SecurityConfiguration\":\"floci-emr-missing\"," + instances + "}")
|
||||
.then().statusCode(400)
|
||||
.body("__type", equalTo("ValidationException"))
|
||||
.body("message", equalTo("Security configuration does not exist: floci-emr-missing"));
|
||||
emr("ListClusters", "{}")
|
||||
.then().statusCode(200)
|
||||
.body("Clusters.findAll { it.Name == 'secured' }", hasSize(0));
|
||||
emr("DescribeCluster", "{\"ClusterId\":\"" + clusterId + "\"}")
|
||||
.then().statusCode(200)
|
||||
.body("Cluster", not(hasKey("SecurityConfiguration")));
|
||||
|
||||
emr("CreateSecurityConfiguration", "{\"Name\":\"floci-emr-cluster-sec\","
|
||||
+ "\"SecurityConfiguration\":\"{\\\"EncryptionConfiguration\\\":{}}\"}")
|
||||
.then().statusCode(200);
|
||||
String secured = null;
|
||||
try {
|
||||
secured = emr("RunJobFlow", "{\"Name\":\"secured\",\"SecurityConfiguration\":\"floci-emr-cluster-sec\","
|
||||
+ instances + "}").then().statusCode(200).extract().path("JobFlowId");
|
||||
emr("DescribeCluster", "{\"ClusterId\":\"" + secured + "\"}")
|
||||
.then().statusCode(200)
|
||||
.body("Cluster.SecurityConfiguration", equalTo("floci-emr-cluster-sec"));
|
||||
} finally {
|
||||
if (secured != null) {
|
||||
emr("TerminateJobFlows", "{\"JobFlowIds\":[\"" + secured + "\"]}").then().statusCode(200);
|
||||
}
|
||||
emr("DeleteSecurityConfiguration", "{\"Name\":\"floci-emr-cluster-sec\"}").then().statusCode(200);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(12)
|
||||
void tagsRoundTrip() {
|
||||
|
||||
Reference in new issue
Block a user