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

f/aws_codepipeline add support for pipeline_type and variable #34841

Merged
merged 27 commits into from Jan 8, 2024

Conversation

neruneruo
Copy link

resource/aws_codepipeline: Add pipeline_type, variable attribute

Description

Add attributes: pipeline_type, variable

Relations

Closes #34122

References

Output from Acceptance Testing

An error occurred at TestAccCodePipeline_MultiRegion_convertSingleRegion.
But this error was originally occurring.
New test name is TestAccCodePipeline_pipelinetype.

% make testacc TESTS='TestAccCodePipeline_' PKG=codepipeline
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/codepipeline/... -v -count 1 -parallel 20 -run='TestAccCodePipeline_'  -timeout 360m
=== RUN   TestAccCodePipeline_basic
=== PAUSE TestAccCodePipeline_basic
=== RUN   TestAccCodePipeline_disappears
=== PAUSE TestAccCodePipeline_disappears
=== RUN   TestAccCodePipeline_emptyStageArtifacts
=== PAUSE TestAccCodePipeline_emptyStageArtifacts
=== RUN   TestAccCodePipeline_deployWithServiceRole
=== PAUSE TestAccCodePipeline_deployWithServiceRole
=== RUN   TestAccCodePipeline_tags
=== PAUSE TestAccCodePipeline_tags
=== RUN   TestAccCodePipeline_MultiRegion_basic
=== PAUSE TestAccCodePipeline_MultiRegion_basic
=== RUN   TestAccCodePipeline_MultiRegion_update
=== PAUSE TestAccCodePipeline_MultiRegion_update
=== RUN   TestAccCodePipeline_MultiRegion_convertSingleRegion
=== PAUSE TestAccCodePipeline_MultiRegion_convertSingleRegion
=== RUN   TestAccCodePipeline_withNamespace
=== PAUSE TestAccCodePipeline_withNamespace
=== RUN   TestAccCodePipeline_withGitHubV1SourceAction
    codepipeline_test.go:492: skipping test; environment variable GITHUB_TOKEN must be set. Usage: token with GitHub permissions to repository for CodePipeline source configuration
