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

[WIP] Add import functionality to CodeBuild Project #4976

Merged
merged 4 commits into from
Jun 25, 2018

Conversation

ryof
Copy link
Contributor

@ryof ryof commented Jun 25, 2018

Though I couldn't find any issue about this, I made this PR because I'm using CodeBuild frequently.
I'm not familliar with Golang very well, so please point out if something is wrong.

Changes proposed in this pull request:

  • Add import functionality to CodeBuild Project

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAWSCodeBuildProject_importBasic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAWSCodeBuildProject_importBasic -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
q=== RUN   TestAWSCodeBuildProject_importBasic
--- PASS: TestAWSCodeBuildProject_importBasic (48.20s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       48.241s

@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Jun 25, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/codebuild Issues and PRs that pertain to the codebuild service. labels Jun 25, 2018
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.

Awesome @ryof! This should make a lot of people happy. Can you check out my feedback below and let me know if you have any questions?

@@ -23,6 +23,9 @@ func resourceAwsCodeBuildProject() *schema.Resource {
Read: resourceAwsCodeBuildProjectRead,
Update: resourceAwsCodeBuildProjectUpdate,
Delete: resourceAwsCodeBuildProjectDelete,
Importer: &schema.ResourceImporter{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please document the new import support at the bottom of website/docs/r/codebuild_project.html.markdown? Feel free to copy-paste an existing ## Import section from another resource and adjust appropriately.

ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing this was copy-paste from another resource's testing? 😄 The attributes force_destroy and acl do not exist for this resource, so the whole ImportStateVerifyIgnore bit can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I'm sorry. This is my first code-reading terraform, so I referenced s3 bucket or something...
There is no acl for code build indeed, I'm embarrassed. 😓

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jun 25, 2018
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Jun 25, 2018
@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Jun 25, 2018
@bflad bflad added this to the v1.25.0 milestone Jun 25, 2018
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.

Looks good to me! 🚀

=== RUN   TestAccAWSCodeBuildProject_basic
--- PASS: TestAccAWSCodeBuildProject_basic (22.82s)
=== RUN   TestAccAWSCodeBuildProject_BadgeEnabled
--- PASS: TestAccAWSCodeBuildProject_BadgeEnabled (30.52s)
=== RUN   TestAccAWSCodeBuildProject_BuildTimeout
--- PASS: TestAccAWSCodeBuildProject_BuildTimeout (30.79s)
=== RUN   TestAccAWSCodeBuildProject_Cache
--- PASS: TestAccAWSCodeBuildProject_Cache (67.92s)
=== RUN   TestAccAWSCodeBuildProject_Description
--- PASS: TestAccAWSCodeBuildProject_Description (37.87s)
=== RUN   TestAccAWSCodeBuildProject_EncryptionKey
--- PASS: TestAccAWSCodeBuildProject_EncryptionKey (50.14s)
=== RUN   TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type
--- PASS: TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type (39.68s)
=== RUN   TestAccAWSCodeBuildProject_Source_Auth
--- PASS: TestAccAWSCodeBuildProject_Source_Auth (30.38s)
=== RUN   TestAccAWSCodeBuildProject_Source_GitCloneDepth
--- PASS: TestAccAWSCodeBuildProject_Source_GitCloneDepth (29.30s)
=== RUN   TestAccAWSCodeBuildProject_Source_InsecureSSL
--- PASS: TestAccAWSCodeBuildProject_Source_InsecureSSL (38.32s)
=== RUN   TestAccAWSCodeBuildProject_Tags
--- PASS: TestAccAWSCodeBuildProject_Tags (29.65s)
=== RUN   TestAccAWSCodeBuildProject_VpcConfig
--- PASS: TestAccAWSCodeBuildProject_VpcConfig (55.43s)
=== RUN   TestAccAWSCodeBuildProject_WindowsContainer
--- PASS: TestAccAWSCodeBuildProject_WindowsContainer (30.66s)
=== RUN   TestAccAWSCodeBuildProject_importBasic
--- PASS: TestAccAWSCodeBuildProject_importBasic (23.29s)

@bflad bflad merged commit 720ca0e into hashicorp:master Jun 25, 2018
bflad added a commit that referenced this pull request Jun 25, 2018
@bflad
Copy link
Contributor

bflad commented Jun 27, 2018

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

@ghost
Copy link

ghost commented Apr 5, 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 5, 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. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants