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

[Bug]: build_batch_config cannot be removed from aws_codebuild_project #29261

Closed
sff0219 opened this issue Feb 6, 2023 · 5 comments · Fixed by #34121
Closed

[Bug]: build_batch_config cannot be removed from aws_codebuild_project #29261

sff0219 opened this issue Feb 6, 2023 · 5 comments · Fixed by #34121
Labels
bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service.
Milestone

Comments

@sff0219
Copy link

sff0219 commented Feb 6, 2023

Terraform Core Version

1.3.7

AWS Provider Version

4.53.0

Affected Resource(s)

  • aws_codebuild_project

Expected Behavior

We have a CodeBuild project with batch builds configuration. When updating the CodeBuild project by removing the batch builds configuration build_batch_config from aws_codebuild_project, during terraform apply terraform says:

Terraform will perform the following actions:

  # module.code_build[0].aws_codebuild_project.xxxx_cb will be updated in-place
  ~ resource "aws_codebuild_project" "xxxx_cb" {
        id                     = "arn:aws:codebuild:eu-central-1:xxxxxxxxxxx:project/xxxxxxxxxxx-codebuild"
        name                   = "xxxxxxxxxxx-codebuild"
        tags                   = {
            "Environment" = "Build"
        }
        # (10 unchanged attributes hidden)

      - build_batch_config {
          - combine_artifacts = false -> null
          - service_role      = "arn:aws:iam::xxxxxxxxxxx:role/codebuild-role-xxxxxxxxxxxxxxx" -> null
          - timeout_in_mins   = 480 -> null

          - restrictions {
              - compute_types_allowed  = [] -> null
              - maximum_builds_allowed = 100 -> null
            }
        }

        # (8 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.code_build[0].aws_codebuild_project.xxxx_cb: Modifying... [id=arn:aws:codebuild:eu-central-1:xxxxxxxx:project/xxxxxxxxxxx-codebuild]
module.code_build[0].aws_codebuild_project.xxxx_cb: Modifications complete after 1s [id=arn:aws:codebuild:eu-central-1:xxxxxxxxxxxxxxxxx:project/xxxxxxxxxxx-codebuild]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

It is expected that there is no batch configuration anymore in this CodeBuild project.

Actual Behavior

The batch builds configuration still exists in this CodeBuild project. It is not updated.
If do terraform apply again, the same output of updating aws_codebuild_project the will be given again.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_codebuild_project" "xxxx_cb" {
  ...

  build_batch_config {
    service_role = aws_iam_role.xxxx_cb_role.arn
  }
}

Steps to Reproduce

  1. Create a CodeBuild project with the batch builds (build_batch_config)
  2. Delete the build_batch_config block in the .tf file and do terraform apply
  3. Check the CodeBuild project configuration, and you will see the batch builds configuration is still there

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@sff0219 sff0219 added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Feb 6, 2023
@github-actions github-actions bot added the service/codebuild Issues and PRs that pertain to the codebuild service. label Feb 6, 2023
@github-actions
Copy link

github-actions bot commented Feb 6, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Feb 6, 2023
@digglife
Copy link
Contributor

It's more like an AWS issue because you can't even remove the batch config settings from AWS console or CLI.

digglife added a commit to digglife/terraform-provider-aws that referenced this issue Oct 26, 2023
digglife added a commit to digglife/terraform-provider-aws that referenced this issue Oct 26, 2023
@digglife
Copy link
Contributor

I raised a PR(#34121) for fixing this issue.

@github-actions github-actions bot added this to the v5.34.0 milestone Jan 23, 2024
Copy link

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

Copy link

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 have found a problem that seems similar to this, 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 Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants