Skip to content

[Enhancement] aws_codepipeline: support for Compute action #42507

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tabito-hara
Copy link
Contributor

@tabito-hara tabito-hara commented May 7, 2025

Description

  • Add several arguments to the action block to support the Compute action:

    • commands

    • output_variables

    • output_artifacts_for_compute_action

      • This argument does not directly correspond to the AWS API objects.
      • In the AWS API, OutputArtifacts is an object with two attributes. However, in Terraform, the existing output_artifacts is implemented as a list of artifact names.
      • The Compute action uses the files attribute in OutputArtifacts, which cannot be represented using the current output_artifacts.
      • To avoid affecting existing configurations, a new argument, output_artifacts_for_compute_action, has been introduced. Its schema matches that of the OutputArtifacts object in the AWS API.
      • When the action is Compute, output_artifacts_for_compute_action is used and output_artifacts is ignored.
      • For all other actions, the reverse applies.
  • This PR is based on f/aws_codepipeline add 'commands' attribute to support 'Compute' action category #41034, rebased onto the latest main branch, and adds the output_variables and output_artifacts_for_compute_action arguments.

Relations

Closes #39743
Relates #41034

References

https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ActionDeclaration.html#CodePipeline-Type-ActionDeclaration-commands
https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-Commands.html

Output from Acceptance Testing

$ make testacc TESTS=TestAccCodePipeline_ PKG=codepipeline
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.8 test ./internal/service/codepipeline/... -v -count 1 -parallel 10 -run='TestAccCodePipeline_'  -timeout 360m -vet=off
2025/05/07 09:18:36 Initializing Terraform AWS Provider...
=== 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: 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
=== RUN   TestAccCodePipeline_manualApprovalTimeoutInMinutes
=== PAUSE TestAccCodePipeline_manualApprovalTimeoutInMinutes
=== RUN   TestAccCodePipeline_conditions
=== PAUSE TestAccCodePipeline_conditions
=== RUN   TestAccCodePipeline_computeAction
=== PAUSE TestAccCodePipeline_computeAction
=== RUN   TestAccCodePipeline_trigger
=== PAUSE TestAccCodePipeline_trigger
=== CONT  TestAccCodePipeline_basic
=== CONT  TestAccCodePipeline_withNamespace
=== CONT  TestAccCodePipeline_conditions
=== CONT  TestAccCodePipeline_pipelineType
=== CONT  TestAccCodePipeline_manualApprovalTimeoutInMinutes
=== CONT  TestAccCodePipeline_ecr
=== CONT  TestAccCodePipeline_MultiRegion_update
=== CONT  TestAccCodePipeline_MultiRegion_convertSingleRegion
=== CONT  TestAccCodePipeline_emptyStageArtifacts
=== CONT  TestAccCodePipeline_deployWithServiceRole
--- PASS: TestAccCodePipeline_ecr (39.92s)
=== CONT  TestAccCodePipeline_trigger
--- PASS: TestAccCodePipeline_emptyStageArtifacts (46.31s)
=== CONT  TestAccCodePipeline_MultiRegion_basic
--- PASS: TestAccCodePipeline_deployWithServiceRole (48.27s)
=== CONT  TestAccCodePipeline_disappears
--- PASS: TestAccCodePipeline_withNamespace (50.36s)
=== CONT  TestAccCodePipeline_computeAction
--- PASS: TestAccCodePipeline_manualApprovalTimeoutInMinutes (63.30s)
=== CONT  TestAccCodePipeline_tags
--- PASS: TestAccCodePipeline_conditions (73.43s)
--- PASS: TestAccCodePipeline_basic (76.05s)
--- PASS: TestAccCodePipeline_MultiRegion_update (76.57s)
--- PASS: TestAccCodePipeline_disappears (34.64s)
--- PASS: TestAccCodePipeline_computeAction (33.93s)
--- PASS: TestAccCodePipeline_MultiRegion_basic (45.12s)
--- PASS: TestAccCodePipeline_trigger (54.52s)
--- PASS: TestAccCodePipeline_MultiRegion_convertSingleRegion (106.99s)
--- PASS: TestAccCodePipeline_tags (71.31s)
--- PASS: TestAccCodePipeline_pipelineType (140.02s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline       144.614s

Copy link

github-actions bot commented May 7, 2025

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Copy link

github-actions bot commented May 7, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. 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. sweeper Pertains to changes to or issues with the sweeper. size/XL Managed by automation to categorize the size of a PR. labels May 7, 2025
@tabito-hara tabito-hara marked this pull request as ready for review May 7, 2025 00:55
@tabito-hara tabito-hara requested a review from a team as a code owner May 7, 2025 00:55
@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 May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. 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. sweeper Pertains to changes to or issues with the sweeper. 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]: CodePipeline Compute/Commands action support
3 participants