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

rd/aws_codebuild_fleet: new resource and data source #39237

Merged
merged 19 commits into from
Sep 11, 2024

Conversation

kamilturek
Copy link
Collaborator

@kamilturek kamilturek commented Sep 9, 2024

Description

This PR introduces aws_codebuild_fleet resource and data source.

Relations

Closes #36010.
Extends #36790 (credits to @alexknez).

References

https://docs.aws.amazon.com/codebuild/latest/APIReference/API_CreateFleet.html

Output from Acceptance Testing

% make testacc PKG=codebuild ACCTEST_PARALLELISM=1 TESTARGS="-run=TestAccCodeBuildFleet_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/codebuild/... -v -count 1 -parallel 1  -run=TestAccCodeBuildFleet_ -timeout 360m
=== RUN   TestAccCodeBuildFleet_basic
=== PAUSE TestAccCodeBuildFleet_basic
=== RUN   TestAccCodeBuildFleet_disappears
=== PAUSE TestAccCodeBuildFleet_disappears
=== RUN   TestAccCodeBuildFleet_tags
=== PAUSE TestAccCodeBuildFleet_tags
=== RUN   TestAccCodeBuildFleet_baseCapacity
=== PAUSE TestAccCodeBuildFleet_baseCapacity
=== RUN   TestAccCodeBuildFleet_computeType
=== PAUSE TestAccCodeBuildFleet_computeType
=== RUN   TestAccCodeBuildFleet_environmentType
=== PAUSE TestAccCodeBuildFleet_environmentType
=== RUN   TestAccCodeBuildFleet_imageId
=== PAUSE TestAccCodeBuildFleet_imageId
=== RUN   TestAccCodeBuildFleet_scalingConfiguration
=== PAUSE TestAccCodeBuildFleet_scalingConfiguration
=== RUN   TestAccCodeBuildFleet_vpcConfig
=== PAUSE TestAccCodeBuildFleet_vpcConfig
=== CONT  TestAccCodeBuildFleet_basic
--- PASS: TestAccCodeBuildFleet_basic (42.82s)
=== CONT  TestAccCodeBuildFleet_environmentType
--- PASS: TestAccCodeBuildFleet_environmentType (77.17s)
=== CONT  TestAccCodeBuildFleet_vpcConfig
--- PASS: TestAccCodeBuildFleet_vpcConfig (151.76s)
=== CONT  TestAccCodeBuildFleet_scalingConfiguration
--- PASS: TestAccCodeBuildFleet_scalingConfiguration (77.59s)
=== CONT  TestAccCodeBuildFleet_imageId
--- PASS: TestAccCodeBuildFleet_imageId (42.10s)
=== CONT  TestAccCodeBuildFleet_baseCapacity
--- PASS: TestAccCodeBuildFleet_baseCapacity (77.39s)
=== CONT  TestAccCodeBuildFleet_computeType
--- PASS: TestAccCodeBuildFleet_computeType (77.45s)
=== CONT  TestAccCodeBuildFleet_tags
--- PASS: TestAccCodeBuildFleet_tags (114.51s)
=== CONT  TestAccCodeBuildFleet_disappears
--- PASS: TestAccCodeBuildFleet_disappears (40.25s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codebuild	705.701s
% make testacc PKG=codebuild ACCTEST_PARALLELISM=1 TESTARGS="-run=TestAccCodeBuildFleetDataSource_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/codebuild/... -v -count 1 -parallel 1  -run=TestAccCodeBuildFleetDataSource_ -timeout 360m
=== RUN   TestAccCodeBuildFleetDataSource_basic
=== PAUSE TestAccCodeBuildFleetDataSource_basic
=== CONT  TestAccCodeBuildFleetDataSource_basic
--- PASS: TestAccCodeBuildFleetDataSource_basic (40.65s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codebuild	45.359s

Copy link

github-actions bot commented Sep 9, 2024

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/codebuild Issues and PRs that pertain to the codebuild service. generators Relates to code generators. needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels Sep 9, 2024
Comment on lines 388 to 390
if err := waitFleetDeleted(ctx, conn, d.Id()); err != nil {
return create.AppendDiagError(diags, names.CodeBuild, create.ErrActionWaitingForDeletion, ResNameFleet, d.Id(), err)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fleets can stay in the "pending deletion" state even for a few hours. Not sure what would be the best way to handle such cases (e.g. allow optionally skipping the wait?).

Copy link
Contributor

Choose a reason for hiding this comment

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

Can fleets be "undeleted"? I not we may just want to treat "pending deletion" as deleted

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Apparently it cannot. When I try to perform any action on a fleet "pending deletion", I get the following error:

Fleet status is PENDING_DELETION_SUBMITTED. Cannot be updated.

Therefore, I'll remove the waiter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ewbankkit Done ✅

@kamilturek kamilturek marked this pull request as ready for review September 10, 2024 07:16
@kamilturek kamilturek requested a review from a team as a code owner September 10, 2024 07:16
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Sep 11, 2024
@ewbankkit ewbankkit added enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. new-data-source Introduces a new data source. labels Sep 11, 2024
@ewbankkit ewbankkit self-assigned this Sep 11, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 11, 2024
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=TestAccCodeBuildFleet_' PKG=codebuild ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/codebuild/... -v -count 1 -parallel 3  -run=TestAccCodeBuildFleet_ -timeout 360m
=== RUN   TestAccCodeBuildFleet_basic
=== PAUSE TestAccCodeBuildFleet_basic
=== RUN   TestAccCodeBuildFleet_disappears
=== PAUSE TestAccCodeBuildFleet_disappears
=== RUN   TestAccCodeBuildFleet_tags
=== PAUSE TestAccCodeBuildFleet_tags
=== RUN   TestAccCodeBuildFleet_baseCapacity
=== PAUSE TestAccCodeBuildFleet_baseCapacity
=== RUN   TestAccCodeBuildFleet_computeType
=== PAUSE TestAccCodeBuildFleet_computeType
=== RUN   TestAccCodeBuildFleet_environmentType
=== PAUSE TestAccCodeBuildFleet_environmentType
=== RUN   TestAccCodeBuildFleet_imageId
=== PAUSE TestAccCodeBuildFleet_imageId
=== RUN   TestAccCodeBuildFleet_scalingConfiguration
=== PAUSE TestAccCodeBuildFleet_scalingConfiguration
=== RUN   TestAccCodeBuildFleet_vpcConfig
=== PAUSE TestAccCodeBuildFleet_vpcConfig
=== CONT  TestAccCodeBuildFleet_basic
=== CONT  TestAccCodeBuildFleet_environmentType
=== CONT  TestAccCodeBuildFleet_baseCapacity
--- PASS: TestAccCodeBuildFleet_basic (44.74s)
=== CONT  TestAccCodeBuildFleet_tags
--- PASS: TestAccCodeBuildFleet_baseCapacity (65.94s)
=== CONT  TestAccCodeBuildFleet_scalingConfiguration
--- PASS: TestAccCodeBuildFleet_environmentType (66.53s)
=== CONT  TestAccCodeBuildFleet_vpcConfig
--- PASS: TestAccCodeBuildFleet_scalingConfiguration (64.53s)
=== CONT  TestAccCodeBuildFleet_imageId
--- PASS: TestAccCodeBuildFleet_tags (87.98s)
=== CONT  TestAccCodeBuildFleet_disappears
--- PASS: TestAccCodeBuildFleet_imageId (43.81s)
=== CONT  TestAccCodeBuildFleet_computeType
--- PASS: TestAccCodeBuildFleet_disappears (57.04s)
--- PASS: TestAccCodeBuildFleet_computeType (65.17s)
--- PASS: TestAccCodeBuildFleet_vpcConfig (229.07s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codebuild	300.692s
% make testacc TESTARGS='-run=TestAccCodeBuildFleetDataSource_' PKG=codebuild ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/codebuild/... -v -count 1 -parallel 3  -run=TestAccCodeBuildFleetDataSource_ -timeout 360m
=== RUN   TestAccCodeBuildFleetDataSource_basic
=== PAUSE TestAccCodeBuildFleetDataSource_basic
=== CONT  TestAccCodeBuildFleetDataSource_basic
--- PASS: TestAccCodeBuildFleetDataSource_basic (42.14s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codebuild	46.938s
% make testacc TESTARGS='-run=TestAccCodeBuildProject_fleet\|TestAccCodeBuildProject_basic' PKG=codebuild
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/codebuild/... -v -count 1 -parallel 20  -run=TestAccCodeBuildProject_fleet\|TestAccCodeBuildProject_basic -timeout 360m
=== RUN   TestAccCodeBuildProject_basic
=== PAUSE TestAccCodeBuildProject_basic
=== RUN   TestAccCodeBuildProject_fleet
=== PAUSE TestAccCodeBuildProject_fleet
=== CONT  TestAccCodeBuildProject_basic
=== CONT  TestAccCodeBuildProject_fleet
--- PASS: TestAccCodeBuildProject_basic (21.92s)
--- PASS: TestAccCodeBuildProject_fleet (42.70s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codebuild	47.531s

@ewbankkit
Copy link
Contributor

@kamilturek Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 5412408 into hashicorp:main Sep 11, 2024
40 checks passed
@github-actions github-actions bot added this to the v5.67.0 milestone Sep 11, 2024
Copy link

This functionality has been released in v5.67.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 13, 2024
@kamilturek kamilturek deleted the f-aws-codebuild-fleet branch September 14, 2024 17:06
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 Oct 16, 2024
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. enhancement Requests to existing resources that expand the functionality or scope. external-maintainer Contribution from a trusted external contributor. generators Relates to code generators. new-data-source Introduces a new data source. new-resource Introduces a new resource. service/codebuild Issues and PRs that pertain to the codebuild service. 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.

[New Resource]: CodeBuild Fleet
3 participants