--- SKIP: TestAccCodePipeline_withGitHubV1SourceAction (0.00s)
=== RUN   TestAccCodePipeline_ecr
=== PAUSE TestAccCodePipeline_ecr
=== RUN   TestAccCodePipeline_pipelinetype
=== PAUSE TestAccCodePipeline_pipelinetype
=== CONT  TestAccCodePipeline_basic
=== CONT  TestAccCodePipeline_pipelinetype
=== CONT  TestAccCodePipeline_tags
=== CONT  TestAccCodePipeline_emptyStageArtifacts
=== CONT  TestAccCodePipeline_disappears
=== CONT  TestAccCodePipeline_MultiRegion_basic
=== CONT  TestAccCodePipeline_ecr
=== CONT  TestAccCodePipeline_withNamespace
=== CONT  TestAccCodePipeline_MultiRegion_convertSingleRegion
=== CONT  TestAccCodePipeline_MultiRegion_update
=== CONT  TestAccCodePipeline_deployWithServiceRole
--- PASS: TestAccCodePipeline_disappears (72.77s)
--- PASS: TestAccCodePipeline_withNamespace (73.97s)
--- PASS: TestAccCodePipeline_ecr (78.64s)
--- PASS: TestAccCodePipeline_deployWithServiceRole (83.56s)
--- PASS: TestAccCodePipeline_emptyStageArtifacts (94.11s)
--- PASS: TestAccCodePipeline_MultiRegion_basic (125.08s)
--- PASS: TestAccCodePipeline_basic (130.35s)
--- PASS: TestAccCodePipeline_tags (150.09s)
--- PASS: TestAccCodePipeline_pipelinetype (151.12s)
--- PASS: TestAccCodePipeline_MultiRegion_update (165.69s)
=== NAME  TestAccCodePipeline_MultiRegion_convertSingleRegion
    codepipeline_test.go:398: Step 3/4 error: Error running apply: exit status 1
        
        Error: region cannot be set for a single-region CodePipeline
        
          with aws_codepipeline.test,
          on terraform_plugin_test.tf line 75, in resource "aws_codepipeline" "test":
          75: resource "aws_codepipeline" "test" {
        
--- FAIL: TestAccCodePipeline_MultiRegion_convertSingleRegion (173.99s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline       174.120s
FAIL
make: *** [GNUmakefile:346: testacc] Error 1

resource/aws_codepipeline: Add pipeline_type, variable attribute
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/codepipeline Issues and PRs that pertain to the codepipeline service. labels Dec 10, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 10, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @neruneruo 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added 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 Dec 12, 2023
@jkstpierre
Copy link

Can we get a review of this PR? My team and I really want to start using V2 CodePipelines in Terraform.

@neruneruo
Copy link
Author

@jkstpierre

Thank you for your response!!

Is there anything I should do?

@romangoldberg
Copy link

Hello,
any updates here? WHen this is going to be merged?

@KaanErturk
Copy link
Contributor

Would be great to have this reviewed and merged.

I have a workaround with a local-exec provisioner for the time being but it's just adding noise to the plan diffs.

@ewbankkit ewbankkit self-assigned this Jan 8, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jan 8, 2024
Copy link

github-actions bot commented Jan 8, 2024

Thank you for your contribution! 🚀

Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccCodePipelineCustomActionType_' PKG=codepipeline
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/codepipeline/... -v -count 1 -parallel 20  -run=TestAccCodePipelineCustomActionType_ -timeout 360m
=== RUN   TestAccCodePipelineCustomActionType_basic
=== PAUSE TestAccCodePipelineCustomActionType_basic
=== RUN   TestAccCodePipelineCustomActionType_disappears
=== PAUSE TestAccCodePipelineCustomActionType_disappears
=== RUN   TestAccCodePipelineCustomActionType_tags
=== PAUSE TestAccCodePipelineCustomActionType_tags
=== RUN   TestAccCodePipelineCustomActionType_allAttributes
=== PAUSE TestAccCodePipelineCustomActionType_allAttributes
=== CONT  TestAccCodePipelineCustomActionType_basic
=== CONT  TestAccCodePipelineCustomActionType_tags
=== CONT  TestAccCodePipelineCustomActionType_disappears
=== CONT  TestAccCodePipelineCustomActionType_allAttributes
--- PASS: TestAccCodePipelineCustomActionType_disappears (23.59s)
--- PASS: TestAccCodePipelineCustomActionType_basic (27.22s)
--- PASS: TestAccCodePipelineCustomActionType_allAttributes (27.27s)
--- PASS: TestAccCodePipelineCustomActionType_tags (49.15s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline	54.595s
% make testacc TESTARGS='-run=TestAccCodePipeline_' PKG=codepipeline ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/codepipeline/... -v -count 1 -parallel 2  -run=TestAccCodePipeline_ -timeout 360m
=== RUN   TestAccCodePipeline_basic
=== PAUSE TestAccCodePipeline_basic
=== RUN   TestAccCodePipeline_disappears
=== PAUSE TestAccCodePipeline_disappears
=== RUN   TestAccCodePipeline_emptyStageArtifacts
=== PAUSE TestAccCodePipeline_emptyStageArtifacts
=== RUN   TestAccCodePipeline_deployWithServiceRole
=== PAUSE TestAccCodePipeline_deployWithServiceRole
=== RUN   TestAccCodePipeline_tags
=== PAUSE TestAccCodePipeline_tags
=== RUN   TestAccCodePipeline_MultiRegion_basic
=== PAUSE TestAccCodePipeline_MultiRegion_basic
=== RUN   TestAccCodePipeline_MultiRegion_update
=== PAUSE TestAccCodePipeline_MultiRegion_update
=== RUN   TestAccCodePipeline_MultiRegion_convertSingleRegion
=== PAUSE TestAccCodePipeline_MultiRegion_convertSingleRegion
=== RUN   TestAccCodePipeline_withNamespace
=== PAUSE TestAccCodePipeline_withNamespace
=== RUN   TestAccCodePipeline_withGitHubV1SourceAction
    acctest.go:2457: Environment variable GITHUB_TOKEN is not set, skipping test
--- SKIP: TestAccCodePipeline_withGitHubV1SourceAction (0.00s)
=== RUN   TestAccCodePipeline_ecr
=== PAUSE TestAccCodePipeline_ecr
=== RUN   TestAccCodePipeline_pipelinetype
=== PAUSE TestAccCodePipeline_pipelinetype
=== CONT  TestAccCodePipeline_basic
=== CONT  TestAccCodePipeline_MultiRegion_update
--- PASS: TestAccCodePipeline_basic (58.45s)
=== CONT  TestAccCodePipeline_withNamespace
--- PASS: TestAccCodePipeline_MultiRegion_update (61.47s)
=== CONT  TestAccCodePipeline_MultiRegion_convertSingleRegion
--- PASS: TestAccCodePipeline_withNamespace (28.64s)
=== CONT  TestAccCodePipeline_deployWithServiceRole
=== NAME  TestAccCodePipeline_MultiRegion_convertSingleRegion
    codepipeline_test.go:384: Step 3/4 error: Error running apply: exit status 1
        
        Error: region cannot be set for a single-region CodePipeline
        
          with aws_codepipeline.test,
          on terraform_plugin_test.tf line 75, in resource "aws_codepipeline" "test":
          75: resource "aws_codepipeline" "test" {
        
--- PASS: TestAccCodePipeline_deployWithServiceRole (33.52s)
=== CONT  TestAccCodePipeline_MultiRegion_basic
--- FAIL: TestAccCodePipeline_MultiRegion_convertSingleRegion (64.49s)
=== CONT  TestAccCodePipeline_tags
--- PASS: TestAccCodePipeline_MultiRegion_basic (38.01s)
=== CONT  TestAccCodePipeline_pipelinetype
--- PASS: TestAccCodePipeline_tags (68.50s)
=== CONT  TestAccCodePipeline_emptyStageArtifacts
--- PASS: TestAccCodePipeline_emptyStageArtifacts (30.48s)
=== CONT  TestAccCodePipeline_disappears
--- PASS: TestAccCodePipeline_pipelinetype (75.29s)
=== CONT  TestAccCodePipeline_ecr
--- PASS: TestAccCodePipeline_disappears (27.63s)
--- PASS: TestAccCodePipeline_ecr (29.92s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline	269.755s
FAIL
make: *** [testacc] Error 1

Failure is unrelated to this change (it's happening in CI).

% GITHUB_TOKEN=********  make testacc TESTARGS='-run=TestAccCodePipeline_withGitHubV1SourceAction' PKG=codepipeline
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/codepipeline/... -v -count 1 -parallel 20  -run=TestAccCodePipeline_withGitHubV1SourceAction -timeout 360m
=== RUN   TestAccCodePipeline_withGitHubV1SourceAction
=== PAUSE TestAccCodePipeline_withGitHubV1SourceAction
=== CONT  TestAccCodePipeline_withGitHubV1SourceAction
--- PASS: TestAccCodePipeline_withGitHubV1SourceAction (47.49s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline	52.900s
% GITHUB_TOKEN=******** make testacc TESTARGS='-run=TestAccCodePipelineWebhook_' PKG=codepipeline ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/codepipeline/... -v -count 1 -parallel 2  -run=TestAccCodePipelineWebhook_ -timeout 360m
=== RUN   TestAccCodePipelineWebhook_basic
--- PASS: TestAccCodePipelineWebhook_basic (57.83s)
=== RUN   TestAccCodePipelineWebhook_ipAuth
--- PASS: TestAccCodePipelineWebhook_ipAuth (31.33s)
=== RUN   TestAccCodePipelineWebhook_unauthenticated
--- PASS: TestAccCodePipelineWebhook_unauthenticated (27.11s)
=== RUN   TestAccCodePipelineWebhook_tags
--- PASS: TestAccCodePipelineWebhook_tags (57.87s)
=== RUN   TestAccCodePipelineWebhook_disappears
--- PASS: TestAccCodePipelineWebhook_disappears (25.73s)
=== RUN   TestAccCodePipelineWebhook_UpdateAuthentication_secretToken
--- PASS: TestAccCodePipelineWebhook_UpdateAuthentication_secretToken (41.24s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline	246.783s

@ewbankkit ewbankkit added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label Jan 8, 2024
@ewbankkit
Copy link
Contributor

@neruneruo Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 79dda88 into hashicorp:main Jan 8, 2024
50 checks passed
@github-actions github-actions bot added this to the v5.32.0 milestone Jan 8, 2024
@neruneruo
Copy link
Author

@ewbankkit
Thanks for your review and fix.

Copy link

This functionality has been released in v5.32.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. Thank you!

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2024
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. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/codepipeline Issues and PRs that pertain to the codepipeline service. size/XL Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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.

[Enhancement]: add support for codepipeline type(v1,v2)
6 participants