Terraform-provider-aws: Add local cache, `modes` to `aws_codebuild_project` resource

Created on 21 Feb 2019  ·  13Comments  ·  Source: hashicorp/terraform-provider-aws

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

Description

AWS CodeBuild just recently published support for "local" caching on code build projects: https://aws.amazon.com/blogs/devops/improve-build-performance-and-save-time-using-local-caching-in-aws-codebuild/

The new "mode" attribute is documented here: https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectCache.html#CodeBuild-Type-ProjectCache-modes

Please update the terraform resource to reflect these new features.

New or Affected Resource(s)

  • aws_codebuild_project

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.
resource "aws_codebuild_project" "example" {
  name          = "test-project"
  description   = "test_codebuild_project"
  build_timeout = "5"
  service_role  = "${aws_iam_role.example.arn}"

  artifacts {
    type = "NO_ARTIFACTS"
  }

  cache {
    type = "LOCAL"
    mode = "LOCAL_DOCKER_LAYER_CACHE"
  }
  ...
}
enhancement serviccodebuild

Most helpful comment

Support for local cache has been merged and will release with version 2.12.0 of the Terraform AWS Provider, likely later today. Thanks to @imightybigman for the enhancement.

All 13 comments

Hey @bflad , it seems that AWS SDK is already at 1.18.5, so I'm assuming that we can start working on this.

I can try to put something together if no-one is already working on this.

@marcoreni please feel free 😄

Hey @marcoreni Did you get a chance to take a look at this? If not I might take a stab at it

Any movement on this one?

https://github.com/terraform-providers/terraform-provider-aws/pull/8215

First time contributing, if there's any obvious issue please let me know before I attempt the acceptance tests.

Test updated in that PR

Any update on this ?

That's such an important feature on AWS CodeBuild to make the build way quicker for docker...eager to see it integrated

If anyone is blocked until the #8215 is merged and would like to use local cache but not have Terraform try to revert it, add the following to the CodeBuild project resource:

  lifecycle {
    ignore_changes = ["cache"]
  }

Support for local cache has been merged and will release with version 2.12.0 of the Terraform AWS Provider, likely later today. Thanks to @imightybigman for the enhancement.

This has been released in version 2.12.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

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!

Was this page helpful?
0 / 5 - 0 ratings