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

Make batch compute environments updatable. Fixes GH-24374 #30438

Conversation

sworisbreathing
Copy link
Contributor

@sworisbreathing sworisbreathing commented Apr 4, 2023

Description

AWS Batch supports updating compute environments in certain cases. This PR allows terraform to update a batch compute environment.

Relations

Closes #24374.
Relates #25944.
Closes #15535.

References

Output from Acceptance Testing

I am unable to run acceptance tests myself - the only AWS accounts I have access to are locked down such that some of the basic acceptance test scaffolding (such as creating VPCs, subnets, etc) is not permitted.

@github-actions
Copy link

github-actions bot commented Apr 4, 2023

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 size/XL Managed by automation to categorize the size of a PR. service/batch Issues and PRs that pertain to the batch service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 4, 2023
sworisbreathing added a commit to sworisbreathing/terraform-provider-aws that referenced this pull request Apr 4, 2023
@sworisbreathing
Copy link
Contributor Author

This contribution was originally raised as #25944 but was accidentally closed when I renamed the branch. I've rebased, fixed up merge conflicts, and hopefully aligned with the contributing guide as best I can.

@sworisbreathing sworisbreathing force-pushed the f-aws_batch_compute_environment-make-updatable branch 3 times, most recently from 0163625 to b8e7e04 Compare April 4, 2023 12:14
@sworisbreathing sworisbreathing force-pushed the f-aws_batch_compute_environment-make-updatable branch from b8e7e04 to 1a93a42 Compare April 4, 2023 12:36
@sworisbreathing
Copy link
Contributor Author

@ewbankkit @bschaatsbergen one thing I've left out of this PR is the ability to update imageKubernetesVersion as the provider doesn't currently expose this config option.

This PR is already marked size/xl so I'm not sure if I should add the parameter just to make updating feature-complete, or if I should raise a separate PR to expose that setting. WDYT?

@delagoya
Copy link

Hello, will PR be accepted?

