diff --git a/docs/services/cloudformation.md b/docs/services/cloudformation.md index 10cd8c2c98..af3fd768e5 100644 --- a/docs/services/cloudformation.md +++ b/docs/services/cloudformation.md @@ -220,7 +220,7 @@ cross-resource references. | ECS | `Cluster`, `TaskDefinition`, `Service`, `CapacityProvider`, `ClusterCapacityProviderAssociations` | | EFS | `FileSystem` (metadata only, there is no NFS data plane), `MountTarget` (`SecurityGroups` update in place, every other property replaces), `AccessPoint` (`AccessPointTags` update in place, every other property replaces) | | EKS | `Cluster` (created with `Name`, `Version`, `RoleArn`, `Tags`, `EncryptionConfig`, `ResourcesVpcConfig`, `Logging`, `AccessConfig` and `KubernetesNetworkConfig.IpFamily` and `ServiceIpv4Cidr`, a replacement included; a change to `EncryptionConfig`, `IpFamily` or `ServiceIpv4Cidr` replaces the cluster with the new value applied; `ElasticLoadBalancing`, `ServiceIpv6Cidr` and `ResourcesVpcConfig.ControlPlaneEgressMode` are accepted and ignored; updated in place for `Tags`, keeping tags added outside the stack, for `Logging`, for `AccessConfig.AuthenticationMode` (a mode cannot be moved back, so a stack update that does so fails, and a stack rollback restores it) and for `ResourcesVpcConfig` endpoint access and `PublicAccessCidrs`; a change to `Name`, `RoleArn`, `EncryptionConfig`, `BootstrapSelfManagedAddons`, `OutpostConfig`, `AccessConfig.BootstrapClusterCreatorAdminPermissions`, `KubernetesNetworkConfig.IpFamily` or `KubernetesNetworkConfig.ServiceIpv4Cidr` replaces the cluster, as the registry marks them create-only, and deletes the old one once the update commits; a change to `Version` is accepted with a warning and not applied, as the emulator has no `UpdateClusterVersion`; a change to the subnets or security groups of `ResourcesVpcConfig` fails the resource, as the emulator's `UpdateClusterConfig` does not change them), `Nodegroup` (created with `ClusterName`, `NodegroupName`, `NodeRole`, `Subnets` and `Tags`; updated in place for `Tags`, keeping tags added outside the stack; a change to `ClusterName`, `NodegroupName`, `NodeRole`, `Subnets`, `AmiType`, `CapacityType`, `DiskSize`, `InstanceTypes` or `RemoteAccess` replaces the nodegroup, as the registry marks them create-only, and deletes the old one once the update commits; `ScalingConfig`, `Labels`, `Taints`, `UpdateConfig`, `Version`, `ReleaseVersion`, `ForceUpdateEnabled`, `LaunchTemplate`, `NodeRepairConfig` and `WarmPoolConfig` are accepted and not applied, whether changed or dropped, with a warning, as the emulator cannot update a nodegroup in place) | -| EMR | `Cluster` (created through `RunJobFlow`, once it is waiting or running, its master, core and task groups or fleets as `RunJobFlow`'s `InstanceGroups` or `InstanceFleets`; `AdditionalInfo`, `KerberosAttributes`, `OSReleaseLabel`, `EbsRootVolumeIops`, `EbsRootVolumeThroughput`, `PlacementGroupConfigs`, `LogEncryptionKmsKeyId` and `MonitoringConfiguration`, `Instances`' `Ec2SubnetIds`, additional security groups and `HadoopVersion` are accepted with a warning and not stored; task groups and fleets need unique names; a template that sets the read-only `Id` or `MasterPublicDNS` is refused; updated in place for `AutoTerminationPolicy`, `ManagedScalingPolicy`, `StepConcurrencyLevel`, `VisibleToAllUsers`, `Tags` (keeping tags added outside the stack), `TerminationProtected`, `UnhealthyNodeReplacement`, a core or task group's `InstanceCount` and `AutoScalingPolicy` and a core or task fleet's target capacities, a dropped one taking its default; any other change, within `Instances` included, replaces the cluster and terminates the old one once the update commits; a termination-protected cluster refuses the delete), `InstanceGroupConfig` (a `TASK` group, the one role the reference allows, added through `AddInstanceGroups`; `InstanceCount` and `AutoScalingPolicy` update in place, and a create-only change adds a new group; the delete removes its policy and shrinks it to nothing, as a group cannot be removed from its cluster), `InstanceFleetConfig` (a `TASK` fleet, the one type the reference allows, added through `AddInstanceFleet`; `TargetOnDemandCapacity`, `TargetSpotCapacity`, `InstanceTypeConfigs` and `ResizeSpecifications` update in place through `ModifyInstanceFleet`, and a create-only change adds a new fleet; a rollback puts them back, but not an instance type the update added, which every later `ModifyInstanceFleet` must include, nor resize specifications where the fleet had none, which no request can clear, and dropped configs or resize specifications are kept for the same reason; the delete shrinks the fleet to nothing, as a fleet cannot be removed from its cluster), `Step` (added through `AddJobFlowSteps`, `LogUri` and `EncryptionKeyArn` as its `StepMonitoringConfiguration`; every property is create-only, so a change adds a new step, and a step stays in its cluster's history when deleted, as the schema's delete handler calls nothing), `SecurityConfiguration` (created with `Name`, generated when the template gives none, and the `SecurityConfiguration` JSON, as an object or its text; both are create-only, so any change replaces it and deletes the old one once the update commits, and a change that keeps a template's own `Name` is refused, as for every custom-named resource), `Studio` (created with every property; a template that sets the read-only `Arn`, `StudioId` or `Url` is refused; updated in place through `UpdateStudio` for `Name`, `Description`, `SubnetIds` and `DefaultS3Location`, a dropped setting kept as it is, and for `Tags`, keeping tags added outside the stack; a change to `IdpAuthUrl` or `IdpRelayStateParameterName` is accepted with a warning and not applied, as no Studio API changes them; a rollback puts back the name, description, location and tags, but not subnets an update added, which `UpdateStudio` cannot take away; a change to a create-only property replaces the Studio and deletes the old one once the update commits), `StudioSessionMapping` (`Ref` is `StudioId|IdentityType|IdentityName`, the schema's primary identifier; `SessionPolicyArn` updates in place, and a change to any of the three others replaces the mapping) | +| EMR | `Cluster` (created through `RunJobFlow`, once it is waiting or running, its master, core and task groups or fleets as `RunJobFlow`'s `InstanceGroups` or `InstanceFleets`; `AdditionalInfo`, `KerberosAttributes`, `OSReleaseLabel`, `EbsRootVolumeIops`, `EbsRootVolumeThroughput`, `PlacementGroupConfigs`, `LogEncryptionKmsKeyId`, `MonitoringConfiguration` and `Instances`' `HadoopVersion` are accepted with a warning and not stored; task groups and fleets need unique names; a template that sets the read-only `Id` or `MasterPublicDNS` is refused; updated in place for `AutoTerminationPolicy`, `ManagedScalingPolicy`, `StepConcurrencyLevel`, `VisibleToAllUsers`, `Tags` (keeping tags added outside the stack), `TerminationProtected`, `UnhealthyNodeReplacement`, a core or task group's `InstanceCount` and `AutoScalingPolicy` and a core or task fleet's target capacities, a dropped one taking its default; any other change, within `Instances` included, replaces the cluster and terminates the old one once the update commits; a termination-protected cluster refuses the delete), `InstanceGroupConfig` (a `TASK` group, the one role the reference allows, added through `AddInstanceGroups`; `InstanceCount` and `AutoScalingPolicy` update in place, and a create-only change adds a new group; the delete removes its policy and shrinks it to nothing, as a group cannot be removed from its cluster), `InstanceFleetConfig` (a `TASK` fleet, the one type the reference allows, added through `AddInstanceFleet`; `TargetOnDemandCapacity`, `TargetSpotCapacity`, `InstanceTypeConfigs` and `ResizeSpecifications` update in place through `ModifyInstanceFleet`, and a create-only change adds a new fleet; a rollback puts them back, but not an instance type the update added, which every later `ModifyInstanceFleet` must include, nor resize specifications where the fleet had none, which no request can clear, and dropped configs or resize specifications are kept for the same reason; the delete shrinks the fleet to nothing, as a fleet cannot be removed from its cluster), `Step` (added through `AddJobFlowSteps`, `LogUri` and `EncryptionKeyArn` as its `StepMonitoringConfiguration`; every property is create-only, so a change adds a new step, and a step stays in its cluster's history when deleted, as the schema's delete handler calls nothing), `SecurityConfiguration` (created with `Name`, generated when the template gives none, and the `SecurityConfiguration` JSON, as an object or its text; both are create-only, so any change replaces it and deletes the old one once the update commits, and a change that keeps a template's own `Name` is refused, as for every custom-named resource), `Studio` (created with every property; a template that sets the read-only `Arn`, `StudioId` or `Url` is refused; updated in place through `UpdateStudio` for `Name`, `Description`, `SubnetIds` and `DefaultS3Location`, a dropped setting kept as it is, and for `Tags`, keeping tags added outside the stack; a change to `IdpAuthUrl` or `IdpRelayStateParameterName` is accepted with a warning and not applied, as no Studio API changes them; a rollback puts back the name, description, location and tags, but not subnets an update added, which `UpdateStudio` cannot take away; a change to a create-only property replaces the Studio and deletes the old one once the update commits), `StudioSessionMapping` (`Ref` is `StudioId|IdentityType|IdentityName`, the schema's primary identifier; `SessionPolicyArn` updates in place, and a change to any of the three others replaces the mapping) | | EMR on EKS | `VirtualCluster` (created with `Name`, `ContainerProvider`, `SecurityConfigurationId`, `SessionEnabled` and `Tags`; a template that sets the read-only `Arn` or `Id` is refused; updated in place for `Tags` alone, which end as the template lists them, any other but an `aws:` one removed; a change to any other property replaces the virtual cluster, as the registry marks them create-only, and terminates the old one once the update commits; an update of a virtual cluster that is terminated or gone fails) | | EMR Serverless | `Application` (created with every property, `Name` and `Type` included; updated in place through `UpdateApplication` for the settings a template changes, a dropped setting kept as it is but for `InitialCapacity`, which is cleared, and for `Tags`, which end as the template lists them, any other removed; a change to `Name` or `Type` replaces the application and deletes the old one once the update commits; neither an update nor a delete stops a `STARTED` application, so one it refuses fails the resource, as on AWS) | | RDS | `DBInstance` (starts a real container), `DBCluster` (starts a real container), `DBSubnetGroup`, `DBParameterGroup`, `DBClusterParameterGroup`, `DBProxy`, `DBProxyTargetGroup` | diff --git a/docs/services/emr.md b/docs/services/emr.md index 7345ae7642..4c516c3e1e 100644 --- a/docs/services/emr.md +++ b/docs/services/emr.md @@ -96,6 +96,15 @@ them returns. adding that it "is idempotent but asynchronous". On an earlier release a `RUNNING` step answers `FAILED` with "Step is not in a cancellable state: RUNNING". +`DescribeCluster`'s `Ec2InstanceAttributes` give back what `RunJobFlow`'s `Instances` asked for. The subnet is the one +`Ec2SubnetId` names, else the first of the instance fleets' `Ec2SubnetIds`, from which EMR "chooses the Amazon EC2 +subnet with the best fit"; the availability zone is the one `Placement` names, else the first of its +`AvailabilityZones`. `RequestedEc2SubnetIds` and `RequestedEc2AvailabilityZones` are the ones requested, an empty +list when none was, as AWS gives them, and a request naming both is refused with `ValidationException`, as +"RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified together"; AWS's wording for it is not +documented, so it is Floci's. `IamInstanceProfile` is the `JobFlowRole`, "The IAM role that was specified when the +cluster was launched", and `AdditionalMasterSecurityGroups` and `AdditionalSlaveSecurityGroups` are the ones given. + The limits the API reference and the Management Guide give steps are checked, in each operation's own error code, in Floci's words, as no source gives AWS's: a `StepConcurrencyLevel` from 1 to 256 ("You can specify a minimum of 1 step and a maximum of 256 steps"), which `RunJobFlow` refuses with `ValidationException` and `ModifyCluster` with diff --git a/src/main/java/io/floci/aws/services/cloudformation/provisioners/EmrCfnProvisioner.java b/src/main/java/io/floci/aws/services/cloudformation/provisioners/EmrCfnProvisioner.java index 8a1be7ba18..462ed0a1b2 100644 --- a/src/main/java/io/floci/aws/services/cloudformation/provisioners/EmrCfnProvisioner.java +++ b/src/main/java/io/floci/aws/services/cloudformation/provisioners/EmrCfnProvisioner.java @@ -109,8 +109,7 @@ public class EmrCfnProvisioner implements CfnResourceProvisioner { "OSReleaseLabel", "EbsRootVolumeIops", "EbsRootVolumeThroughput", "PlacementGroupConfigs", "LogEncryptionKmsKeyId", "MonitoringConfiguration"); /** The members of {@code Instances} Floci's RunJobFlow keeps nothing of, accepted with a warning. */ - private static final List INSTANCES_NOT_STORED = List.of("Ec2SubnetIds", "AdditionalMasterSecurityGroups", - "AdditionalSlaveSecurityGroups", "HadoopVersion"); + private static final List INSTANCES_NOT_STORED = List.of("HadoopVersion"); private static final String GROUPS = "groups"; private static final String FLEETS = "fleets"; private static final Duration READY_TIMEOUT = Duration.ofMinutes(15); diff --git a/src/main/java/io/floci/aws/services/emr/EmrHandler.java b/src/main/java/io/floci/aws/services/emr/EmrHandler.java index 3c28f798fd..e4ca4a73ee 100644 --- a/src/main/java/io/floci/aws/services/emr/EmrHandler.java +++ b/src/main/java/io/floci/aws/services/emr/EmrHandler.java @@ -38,6 +38,7 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.PrimitiveIterator; /** @@ -216,7 +217,7 @@ public class EmrHandler { cluster.setTerminationProtected(instances.path("TerminationProtected").asBoolean(false)); cluster.setUnhealthyNodeReplacement(instances.path("UnhealthyNodeReplacement").asBoolean(false)); cluster.setSessionEnabled(request.path("SessionEnabled").asBoolean(false)); - cluster.setEc2Attributes(buildEc2Attributes(instances, region)); + cluster.setEc2Attributes(buildEc2Attributes(request, instances, region)); List groups = parseInstanceGroups(instances.path("InstanceGroups")); List fleets = parseInstanceFleets(instances.path("InstanceFleets")); cluster.setInstanceGroups(groups.isEmpty() && fleets.isEmpty() ? uniformInstanceGroups(instances) : groups); @@ -2047,21 +2048,48 @@ public class EmrHandler { return value.toString(); } - // The cluster's EC2 attributes, its availability zone among them: the one Placement names, the first of its - // AvailabilityZones, else the Region's first, as its instances' metadata gives it too. - private String buildEc2Attributes(JsonNode instances, String region) { + /** + * The cluster's EC2 attributes, as DescribeCluster gives them. Its availability zone is the one Placement names, + * the first of its AvailabilityZones, else the Region's first, as its instances' metadata gives it too. Its subnet + * is the one Ec2SubnetId names, else the first of the instance fleets' Ec2SubnetIds, from which EMR "chooses the + * Amazon EC2 subnet with the best fit". The subnets and zones requested come back as such, an empty list when none + * was, as AWS gives them; "RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified together", + * and AWS's refusal is not documented, so its wording is Floci's. The JobFlowRole is its IamInstanceProfile, "The + * IAM role that was specified when the cluster was launched", and the additional security groups are kept. + */ + private String buildEc2Attributes(JsonNode request, JsonNode instances, String region) { ObjectNode ec2 = objectMapper.createObjectNode(); JsonNode placement = instances.path("Placement"); + List zones = Objects.requireNonNullElse( + strings(placement.path("AvailabilityZones"), "Placement.AvailabilityZones"), List.of()); + List subnets = Objects.requireNonNullElse( + strings(instances.path("Ec2SubnetIds"), "Ec2SubnetIds"), List.of()); + if (!zones.isEmpty() && !subnets.isEmpty()) { + throw new AwsException("ValidationException", + "Ec2SubnetIds and Placement.AvailabilityZones cannot be specified together.", 400); + } String zone = placement.path("AvailabilityZone").asText(""); - if (zone.isEmpty()) { - zone = placement.path("AvailabilityZones").path(0).asText(""); + if (zone.isEmpty() && !zones.isEmpty()) { + zone = zones.getFirst(); } ec2.put("Ec2AvailabilityZone", zone.isEmpty() ? region + "a" : zone); copyText(instances, "Ec2KeyName", ec2, "Ec2KeyName"); copyText(instances, "Ec2SubnetId", ec2, "Ec2SubnetId"); + if (!ec2.has("Ec2SubnetId") && !subnets.isEmpty()) { + ec2.put("Ec2SubnetId", subnets.getFirst()); + } + subnets.forEach(ec2.putArray("RequestedEc2SubnetIds")::add); + zones.forEach(ec2.putArray("RequestedEc2AvailabilityZones")::add); + copyText(request, "JobFlowRole", ec2, "IamInstanceProfile"); copyText(instances, "EmrManagedMasterSecurityGroup", ec2, "EmrManagedMasterSecurityGroup"); copyText(instances, "EmrManagedSlaveSecurityGroup", ec2, "EmrManagedSlaveSecurityGroup"); copyText(instances, "ServiceAccessSecurityGroup", ec2, "ServiceAccessSecurityGroup"); + for (String member : List.of("AdditionalMasterSecurityGroups", "AdditionalSlaveSecurityGroups")) { + List groups = strings(instances.path(member), member); + if (groups != null && !groups.isEmpty()) { + groups.forEach(ec2.putArray(member)::add); + } + } return ec2.toString(); } diff --git a/src/test/java/io/floci/aws/services/emr/EmrIntegrationTest.java b/src/test/java/io/floci/aws/services/emr/EmrIntegrationTest.java index 77b54e1ddd..40b063a366 100644 --- a/src/test/java/io/floci/aws/services/emr/EmrIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/emr/EmrIntegrationTest.java @@ -15,6 +15,7 @@ import org.junit.jupiter.api.TestMethodOrder; import java.math.BigDecimal; import java.time.Instant; +import java.util.ArrayList; import java.util.List; import static io.floci.aws.testing.EmrRequests.emr; @@ -670,4 +671,68 @@ class EmrIntegrationTest { + "\"]}").then().statusCode(200); } } + + @Test + @Order(22) + void describeClusterGivesBackTheSubnetsZonesProfileAndSecurityGroupsRunJobFlowAskedFor() { + List launched = new ArrayList<>(); + String fleet = """ + {"InstanceFleetType": "MASTER", "TargetOnDemandCapacity": 1, + "InstanceTypeConfigs": [{"InstanceType": "m5.xlarge"}]}"""; + try { + String grouped = emr("RunJobFlow", """ + {"Name": "attributes-grouped", "JobFlowRole": "EMR_EC2_DefaultRole", "Instances": { + "KeepJobFlowAliveWhenNoSteps": true, "Ec2SubnetId": "subnet-0aaa", + "AdditionalMasterSecurityGroups": ["sg-0m1", "sg-0m2"], + "AdditionalSlaveSecurityGroups": ["sg-0s1"]}} + """).then().statusCode(200).extract().path("JobFlowId"); + launched.add(grouped); + String inSubnets = emr("RunJobFlow", """ + {"Name": "attributes-subnets", "Instances": {"KeepJobFlowAliveWhenNoSteps": true, + "Ec2SubnetIds": ["subnet-0bbb", "subnet-0ccc"], "InstanceFleets": [%s]}} + """.formatted(fleet)).then().statusCode(200).extract().path("JobFlowId"); + launched.add(inSubnets); + String inZones = emr("RunJobFlow", """ + {"Name": "attributes-zones", "Instances": {"KeepJobFlowAliveWhenNoSteps": true, + "Placement": {"AvailabilityZones": ["us-east-1d", "us-east-1b"]}, "InstanceFleets": [%s]}} + """.formatted(fleet)).then().statusCode(200).extract().path("JobFlowId"); + launched.add(inZones); + + String attributes = "Cluster.Ec2InstanceAttributes"; + emr("DescribeCluster", "{\"ClusterId\":\"" + grouped + "\"}").then().statusCode(200) + .body(attributes + ".Ec2SubnetId", equalTo("subnet-0aaa")) + .body(attributes + ".IamInstanceProfile", equalTo("EMR_EC2_DefaultRole")) + .body(attributes + ".AdditionalMasterSecurityGroups", equalTo(List.of("sg-0m1", "sg-0m2"))) + .body(attributes + ".AdditionalSlaveSecurityGroups", equalTo(List.of("sg-0s1"))) + .body(attributes + ".RequestedEc2SubnetIds", equalTo(List.of())) + .body(attributes + ".RequestedEc2AvailabilityZones", equalTo(List.of())); + emr("DescribeCluster", "{\"ClusterId\":\"" + inSubnets + "\"}").then().statusCode(200) + .body(attributes + ".Ec2SubnetId", equalTo("subnet-0bbb")) + .body(attributes + ".RequestedEc2SubnetIds", equalTo(List.of("subnet-0bbb", "subnet-0ccc"))) + .body(attributes, not(hasKey("IamInstanceProfile"))) + .body(attributes, not(hasKey("AdditionalMasterSecurityGroups"))); + emr("DescribeCluster", "{\"ClusterId\":\"" + inZones + "\"}").then().statusCode(200) + .body(attributes + ".Ec2AvailabilityZone", equalTo("us-east-1d")) + .body(attributes + ".RequestedEc2AvailabilityZones", equalTo(List.of("us-east-1d", "us-east-1b"))); + + emr("RunJobFlow", """ + {"Name": "attributes-both", "Instances": {"KeepJobFlowAliveWhenNoSteps": true, + "Ec2SubnetIds": ["subnet-0bbb"], "Placement": {"AvailabilityZones": ["us-east-1d"]}, + "InstanceFleets": [%s]}} + """.formatted(fleet)).then().statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", + equalTo("Ec2SubnetIds and Placement.AvailabilityZones cannot be specified together.")); + emr("RunJobFlow", """ + {"Name": "attributes-malformed", "Instances": {"KeepJobFlowAliveWhenNoSteps": true, + "AdditionalMasterSecurityGroups": "sg-0m1"}} + """).then().statusCode(400) + .body("__type", equalTo("SerializationException")); + } finally { + if (!launched.isEmpty()) { + emr("TerminateJobFlows", "{\"JobFlowIds\":[\"" + String.join("\",\"", launched) + "\"]}") + .then().statusCode(200); + } + } + } } diff --git a/tools/docs/cfn_resource_types.yaml b/tools/docs/cfn_resource_types.yaml index 6dc06b0290..006170435c 100644 --- a/tools/docs/cfn_resource_types.yaml +++ b/tools/docs/cfn_resource_types.yaml @@ -238,7 +238,7 @@ notes: AWS::Transfer::User: 'management plane only; Ref returns the user ARN; Arn attribute supported; Policy and PosixProfile are not supported; a ServerId or UserName change replaces the user' AWS::EKS::Cluster: 'created with `Name`, `Version`, `RoleArn`, `Tags`, `EncryptionConfig`, `ResourcesVpcConfig`, `Logging`, `AccessConfig` and `KubernetesNetworkConfig.IpFamily` and `ServiceIpv4Cidr`, a replacement included; a change to `EncryptionConfig`, `IpFamily` or `ServiceIpv4Cidr` replaces the cluster with the new value applied; `ElasticLoadBalancing`, `ServiceIpv6Cidr` and `ResourcesVpcConfig.ControlPlaneEgressMode` are accepted and ignored; updated in place for `Tags`, keeping tags added outside the stack, for `Logging`, for `AccessConfig.AuthenticationMode` (a mode cannot be moved back, so a stack update that does so fails, and a stack rollback restores it) and for `ResourcesVpcConfig` endpoint access and `PublicAccessCidrs`; a change to `Name`, `RoleArn`, `EncryptionConfig`, `BootstrapSelfManagedAddons`, `OutpostConfig`, `AccessConfig.BootstrapClusterCreatorAdminPermissions`, `KubernetesNetworkConfig.IpFamily` or `KubernetesNetworkConfig.ServiceIpv4Cidr` replaces the cluster, as the registry marks them create-only, and deletes the old one once the update commits; a change to `Version` is accepted with a warning and not applied, as the emulator has no `UpdateClusterVersion`; a change to the subnets or security groups of `ResourcesVpcConfig` fails the resource, as the emulator''s `UpdateClusterConfig` does not change them' AWS::EKS::Nodegroup: 'created with `ClusterName`, `NodegroupName`, `NodeRole`, `Subnets` and `Tags`; updated in place for `Tags`, keeping tags added outside the stack; a change to `ClusterName`, `NodegroupName`, `NodeRole`, `Subnets`, `AmiType`, `CapacityType`, `DiskSize`, `InstanceTypes` or `RemoteAccess` replaces the nodegroup, as the registry marks them create-only, and deletes the old one once the update commits; `ScalingConfig`, `Labels`, `Taints`, `UpdateConfig`, `Version`, `ReleaseVersion`, `ForceUpdateEnabled`, `LaunchTemplate`, `NodeRepairConfig` and `WarmPoolConfig` are accepted and not applied, whether changed or dropped, with a warning, as the emulator cannot update a nodegroup in place' - AWS::EMR::Cluster: 'created through `RunJobFlow`, once it is waiting or running, its master, core and task groups or fleets as `RunJobFlow`''s `InstanceGroups` or `InstanceFleets`; `AdditionalInfo`, `KerberosAttributes`, `OSReleaseLabel`, `EbsRootVolumeIops`, `EbsRootVolumeThroughput`, `PlacementGroupConfigs`, `LogEncryptionKmsKeyId` and `MonitoringConfiguration`, `Instances`'' `Ec2SubnetIds`, additional security groups and `HadoopVersion` are accepted with a warning and not stored; task groups and fleets need unique names; a template that sets the read-only `Id` or `MasterPublicDNS` is refused; updated in place for `AutoTerminationPolicy`, `ManagedScalingPolicy`, `StepConcurrencyLevel`, `VisibleToAllUsers`, `Tags` (keeping tags added outside the stack), `TerminationProtected`, `UnhealthyNodeReplacement`, a core or task group''s `InstanceCount` and `AutoScalingPolicy` and a core or task fleet''s target capacities, a dropped one taking its default; any other change, within `Instances` included, replaces the cluster and terminates the old one once the update commits; a termination-protected cluster refuses the delete' + AWS::EMR::Cluster: 'created through `RunJobFlow`, once it is waiting or running, its master, core and task groups or fleets as `RunJobFlow`''s `InstanceGroups` or `InstanceFleets`; `AdditionalInfo`, `KerberosAttributes`, `OSReleaseLabel`, `EbsRootVolumeIops`, `EbsRootVolumeThroughput`, `PlacementGroupConfigs`, `LogEncryptionKmsKeyId`, `MonitoringConfiguration` and `Instances`'' `HadoopVersion` are accepted with a warning and not stored; task groups and fleets need unique names; a template that sets the read-only `Id` or `MasterPublicDNS` is refused; updated in place for `AutoTerminationPolicy`, `ManagedScalingPolicy`, `StepConcurrencyLevel`, `VisibleToAllUsers`, `Tags` (keeping tags added outside the stack), `TerminationProtected`, `UnhealthyNodeReplacement`, a core or task group''s `InstanceCount` and `AutoScalingPolicy` and a core or task fleet''s target capacities, a dropped one taking its default; any other change, within `Instances` included, replaces the cluster and terminates the old one once the update commits; a termination-protected cluster refuses the delete' AWS::EMR::InstanceFleetConfig: 'a `TASK` fleet, the one type the reference allows, added through `AddInstanceFleet`; `TargetOnDemandCapacity`, `TargetSpotCapacity`, `InstanceTypeConfigs` and `ResizeSpecifications` update in place through `ModifyInstanceFleet`, and a create-only change adds a new fleet; a rollback puts them back, but not an instance type the update added, which every later `ModifyInstanceFleet` must include, nor resize specifications where the fleet had none, which no request can clear, and dropped configs or resize specifications are kept for the same reason; the delete shrinks the fleet to nothing, as a fleet cannot be removed from its cluster' AWS::EMR::InstanceGroupConfig: 'a `TASK` group, the one role the reference allows, added through `AddInstanceGroups`; `InstanceCount` and `AutoScalingPolicy` update in place, and a create-only change adds a new group; the delete removes its policy and shrinks it to nothing, as a group cannot be removed from its cluster' AWS::EMR::SecurityConfiguration: 'created with `Name`, generated when the template gives none, and the `SecurityConfiguration` JSON, as an object or its text; both are create-only, so any change replaces it and deletes the old one once the update commits, and a change that keeps a template''s own `Name` is refused, as for every custom-named resource'