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

Changing CodeBuild project artifact path does not apply properly #755

Closed
hashibot opened this issue Jun 13, 2017 · 4 comments · Fixed by #9559
Closed

Changing CodeBuild project artifact path does not apply properly #755

hashibot opened this issue Jun 13, 2017 · 4 comments · Fixed by #9559
Labels
bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service.
Milestone

Comments

@hashibot
Copy link

This issue was originally opened by @focusaurus as hashicorp/terraform#14328. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.9.4

Affected Resource(s)

  • aws_codebuild_project

Terraform Configuration Files

resource "aws_codebuild_project" "redacted-server" {
  name         = "redacted-server"
  service_role = "${aws_iam_role.codebuild_role.arn}"

  artifacts {
    type           = "S3"
    location       = "${aws_s3_bucket.redacted.bucket}"
    name           = "redacted-server"
    path           = ""
    namespace_type = "NONE"
    packaging      = "NONE"
  }

  environment {
    compute_type = "BUILD_GENERAL1_SMALL"
    image        = "aws/codebuild/nodejs:6.3.1"
    type         = "LINUX_CONTAINER"

    environment_variable = {
      name  = "SNYK_TOKEN"
      value = "${var.snyk_token}"
    }
  }

  source {
    type     = "CODECOMMIT"
    location = "https://git-codecommit.us-west-2.amazonaws.com/v1/repos/redacted-server"
  }
}

Debug Output

I have encrypted output via keybase to the hashicorp user but it's 6MB so I'll wait for an explicit ask before figuring out how to transfer that to you.

Expected Behavior

  • Change an artifact attribute such as path in my terraform config, run terraform apply, the change should be made in AWS

Actual Behavior

  • terraform does not detect any change and does nothing

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. change aws_codebuild_project.example.artifacts.path in my .tf file
  2. run terraform apply
  3. Confirm the change is not applied with aws codebuild batch-get-projects --names redacted whose JSON output shows the old, unchanged value
@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@DonBower
Copy link

terraform also does not set the s3 bucket name:

  artifacts {
    type      = "S3"
    name      = "artifacts"
    location  = "my-s3-artifacts-bucket"
    packaging = "NONE"
  }

although the name param is set on initial terraform apply, subsequent runs of terraform apply after changing "name" do not update in AWS.
Witnessed in 0.9.8 and 0.9.11

@radeksimko radeksimko added the service/codebuild Issues and PRs that pertain to the codebuild service. label Jan 27, 2018
bflad added a commit that referenced this issue Jul 31, 2019
…List and verify updates

Reference: #755
Reference: #2050
Reference: #6214
Reference: #6427
Reference: #7582

Output from acceptance testing:

```
--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (58.62s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_NamespaceType (52.17s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName (51.88s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Packaging (51.20s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_Path (52.22s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (33.85s)
--- PASS: TestAccAWSCodeBuildProject_basic (24.98s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (42.62s)
--- PASS: TestAccAWSCodeBuildProject_Cache (70.42s)
--- PASS: TestAccAWSCodeBuildProject_Description (42.32s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (52.39s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (36.50s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (55.37s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (30.64s)
--- PASS: TestAccAWSCodeBuildProject_Environment_RegistryCredential (40.62s)
--- PASS: TestAccAWSCodeBuildProject_importBasic (34.69s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs (48.53s)
--- PASS: TestAccAWSCodeBuildProject_LogsConfig_S3Logs (72.76s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (37.23s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (29.35s)
--- PASS: TestAccAWSCodeBuildProject_Source_Auth (30.83s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (40.18s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (31.11s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (42.65s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (34.28s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (43.13s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (33.90s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (34.04s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (29.80s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (29.93s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (33.38s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSourceInvalid (12.23s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (36.44s)
--- PASS: TestAccAWSCodeBuildProject_Tags (43.37s)
--- PASS: TestAccAWSCodeBuildProject_VpcConfig (62.05s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (23.75s)
```
@bflad bflad added this to the v2.22.0 milestone Jul 31, 2019
@bflad
Copy link
Contributor

bflad commented Jul 31, 2019

The fixes for having the aws_codebuild_project resource artifacts configuration block perform better drift detection and updates have been merged and will release with version 2.22.0 of the Terraform AWS Provider, tomorrow. 👍

@ghost
Copy link

ghost commented Aug 1, 2019

This has been released in version 2.22.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 Nov 2, 2019

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 and limited conversation to collaborators Nov 2, 2019
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
4 participants