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

Feature Request: Caching for AWS CodeBuild projects #2842

Closed
hashibot opened this issue Jan 3, 2018 · 3 comments
Closed

Feature Request: Caching for AWS CodeBuild projects #2842

hashibot opened this issue Jan 3, 2018 · 3 comments
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

@hashibot
Copy link

hashibot commented Jan 3, 2018

This issue was originally opened by @kaofelix as hashicorp/terraform#17019. It was migrated here as a result of the provider split. The original body of the issue is below.


AWS CodeBuild projects support caching of dependencies for a build. This allows a user to specify an S3 bucket and a path within that bucket that will be used as cache storage for paths specified in a section of the buildspec YAML file.

I've seen this introduced in this blog post, where it is shown how to configure a CodeBuild project with caching from the AWS dashboard. The example use case is about Maven dependencies, which is close to my team's use case, albeit for Gradle instead. Using caching would help speed up our build significantly and since we are using terraform to manage our pipeline, it would be great to be able to do it from there.

Expected Behavior

It would be helpful if theaws_codebuild_project resource supported cache configuration. Maybe something along the lines of:

resource "aws_codebuild_project" "foobar" {
  [...]

  cache {
    # s3 is the only option at the moment other than no cache at all, 
    # but there's a dropdown for it, so it might expand
    type = "s3" 
    location = "some-bucket"
    path_prefix = "/some/path"
  }

  [...]
}

Factoids

From the dashboard, it seems that it's only possible to add cache from a newly created project, but not adding it to an existing one when editing. However, boto3 seems to support configuring cache when calling update_project in an existing project, so I guess it should be possible programatically somehow. I'm not familiar with how this is implemented in Terraform as I didn't have time to look at the source yet.

@hashibot hashibot added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 3, 2018
@kaofelix
Copy link
Contributor

kaofelix commented Jan 4, 2018

I decided to give it a try and managed to code the feature in. I submitted a PR (#2860) for that.

@radeksimko radeksimko added the service/codebuild Issues and PRs that pertain to the codebuild service. label Jan 28, 2018
@bflad bflad added this to the v1.14.0 milestone Apr 6, 2018
@bflad
Copy link
Contributor

bflad commented Apr 6, 2018

This support has been merged into master via #2860 and will release with v1.14.0 of the AWS provider, likely later today. 🎉

@bflad bflad closed this as completed Apr 6, 2018
@ghost
Copy link

ghost commented Apr 6, 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 and limited conversation to collaborators Apr 6, 2020
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
Development

No branches or pull requests

4 participants