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

Refactor CodePipeline pipeline and webhook resources to use keyvaluetags package and fix webhook resource recreation issues #11387

Merged
merged 5 commits into from
Jan 11, 2020

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Dec 20, 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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #8017.
Relates #10688.

Release note for CHANGELOG:

resource/aws_codepipeline_webhook: Don't recreate the resource if `tags` change
resource/aws_codepipeline_webhook: Do recreate the resource if `authentication_configuration` configuration block values (`allowed_ip_range` or `secret_token`) change

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSCodePipeline_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 1 -run=TestAccAWSCodePipeline_ -timeout 120m
=== RUN   TestAccAWSCodePipeline_basic
=== PAUSE TestAccAWSCodePipeline_basic
=== RUN   TestAccAWSCodePipeline_emptyArtifacts
=== PAUSE TestAccAWSCodePipeline_emptyArtifacts
=== RUN   TestAccAWSCodePipeline_deployWithServiceRole
=== PAUSE TestAccAWSCodePipeline_deployWithServiceRole
=== RUN   TestAccAWSCodePipeline_tags
=== PAUSE TestAccAWSCodePipeline_tags
=== CONT  TestAccAWSCodePipeline_basic
--- PASS: TestAccAWSCodePipeline_basic (81.67s)
=== CONT  TestAccAWSCodePipeline_tags
--- PASS: TestAccAWSCodePipeline_tags (115.91s)
=== CONT  TestAccAWSCodePipeline_deployWithServiceRole
--- PASS: TestAccAWSCodePipeline_deployWithServiceRole (61.23s)
=== CONT  TestAccAWSCodePipeline_emptyArtifacts
--- PASS: TestAccAWSCodePipeline_emptyArtifacts (52.73s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	311.618s
$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSCodePipelineWebhook_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCodePipelineWebhook_ -timeout 120m
=== RUN   TestAccAWSCodePipelineWebhook_basic
--- PASS: TestAccAWSCodePipelineWebhook_basic (48.44s)
=== RUN   TestAccAWSCodePipelineWebhook_ipAuth
--- PASS: TestAccAWSCodePipelineWebhook_ipAuth (45.87s)
=== RUN   TestAccAWSCodePipelineWebhook_unauthenticated
--- PASS: TestAccAWSCodePipelineWebhook_unauthenticated (45.50s)
=== RUN   TestAccAWSCodePipelineWebhook_tags
--- PASS: TestAccAWSCodePipelineWebhook_tags (98.33s)
=== RUN   TestAccAWSCodePipelineWebhook_UpdateAuthenticationConfiguration_SecretToken
--- PASS: TestAccAWSCodePipelineWebhook_UpdateAuthenticationConfiguration_SecretToken (69.85s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	308.024s

@ewbankkit ewbankkit requested a review from a team December 20, 2019 15:47
@ghost ghost added needs-triage Waiting for first response or review from a maintainer. size/XL Managed by automation to categorize the size of a PR. service/codepipeline Issues and PRs that pertain to the codepipeline service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 20, 2019
@ewbankkit
Copy link
Contributor Author

ewbankkit commented Dec 20, 2019

#### TODO

@ewbankkit ewbankkit changed the title Refactor CodePipeline pipeline and webhook resources to use keyvaluetags package [WIP] Refactor CodePipeline pipeline and webhook resources to use keyvaluetags package Dec 20, 2019
@ewbankkit ewbankkit changed the title [WIP] Refactor CodePipeline pipeline and webhook resources to use keyvaluetags package Refactor CodePipeline pipeline and webhook resources to use keyvaluetags package and fix webhook resource recreation issues Dec 20, 2019
"tags": {
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to recreate resource when tags change.

@@ -43,11 +44,13 @@ func resourceAwsCodePipelineWebhook() *schema.Resource {
"secret_token": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recreate resource when secret_token changes.

Sensitive: true,
},
"allowed_ip_range": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recreate resource when allowed_ip_range changes.

@ewbankkit
Copy link
Contributor Author

Removed WIP.
Ready for review.

@bflad bflad added bug Addresses a defect in current functionality. enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 11, 2020
@bflad bflad added this to the v2.45.0 milestone Jan 11, 2020
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 great, thanks for these updates, @ewbankkit 🚀

Output from acceptance testing:

--- PASS: TestAccAWSCodePipeline_emptyArtifacts (23.53s)
--- PASS: TestAccAWSCodePipeline_deployWithServiceRole (25.98s)
--- PASS: TestAccAWSCodePipelineWebhook_ipAuth (29.60s)
--- PASS: TestAccAWSCodePipelineWebhook_unauthenticated (32.22s)
--- PASS: TestAccAWSCodePipelineWebhook_UpdateAuthenticationConfiguration_SecretToken (38.70s)
--- PASS: TestAccAWSCodePipeline_tags (43.93s)
--- PASS: TestAccAWSCodePipeline_basic (49.31s)
--- PASS: TestAccAWSCodePipelineWebhook_basic (49.84s)
--- PASS: TestAccAWSCodePipelineWebhook_tags (56.36s)

@bflad bflad merged commit 9a152ac into hashicorp:master Jan 11, 2020
bflad added a commit that referenced this pull request Jan 11, 2020
@ewbankkit ewbankkit deleted the codepipeline-keyvaluetags branch January 11, 2020 11:54
@ghost
Copy link

ghost commented Jan 17, 2020

This has been released in version 2.45.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 Mar 27, 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 27, 2020
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. enhancement Requests to existing resources that expand the functionality or scope. service/codepipeline Issues and PRs that pertain to the codepipeline service. size/XL 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.

aws_codepipeline_webhook doesn't support update
2 participants