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: Add ec2_configuration #21565

Conversation

ijin
Copy link
Contributor

@ijin ijin commented Nov 1, 2021

  • Adds the ec2_configuration block to the aws_batch_compute_environment resource
  • Add documentation for ec2_configuration block
  • Add deprecation note to image_id in favor of ec2_configuration:image_id_override

closes #18414

Acceptance test output:

% make testacc TESTARGS='-run=TestAccBatchComputeEnvironment_ec2Configuration' PKG_NAME=internal/service/batch
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/batch/... -v -count 1 -parallel 20 -run=TestAccBatchComputeEnvironment_ec2Configuration -timeout 180m
=== RUN   TestAccBatchComputeEnvironment_ec2Configuration
=== PAUSE TestAccBatchComputeEnvironment_ec2Configuration
=== CONT  TestAccBatchComputeEnvironment_ec2Configuration
--- PASS: TestAccBatchComputeEnvironment_ec2Configuration (57.12s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/batch      57.186s

ref: https://docs.aws.amazon.com/batch/latest/APIReference/API_ComputeResource.html

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

Acceptance test output:

% make testacc TESTARGS='-run=TestAccBatchComputeEnvironment_ec2Configuration' PKG_NAME=internal/service/batch
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/batch/... -v -count 1 -parallel 20 -run=TestAccBatchComputeEnvironment_ec2Configuration -timeout 180m
=== RUN   TestAccBatchComputeEnvironment_ec2Configuration
=== PAUSE TestAccBatchComputeEnvironment_ec2Configuration
=== CONT  TestAccBatchComputeEnvironment_ec2Configuration
`--- PASS: TestAccBatchComputeEnvironment_ec2Configuration (57.12s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/batch      57.186s
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/batch Issues and PRs that pertain to the batch service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 1, 2021
@ijin ijin force-pushed the f-aws_batch_compute_environment-ec2-configuration branch from b0f937f to 11d8a61 Compare November 1, 2021 09:19
@ijin ijin force-pushed the f-aws_batch_compute_environment-ec2-configuration branch from 11d8a61 to 2cd32d8 Compare November 1, 2021 09:25
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 🚀.

Commercial
% make testacc PKG_NAME=internal/service/batch TESTARGS='-run=TestAccBatchComputeEnvironment_'         
==> 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_UpdateSecurityGroupsAndSubnets_fargate
=== CONT  TestAccBatchComputeEnvironment_basic
=== CONT  TestAccBatchComputeEnvironment_updateLaunchTemplate
=== CONT  TestAccBatchComputeEnvironment_launchTemplate
=== CONT  TestAccBatchComputeEnvironment_ec2Configuration
=== CONT  TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
=== CONT  TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
=== CONT  TestAccBatchComputeEnvironment_defaultServiceRole
=== CONT  TestAccBatchComputeEnvironment_updateServiceRole
=== CONT  TestAccBatchComputeEnvironment_updateState
=== CONT  TestAccBatchComputeEnvironment_createFargateSpot
=== CONT  TestAccBatchComputeEnvironment_createFargate
=== CONT  TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
=== CONT  TestAccBatchComputeEnvironment_createSpot
=== CONT  TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
=== CONT  TestAccBatchComputeEnvironment_createEC2
=== CONT  TestAccBatchComputeEnvironment_namePrefix
=== CONT  TestAccBatchComputeEnvironment_nameGenerated
=== CONT  TestAccBatchComputeEnvironment_disappears
=== CONT  TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
=== CONT  TestAccBatchComputeEnvironment_defaultServiceRole
    acctest.go:730: skipping tests; missing IAM service-linked role /aws-service-role/batch. Please create the role and retry
--- SKIP: TestAccBatchComputeEnvironment_defaultServiceRole (1.34s)
=== CONT  TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
--- PASS: TestAccBatchComputeEnvironment_createEC2WithoutComputeResources (46.60s)
=== CONT  TestAccBatchComputeEnvironment_tags
--- PASS: TestAccBatchComputeEnvironment_createFargate (78.19s)
=== CONT  TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole
--- PASS: TestAccBatchComputeEnvironment_disappears (80.71s)
--- PASS: TestAccBatchComputeEnvironment_createEC2 (83.62s)
--- PASS: TestAccBatchComputeEnvironment_namePrefix (91.52s)
--- PASS: TestAccBatchComputeEnvironment_basic (95.86s)
--- PASS: TestAccBatchComputeEnvironment_launchTemplate (96.31s)
--- PASS: TestAccBatchComputeEnvironment_ec2Configuration (103.30s)
--- PASS: TestAccBatchComputeEnvironment_nameGenerated (108.54s)
--- PASS: TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage (109.76s)
--- PASS: TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole (34.56s)
--- PASS: TestAccBatchComputeEnvironment_createFargateSpot (116.11s)
--- PASS: TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate (125.18s)
--- PASS: TestAccBatchComputeEnvironment_updateState (135.59s)
--- PASS: TestAccBatchComputeEnvironment_updateLaunchTemplate (135.78s)
--- PASS: TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources (137.00s)
--- PASS: TestAccBatchComputeEnvironment_tags (106.27s)
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs (157.56s)
--- PASS: TestAccBatchComputeEnvironment_updateServiceRole (161.35s)
--- PASS: TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags (217.52s)
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_minVCPUs (269.67s)
--- PASS: TestAccBatchComputeEnvironment_createSpot (562.13s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/batch	565.342s
GovCloud
% make testacc PKG_NAME=internal/service/batch TESTARGS='-run=TestAccBatchComputeEnvironment_'
==> 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_createSpot
=== CONT  TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate
=== CONT  TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources
=== CONT  TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs
=== CONT  TestAccBatchComputeEnvironment_ec2Configuration
=== CONT  TestAccBatchComputeEnvironment_updateLaunchTemplate
=== CONT  TestAccBatchComputeEnvironment_ComputeResources_minVCPUs
=== CONT  TestAccBatchComputeEnvironment_namePrefix
=== CONT  TestAccBatchComputeEnvironment_updateServiceRole
=== CONT  TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags
=== CONT  TestAccBatchComputeEnvironment_updateState
=== CONT  TestAccBatchComputeEnvironment_launchTemplate
=== CONT  TestAccBatchComputeEnvironment_createEC2
=== CONT  TestAccBatchComputeEnvironment_createFargate
=== CONT  TestAccBatchComputeEnvironment_createEC2WithoutComputeResources
=== CONT  TestAccBatchComputeEnvironment_nameGenerated
=== CONT  TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole
=== CONT  TestAccBatchComputeEnvironment_createFargateSpot
=== CONT  TestAccBatchComputeEnvironment_defaultServiceRole
    acctest.go:730: skipping tests; missing IAM service-linked role /aws-service-role/batch. Please create the role and retry
--- SKIP: TestAccBatchComputeEnvironment_defaultServiceRole (2.41s)
=== CONT  TestAccBatchComputeEnvironment_tags
--- PASS: TestAccBatchComputeEnvironment_createEC2WithoutComputeResources (62.95s)
=== CONT  TestAccBatchComputeEnvironment_disappears
--- PASS: TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole (63.69s)
=== CONT  TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage
--- PASS: TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources (99.97s)
--- PASS: TestAccBatchComputeEnvironment_createFargateSpot (101.26s)
--- PASS: TestAccBatchComputeEnvironment_namePrefix (102.41s)
--- PASS: TestAccBatchComputeEnvironment_createFargate (104.14s)
--- PASS: TestAccBatchComputeEnvironment_basic (104.26s)
--- PASS: TestAccBatchComputeEnvironment_createEC2 (104.55s)
--- PASS: TestAccBatchComputeEnvironment_nameGenerated (108.63s)
--- PASS: TestAccBatchComputeEnvironment_ec2Configuration (110.35s)
--- PASS: TestAccBatchComputeEnvironment_launchTemplate (110.40s)
--- PASS: TestAccBatchComputeEnvironment_disappears (63.49s)
--- PASS: TestAccBatchComputeEnvironment_updateState (128.72s)
--- PASS: TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage (69.79s)
--- PASS: TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate (136.59s)
--- PASS: TestAccBatchComputeEnvironment_updateLaunchTemplate (138.44s)
--- PASS: TestAccBatchComputeEnvironment_updateServiceRole (147.28s)
--- PASS: TestAccBatchComputeEnvironment_tags (146.41s)
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs (160.21s)
--- PASS: TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_computeResourcesTags (195.81s)
--- PASS: TestAccBatchComputeEnvironment_ComputeResources_minVCPUs (263.71s)
--- PASS: TestAccBatchComputeEnvironment_createSpot (524.02s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/batch	532.319s

@ewbankkit
Copy link
Contributor

@ijin Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 8715cae into hashicorp:main Nov 3, 2021
@github-actions github-actions bot added this to the v3.64.0 milestone Nov 3, 2021
@ijin ijin deleted the f-aws_batch_compute_environment-ec2-configuration branch November 4, 2021 06:52
@ijin
Copy link
Contributor Author

ijin commented Nov 4, 2021

Yay! Thanks for the quick merge! 🙌

@github-actions
Copy link

github-actions bot commented Nov 4, 2021

This functionality has been released in v3.64.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 Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/batch Issues and PRs that pertain to the batch service. size/L 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.

Support for Ec2Configuration in AWS Batch Compute Environment
2 participants