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

added local cache type and mode options #8215

Merged
merged 3 commits into from
May 23, 2019

Conversation

imightybigman
Copy link

@imightybigman imightybigman commented Apr 5, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #7643

Changes proposed in this pull request:

  • Add mode to cache in aws_codebuild_project

Output from acceptance testing:

 make testacc  TESTARGS='-run=TestAccAWSCodeBuildProject_Cache'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSCodeBuildProject_Cache -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSCodeBuildProject_Cache
=== PAUSE TestAccAWSCodeBuildProject_Cache
=== CONT  TestAccAWSCodeBuildProject_Cache
--- PASS: TestAccAWSCodeBuildProject_Cache (68.23s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	68.265s

@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/codebuild Issues and PRs that pertain to the codebuild service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 5, 2019
@imightybigman
Copy link
Author

imightybigman commented Apr 5, 2019

First time making an addition to Terraform if there are any obvious improvements, please let me know before I attempt the acceptance tests.

Will be running the acceptance tests later tonight

@imightybigman
Copy link
Author

Test updated

@AlmogCohen
Copy link

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

@jbienkowski311
Copy link
Contributor

@bflad any chance on getting it merged soon? It's a pretty cool feature

@jbienkowski311
Copy link
Contributor

@imightybigman the documentation part is missing in your PR. Please check the website directory in the repository and add missing value for CodeBuild cache type

@imightybigman
Copy link
Author

ah ok, no problem. I will do that tonight

@ghost ghost added size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. and removed size/S Managed by automation to categorize the size of a PR. labels Apr 18, 2019
@imightybigman
Copy link
Author

@jbienkowski311 the markdown has been updated

@smiller171
Copy link

Is there anything keeping this from being merged? Would really love to be able to enable docker caching in my Terraform.

@katieschilling
Copy link

Anything preventing a merge here? We'd love to have this feature. @azalenski-callpage

@amilstead
Copy link

I'll keep the heartbeat going. @azalenski-callpage is there anything left to do here?

@mikesigs
Copy link

Would also love to see this merged!

@bflad bflad self-assigned this May 23, 2019
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label May 23, 2019
@bflad bflad added this to the v2.12.0 milestone May 23, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this in, thanks @imightybigman 🚀

Output from acceptance testing (test failure unrelated):

--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSourceInvalid (14.74s)
--- FAIL: TestAccAWSCodeBuildProject_VpcConfig (29.03s)
    testing.go:568: Step 0 error: errors during apply:

        Error: Error creating CodeBuild project: InvalidInputException: CodeBuild currently doesn't support VPC in us-west-2d, please select subnets in other availability zones.
        	status code: 400, request id: dc670ce6-7d4f-11e9-be0b-7d89e7d51a68

          on /var/folders/v0/_d108fkx1pbbg4_sh864_7740000gn/T/tf-test724713333/main.tf line 80:
          (source code not available)

--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodePipeline (29.25s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise (29.39s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_Bitbucket (29.50s)
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (29.70s)
--- PASS: TestAccAWSCodeBuildProject_importBasic (29.78s)
--- PASS: TestAccAWSCodeBuildProject_SecondarySources_CodeCommit (29.88s)
--- PASS: TestAccAWSCodeBuildProject_Source_Auth (19.91s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_CodeCommit (36.13s)
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (36.64s)
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (36.70s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub (36.76s)
--- PASS: TestAccAWSCodeBuildProject_Tags (36.78s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_NoSource (36.78s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise (36.94s)
--- PASS: TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket (36.94s)
--- PASS: TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled (38.35s)
--- PASS: TestAccAWSCodeBuildProject_SecondaryArtifacts (38.45s)
--- PASS: TestAccAWSCodeBuildProject_Source_Type_S3 (41.82s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable (45.28s)
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (28.01s)
--- PASS: TestAccAWSCodeBuildProject_Description (27.72s)
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (29.81s)
--- PASS: TestAccAWSCodeBuildProject_basic (29.52s)
--- PASS: TestAccAWSCodeBuildProject_Environment_Certificate (31.46s)
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (36.10s)
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (48.81s)
--- PASS: TestAccAWSCodeBuildProject_Cache (59.86s)

}, false),
},
"location": {
Type: schema.TypeString,
Optional: true,
},
"modes": {
Type: schema.TypeList,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the API ordering of this attribute is not guaranteed when multiple modes are configured, we will likely need to change this to a TypeSet.

"modes": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One future enhancement that can be done here is supporting validation using the available AWS Go SDK constants:

Suggested change
Elem: &schema.Schema{Type: schema.TypeString},
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validation.StringInSlice([]string{
codebuild.CacheModeLocalDockerLayerCache,
codebuild.CacheModeLocalSourceCache,
codebuild.CacheModeLocalCustomCache,
},false),
},

@bflad bflad merged commit c935cf3 into hashicorp:master May 23, 2019
pull bot pushed a commit to KernelPanicAUS/terraform-provider-aws that referenced this pull request May 23, 2019
@bflad
Copy link
Contributor

bflad commented May 24, 2019

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.

@ghost
Copy link

ghost commented Mar 29, 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 Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/codebuild Issues and PRs that pertain to the codebuild service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add local cache, modes to aws_codebuild_project resource
9 participants