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

aws_codebuild_report_group needs time to delete previously generated reports, fails terraform apply #17290

Closed
jessefarinacci opened this issue Jan 26, 2021 · 4 comments · Fixed by #17338
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/codebuild Issues and PRs that pertain to the codebuild service.
Milestone

Comments

@jessefarinacci
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Affected Resource(s)

  • aws_codebuild_report_group

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

data "aws_kms_alias" "s3" {
  name = "alias/aws/s3"
}

resource "aws_codebuild_report_group" "tests" {
  name  = "myreport-tests"
  type  = "TEST"

  export_config {
    type = "S3"

    s3_destination {
      bucket              = "my-bucket-name"
      encryption_disabled = false
      encryption_key      = data.aws_kms_alias.s3.arn
      packaging           = "NONE"
      path                = "/reports"
    }
  }
}

Debug Output

Error: error deleting CodeBuild Report Groups(arn:aws:codebuild:xxx:yyy:report-group/zzz):
InvalidInputException: Report group could only be deleted after its reports are deleted

Panic Output

N/A

Expected Behavior

Terraform should poll/wait for reports to be deleted and the report group to be deleted before moving forward in the lifecycle.

Actual Behavior

Terraform fails to delete the report group immediately because existing reports are still being deleted, and then the terraform apply fails.. if I wait a minute for AWS to clean up the reports/report-group then re-run the apply, it succeeds.

Steps to Reproduce

  1. terraform apply
  2. create some reports via codebuild
  3. make a change to the report-group.tf, e.g. name change tests -> tests2
  4. terraform apply
  5. tf will see recreate required, but fail

Important Factoids

N/A

References

N/A

@ghost ghost added service/codebuild Issues and PRs that pertain to the codebuild service. service/kms Issues and PRs that pertain to the kms service. labels Jan 26, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 26, 2021
@DrFaust92 DrFaust92 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. service/kms Issues and PRs that pertain to the kms service. labels Jan 28, 2021
@bflad
Copy link
Contributor

bflad commented Jan 28, 2021

@DrFaust92 heads up that I'm relabeling this as an enhancement to support for the DeleteReports parameter for the DeleteReportGroup API operation -- the Terraform resource is currently doing the correct (safer) operation of not deleting practitioner data without consent.

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed bug Addresses a defect in current functionality. labels Jan 28, 2021
@bflad bflad self-assigned this Feb 11, 2021
@github-actions github-actions bot added this to the v3.28.0 milestone Feb 11, 2021
@bflad
Copy link
Contributor

bflad commented Feb 11, 2021

Support for a delete_reports argument in the aws_codebuild_report_group resource has been merged and will release with version 3.28.0 of the Terraform AWS Provider, later today. Thank you to @DrFaust92 for the implementation. 👍

@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.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 for triage. Thanks!

@ghost
Copy link

ghost commented Mar 14, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/codebuild Issues and PRs that pertain to the codebuild service.
Projects
None yet
3 participants