Skip to content
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: Properly normalize allocation_strategy values for aws_emr_cluster #34367

Merged

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Nov 13, 2023

Description

This PR is to fix the normalization of the allocation_strategy value for both the spot_specification and on_demand_specification configuration blocks of the aws_emr_cluster resource. Although the AWS API takes in values with lowercase characters and dashes, the attribute value returned by the AWS is converted to uppercase and underscores thus causing inconsistencies. To work around the issue, the Terraform resource code must normalize the value to the lowercase + dash scheme when flattening these configuration blocks.

Relations

Closes #34151

References

Output from Acceptance Testing

antw@U-UQPXPV4N2NIW:~/git/terraform-provider-aws$ make testacc TESTS=TestAccEMRCluster_InstanceFleet_basic PKG=emr
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/emr/... -v -count 1 -parallel 5 -run='TestAccEMRCluster_InstanceFleet_basic'  -timeout 360m
=== RUN   TestAccEMRCluster_InstanceFleet_basic
=== PAUSE TestAccEMRCluster_InstanceFleet_basic
=== CONT  TestAccEMRCluster_InstanceFleet_basic
--- PASS: TestAccEMRCluster_InstanceFleet_basic (1376.75s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/emr        1377.012s
antw@U-UQPXPV4N2NIW:~/git/terraform-provider-aws$ 

@github-actions github-actions bot added the size/XS Managed by automation to categorize the size of a PR. label Nov 13, 2023
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/emr Issues and PRs that pertain to the emr service. labels Nov 13, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 13, 2023
@acwwat acwwat force-pushed the b-aws_emr_cluster-fix_allocation_strategy branch from 271c701 to c6f7570 Compare November 13, 2023 06:03
@acwwat acwwat force-pushed the b-aws_emr_cluster-fix_allocation_strategy branch from c6f7570 to a49e2fc Compare November 13, 2023 06:30
@acwwat acwwat changed the title [WIP] fix: Properly normalize allocation_strategy values for aws_emr_cluster fix: Properly normalize allocation_strategy values for aws_emr_cluster Nov 13, 2023
@acwwat
Copy link
Contributor Author

acwwat commented Nov 13, 2023

I need some help from one of the maintainers to run the full acceptance test suite for this resource. With my environment, I am not able to scale the run to 20 parallel tests, and setting it to 5 takes forever to run. I was able to get one run to complete eventually, but there were a couple test cases that failed because of what seems to be wait time issues. AFAIK the failures were unrelated to the change. Thanks and let me know if you need anything else.

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 13, 2023
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccEMRCluster_InstanceFleet_basic\|TestAccEMRCluster_basic\|TestAccEMRInstanceFleet_ebsBasic\|TestAccEMRInstanceFleet_full' PKG=emr ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/emr/... -v -count 1 -parallel 2  -run=TestAccEMRCluster_InstanceFleet_basic\|TestAccEMRCluster_basic\|TestAccEMRInstanceFleet_ebsBasic\|TestAccEMRInstanceFleet_full -timeout 360m
=== RUN   TestAccEMRCluster_basic
=== PAUSE TestAccEMRCluster_basic
=== RUN   TestAccEMRCluster_InstanceFleet_basic
=== PAUSE TestAccEMRCluster_InstanceFleet_basic
=== RUN   TestAccEMRInstanceFleet_ebsBasic
=== PAUSE TestAccEMRInstanceFleet_ebsBasic
=== RUN   TestAccEMRInstanceFleet_full
=== PAUSE TestAccEMRInstanceFleet_full
=== CONT  TestAccEMRCluster_basic
=== CONT  TestAccEMRInstanceFleet_ebsBasic
--- PASS: TestAccEMRCluster_basic (335.85s)
=== CONT  TestAccEMRCluster_InstanceFleet_basic
--- PASS: TestAccEMRInstanceFleet_ebsBasic (698.66s)
=== CONT  TestAccEMRInstanceFleet_full
--- PASS: TestAccEMRInstanceFleet_full (724.47s)
--- PASS: TestAccEMRCluster_InstanceFleet_basic (1589.45s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/emr	1941.528s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit ebd7e04 into hashicorp:main Feb 8, 2024
43 checks passed
@github-actions github-actions bot added this to the v5.36.0 milestone Feb 8, 2024
Copy link

github-actions bot commented Feb 8, 2024

This functionality has been released in v5.36.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. Thank you!

@acwwat acwwat deleted the b-aws_emr_cluster-fix_allocation_strategy branch February 10, 2024 05:10
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. service/emr Issues and PRs that pertain to the emr service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [aws_emr_instance_fleet] allocation_strategy does not detect correctly
3 participants