@breathingdust breathingdust added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 18, 2023
@ewbankkit ewbankkit self-assigned this Jul 24, 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=TestAccBatchComputeEnvironment_' PKG=batch ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/batch/... -v -count 1 -parallel 2  -run=TestAccBatchComputeEnvironment_ -timeout 180m
=== RUN   TestAccBatchComputeEnvironment_basic
=== PAUSE TestAccBatchComputeEnvironment_basic
=== RUN   TestAccBatchComputeEnvironment_disappears
=== PAUSE TestAccBatchComputeEnvironment_disappears
=== RUN   TestAccBatchComputeEnvironment_nameGenerated
=== PAUSE TestAccBatchComputeEnvironment_nameGenerated
=== RUN   TestAccBatchComputeEnvironment_namePrefix
=== PAUSE TestAccBatchComputeEnvironment_namePrefix
=== RUN   TestAccBatchComputeEnvironment_createEC2
=== PAUSE TestAccBatchComputeEnvironment_createEC2
=== RUN   TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
=== PAUSE TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
=== RUN   TestAccBatchComputeEnvironment_createSpot
=== PAUSE TestAccBatchComputeEnvironment_createSpot
=== RUN   TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
=== PAUSE TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
=== RUN   TestAccBatchComputeEnvironment_createFargate
=== PAUSE TestAccBatchComputeEnvironment_createFargate
=== RUN   TestAccBatchComputeEnvironment_createFargateSpot
=== PAUSE TestAccBatchComputeEnvironment_createFargateSpot
=== RUN   TestAccBatchComputeEnvironment_updateState
=== PAUSE TestAccBatchComputeEnvironment_updateState
=== RUN   TestAccBatchComputeEnvironment_updateServiceRole
=== PAUSE TestAccBatchComputeEnvironment_updateServiceRole
=== RUN   TestAccBatchComputeEnvironment_defaultServiceRole
=== PAUSE TestAccBatchComputeEnvironment_defaultServiceRole
=== RUN   TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
=== PAUSE TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
=== RUN   TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
=== PAUSE TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
=== RUN   TestAccBatchComputeEnvironment_ec2Configuration
=== PAUSE TestAccBatchComputeEnvironment_ec2Configuration
=== RUN   TestAccBatchComputeEnvironment_ec2ConfigurationPlacementGroup
=== PAUSE TestAccBatchComputeEnvironment_ec2ConfigurationPlacementGroup
=== RUN   TestAccBatchComputeEnvironment_launchTemplate
=== PAUSE TestAccBatchComputeEnvironment_launchTemplate
=== RUN   TestAccBatchComputeEnvironment_updateLaunchTemplate
=== PAUSE TestAccBatchComputeEnvironment_updateLaunchTemplate
=== RUN   TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate
=== PAUSE TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate
=== RUN   TestAccBatchComputeEnvironment_tags
=== PAUSE TestAccBatchComputeEnvironment_tags
=== RUN   TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
=== PAUSE TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
=== RUN   TestAccBatchComputeEnvironment_updateEC2
=== PAUSE TestAccBatchComputeEnvironment_updateEC2
=== RUN   TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
=== PAUSE TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
=== CONT  TestAccBatchComputeEnvironment_basic
=== CONT  TestAccBatchComputeEnvironment_defaultServiceRole
--- PASS: TestAccBatchComputeEnvironment_basic (34.63s)
=== CONT  TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate
--- PASS: TestAccBatchComputeEnvironment_defaultServiceRole (39.59s)
=== CONT  TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
--- PASS: TestAccBatchComputeEnvironment_createEC2WithoutComputeResources (16.11s)
=== CONT  TestAccBatchComputeEnvironment_updateEC2
--- PASS: TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate (74.10s)
=== CONT  TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
--- PASS: TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources (3.10s)
=== CONT  TestAccBatchComputeEnvironment_tags
--- PASS: TestAccBatchComputeEnvironment_updateEC2 (98.63s)
=== CONT  TestAccBatchComputeEnvironment_ec2ConfigurationPlacementGroup
--- PASS: TestAccBatchComputeEnvironment_tags (95.15s)
=== CONT  TestAccBatchComputeEnvironment_updateLaunchTemplate
--- PASS: TestAccBatchComputeEnvironment_ec2ConfigurationPlacementGroup (51.48s)
=== CONT  TestAccBatchComputeEnvironment_launchTemplate
--- PASS: TestAccBatchComputeEnvironment_launchTemplate (49.54s)
=== CONT  TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
--- PASS: TestAccBatchComputeEnvironment_updateLaunchTemplate (74.79s)
=== CONT  TestAccBatchComputeEnvironment_createEC2
--- PASS: TestAccBatchComputeEnvironment_createEC2 (48.41s)
=== CONT  TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs (79.91s)
=== CONT  TestAccBatchComputeEnvironment_createSpot
--- PASS: TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags (154.62s)
=== CONT  TestAccBatchComputeEnvironment_updateServiceRole
--- PASS: TestAccBatchComputeEnvironment_updateServiceRole (84.21s)
=== CONT  TestAccBatchComputeEnvironment_ec2Configuration
--- PASS: TestAccBatchComputeEnvironment_ec2Configuration (49.46s)
=== CONT  TestAccBatchComputeEnvironment_updateState
--- PASS: TestAccBatchComputeEnvironment_updateState (68.90s)
=== CONT  TestAccBatchComputeEnvironment_nameGenerated
--- PASS: TestAccBatchComputeEnvironment_nameGenerated (50.09s)
=== CONT  TestAccBatchComputeEnvironment_namePrefix
--- PASS: TestAccBatchComputeEnvironment_namePrefix (51.18s)
=== CONT  TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
--- PASS: TestAccBatchComputeEnvironment_createSpot (480.85s)
=== CONT  TestAccBatchComputeEnvironment_createFargateSpot
--- PASS: TestAccBatchComputeEnvironment_createFargateSpot (48.44s)
=== CONT  TestAccBatchComputeEnvironment_createFargate
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_minVCPUs (215.72s)
=== CONT  TestAccBatchComputeEnvironment_disappears
--- PASS: TestAccBatchComputeEnvironment_createFargate (48.21s)
=== CONT  TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
--- PASS: TestAccBatchComputeEnvironment_disappears (49.45s)
--- PASS: TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage (51.44s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/batch	1044.146s

@ewbankkit
Copy link
Contributor

@sworisbreathing Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit cc19bfd into hashicorp:main Jul 25, 2023
40 checks passed
@github-actions github-actions bot added this to the v5.10.0 milestone Jul 25, 2023
@sworisbreathing
Copy link
Contributor Author

Thanks, @ewbankkit! This is going to make our BAU operations sooo much easier!

@github-actions
Copy link

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

@sworisbreathing sworisbreathing deleted the f-aws_batch_compute_environment-make-updatable branch August 2, 2023 04:59
@github-actions
Copy link

github-actions bot commented Sep 2, 2023

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 Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/batch Issues and PRs that pertain to the batch service. size/XL 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
4 participants