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

r/aws_batch_compute_environment: Enforce no compute_resources block for UNMANAGED compute environments #22805

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jan 27, 2022

Community Note

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

Closes #19087.
Relates #20433.
Relates #22776.
Relates #22818.

Output from acceptance testing:

% make testacc TESTS=TestAccBatchComputeEnvironment_ PKG=batch
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/batch/... -v -count 1 -parallel 20 -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_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_createEC2WithoutComputeResources
=== PAUSE TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
=== RUN   TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole
=== PAUSE TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole
=== CONT  TestAccBatchComputeEnvironment_basic
=== CONT  TestAccBatchComputeEnvironment_defaultServiceRole
=== CONT  TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
=== CONT  TestAccBatchComputeEnvironment_createEC2
=== CONT  TestAccBatchComputeEnvironment_createSpot
=== CONT  TestAccBatchComputeEnvironment_updateServiceRole
=== CONT  TestAccBatchComputeEnvironment_updateState
=== CONT  TestAccBatchComputeEnvironment_createFargate
=== CONT  TestAccBatchComputeEnvironment_createFargateSpot
=== CONT  TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate
=== CONT  TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole
=== CONT  TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
=== CONT  TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
=== CONT  TestAccBatchComputeEnvironment_tags
=== CONT  TestAccBatchComputeEnvironment_namePrefix
=== CONT  TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
=== CONT  TestAccBatchComputeEnvironment_updateLaunchTemplate
=== CONT  TestAccBatchComputeEnvironment_launchTemplate
=== CONT  TestAccBatchComputeEnvironment_ec2Configuration
=== CONT  TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
=== CONT  TestAccBatchComputeEnvironment_defaultServiceRole
    acctest.go:750: skipping tests; missing IAM service-linked role /aws-service-role/batch. Please create the role and retry
--- SKIP: TestAccBatchComputeEnvironment_defaultServiceRole (1.62s)
=== CONT  TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
--- PASS: TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources (8.99s)
=== CONT  TestAccBatchComputeEnvironment_nameGenerated
--- PASS: TestAccBatchComputeEnvironment_createEC2WithoutComputeResources (32.19s)
=== CONT  TestAccBatchComputeEnvironment_disappears
--- PASS: TestAccBatchComputeEnvironment_basic (61.76s)
--- PASS: TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole (62.93s)
--- PASS: TestAccBatchComputeEnvironment_createFargate (65.98s)
--- PASS: TestAccBatchComputeEnvironment_createFargateSpot (72.69s)
--- PASS: TestAccBatchComputeEnvironment_createEC2 (74.99s)
--- PASS: TestAccBatchComputeEnvironment_ec2Configuration (82.29s)
--- PASS: TestAccBatchComputeEnvironment_namePrefix (88.21s)
--- PASS: TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage (108.95s)
--- PASS: TestAccBatchComputeEnvironment_tags (118.70s)
--- PASS: TestAccBatchComputeEnvironment_nameGenerated (115.06s)
--- PASS: TestAccBatchComputeEnvironment_updateState (124.74s)
--- PASS: TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate (133.55s)
--- PASS: TestAccBatchComputeEnvironment_updateLaunchTemplate (137.06s)
--- PASS: TestAccBatchComputeEnvironment_updateServiceRole (139.45s)
--- PASS: TestAccBatchComputeEnvironment_launchTemplate (146.68s)
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs (152.44s)
--- PASS: TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags (171.63s)
--- PASS: TestAccBatchComputeEnvironment_disappears (286.38s)
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_minVCPUs (400.16s)
--- PASS: TestAccBatchComputeEnvironment_createSpot (488.14s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/batch      491.500s

@github-actions github-actions bot added service/batch Issues and PRs that pertain to the batch service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/S Managed by automation to categorize the size of a PR. labels Jan 27, 2022
@ewbankkit ewbankkit added this to the v4.0.0 milestone Jan 27, 2022
@ewbankkit ewbankkit changed the base branch from main to release/4.x January 27, 2022 22:05
@anGie44 anGie44 force-pushed the release/4.x branch 6 times, most recently from e1f74b5 to 585486e Compare January 31, 2022 20:08
Base automatically changed from release/4.x to main January 31, 2022 22:59
@anGie44 anGie44 self-assigned this Feb 1, 2022
@ewbankkit ewbankkit added the breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. label Feb 1, 2022
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

Maybe add a blurb in the upgrade guide as well now that it's available? Everything else, LGTM

Output of acceptance tests (commercial):

--- PASS: TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags (222.21s)
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs (161.48s)
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_minVCPUs (310.25s)
--- PASS: TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage (83.16s)
--- PASS: TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate (156.40s)
--- PASS: TestAccBatchComputeEnvironment_basic (108.01s)
--- PASS: TestAccBatchComputeEnvironment_createEC2 (118.32s)
--- PASS: TestAccBatchComputeEnvironment_createEC2WithoutComputeResources (30.16s)
--- PASS: TestAccBatchComputeEnvironment_createFargate (129.70s)
--- PASS: TestAccBatchComputeEnvironment_createFargateSpot (93.08s)
--- PASS: TestAccBatchComputeEnvironment_createSpot (532.16s)
--- PASS: TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole (22.30s)
--- PASS: TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources (18.49s)
--- PASS: TestAccBatchComputeEnvironment_disappears (115.79s)
--- PASS: TestAccBatchComputeEnvironment_ec2Configuration (131.52s)
--- PASS: TestAccBatchComputeEnvironment_launchTemplate (105.27s)
--- PASS: TestAccBatchComputeEnvironment_nameGenerated (115.52s)
--- PASS: TestAccBatchComputeEnvironment_namePrefix (115.51s)
--- PASS: TestAccBatchComputeEnvironment_tags (162.36s)
--- PASS: TestAccBatchComputeEnvironment_updateLaunchTemplate (142.84s)
--- PASS: TestAccBatchComputeEnvironment_updateServiceRole (175.24s)
--- PASS: TestAccBatchComputeEnvironment_updateState (143.33s)
--- SKIP: TestAccBatchComputeEnvironment_defaultServiceRole (1.09s)

@ewbankkit ewbankkit merged commit a2b935c into main Feb 2, 2022
@ewbankkit ewbankkit deleted the f-aws_batch_compute_environment-no-compute_resources-when-UNMANAGED branch February 2, 2022 18:03
github-actions bot pushed a commit that referenced this pull request Feb 2, 2022
@github-actions
Copy link

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

@github-actions
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 May 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. service/batch Issues and PRs that pertain to the batch service. size/S 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.

r/aws_batch_compute_environment: Enforce no compute_resources block for UNMANAGED compute environments
2 participants