-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix issue-10446, add test case for ebs_config.volumes_per_instance check #14858
Conversation
aws/resource_aws_emr_cluster.go
Outdated
@@ -1424,8 +1424,7 @@ func flattenEBSConfig(ebsBlockDevices []*emr.EbsBlockDevice) *schema.Set { | |||
if ebs.VolumeSpecification.VolumeType != nil { | |||
ebsAttrs["type"] = *ebs.VolumeSpecification.VolumeType | |||
} | |||
ebsAttrs["volumes_per_instance"] = 1 | |||
|
|||
ebsAttrs["volumes_per_instance"] = len(ebsBlockDevices) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to specify multiple ebs_config
(multiple configurations with 1 or more volumes per instance)? e.g.
master_instance_group {
instance_type = "m4.large"
ebs_config {
size = 32
type = "gp2"
volumes_per_instance = 2
}
ebs_config {
size = 50
type = "gp2"
volumes_per_instance = 2
}
}
If so, the volumes_per_instance
needs to be calculated per configurations type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is an issue here. The volumes_per_instance
is an attribute of ebs_config
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I get what you're saying.
I updated the PR and test case
but we can not dealing with 2 same ebs_config config like this
master_instance_group {
instance_type = "m4.large"
ebs_config {
size = 32
type = "gp2"
volumes_per_instance = 2
}
ebs_config {
size = 32
type = "gp2"
volumes_per_instance = 1
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not being able to handle that last configuration there is okay -- seems reasonable to say that should have one ebs_config
with volumes_per_instance = 3
👍 Also thank you for adding the additional configuration to the test case!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you for this fix, @c4po 🚀
Output from acceptance testing (failure unrelated):
--- PASS: TestAccAWSEMRCluster_basic (418.45s)
--- PASS: TestAccAWSEMRCluster_configurationsJson (422.65s)
--- PASS: TestAccAWSEMRCluster_Step_Multiple (494.02s)
--- PASS: TestAccAWSEMRCluster_security_config (500.29s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy (573.87s)
--- PASS: TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc (629.50s)
--- PASS: TestAccAWSEMRCluster_Step_Basic (635.56s)
--- PASS: TestAccAWSEMRCluster_additionalInfo (704.09s)
--- FAIL: TestAccAWSEMRCluster_Ec2Attributes_DefaultManagedSecurityGroups (793.09s)
--- PASS: TestAccAWSEMRCluster_keepJob (380.07s)
--- PASS: TestAccAWSEMRCluster_disappears (806.34s)
--- PASS: TestAccAWSEMRCluster_terminationProtected (442.90s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType (881.22s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_Name (938.63s)
--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (958.46s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice (971.37s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType (1026.93s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_Name (1041.45s)
--- PASS: TestAccAWSEMRCluster_step_concurrency_level (408.01s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice (1050.70s)
--- PASS: TestAccAWSEMRCluster_s3Logging (577.92s)
--- PASS: TestAccAWSEMRCluster_ebs_config (430.41s)
--- PASS: TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount (1167.50s)
--- PASS: TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount (1227.66s)
--- PASS: TestAccAWSEMRCluster_custom_ami_id (481.41s)
--- PASS: TestAccAWSEMRCluster_visibleToAllUsers (830.64s)
--- PASS: TestAccAWSEMRCluster_bootstrap_ordering (1382.29s)
--- PASS: TestAccAWSEMRCluster_tags (817.81s)
--- PASS: TestAccAWSEMRCluster_root_volume_size (816.65s)
This has been released in version 3.5.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Closes #10446
Release note for CHANGELOG:
Output from acceptance testing: