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

CodeBuild project resource does not detect updates to source.auth.resource #6129

Closed
camhux opened this issue Oct 11, 2018 · 2 comments
Closed
Labels
bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@camhux
Copy link

camhux commented Oct 11, 2018

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 "me too" comments, 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 Version

Terraform v0.11.8
+ provider.aws v1.40.0

Affected Resource(s)

  • aws_codebuild_project

Terraform Configuration Files

resource "aws_codebuild_project" "example" {
    name = "example"

    service_role = "${aws_iam_role.example.arn}"

    artifacts {
        type = "NO_ARTIFACTS"
    }

    environment {
        compute_type = "BUILD_GENERAL1_SMALL"
        image = "aws/codebuild/ubuntu-base:14.04"
        type = "LINUX_CONTAINER"
    }

    source {
        type = "GITHUB_ENTERPRISE"
        location = "https://phony.git.com/not-real/dummy.git"

        auth {
            type = "OAUTH"
            resource = "token-1"
        }
    }
}

resource "aws_iam_role" "example" {
    assume_role_policy = <<POLICY
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "codebuild.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
POLICY
}

then update to:

resource "aws_codebuild_project" "example" {
  // ...

  source {
  // ...

    auth {
      type = "OAUTH"
      resource = "token-2"
    }
  }
}

Expected Behavior

  • terraform plan should detect the change to aws_codebuild_project.example.source.auth.resource and output it as part of the plan.
  • terraform apply should update the value of aws_codebuild_project.example.source.auth.resource from token-1 to token-2.

Actual Behavior

  • terraform plan reports that infrastructure is up-to-date.
  • terraform apply runs without issue. Inspecting the state subsequently with terraform show reveals token-1 as the known value of the auth resource.

Important Factoids

  • The example uses source.type = "GITHUB_ENTERPRISE" to mirror the real-life situation in which I noticed this behavior. I don't know whether this is significant to the observed behavior.

Steps to Reproduce

  1. Copy the full config from above into a fresh directory, configure an aws provider, and init + apply.
  2. Make the described modification (or any modification to the source.auth.resource attribute).
  3. Run terraform plan. Observe no changes detected.

References

@bflad bflad added bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service. labels Oct 12, 2018
@github-actions
Copy link

github-actions bot commented Oct 1, 2020

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Oct 1, 2020
@ghost
Copy link

ghost commented Dec 1, 2020

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 Dec 1, 2020
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. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

2 participants