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

r/aws_imagebuilder_pipeline: add support for workflows #37317

Merged

Conversation

kamilturek
Copy link
Collaborator

Description

This PR adds support for Image Builder workflows to Image Builder pipelines. Similar to #36953.

Relations

Closes #35045.

References

https://aws.amazon.com/about-aws/whats-new/2023/12/ec2-image-builder-image-workflows/
https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_CreateImagePipeline.html
https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_UpdateImagePipeline.html

Output from Acceptance Testing

% make testacc TESTARGS="-run=TestAccImageBuilderImagePipeline_workflow" PKG=imagebuilder
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/imagebuilder/... -v -count 1 -parallel 20  -run=TestAccImageBuilderImagePipeline_workflow -timeout 360m
=== RUN   TestAccImageBuilderImagePipeline_workflow
=== PAUSE TestAccImageBuilderImagePipeline_workflow
=== RUN   TestAccImageBuilderImagePipeline_workflowParameter
=== PAUSE TestAccImageBuilderImagePipeline_workflowParameter
=== CONT  TestAccImageBuilderImagePipeline_workflow
=== CONT  TestAccImageBuilderImagePipeline_workflowParameter
--- PASS: TestAccImageBuilderImagePipeline_workflow (43.19s)
--- PASS: TestAccImageBuilderImagePipeline_workflowParameter (43.69s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder       48.232s

Copy link

github-actions bot commented May 7, 2024

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/L 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/imagebuilder Issues and PRs that pertain to the imagebuilder service. labels May 7, 2024
@terraform-aws-provider terraform-aws-provider bot added needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels May 7, 2024
@kamilturek kamilturek marked this pull request as ready for review May 7, 2024 08:26
@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, 2024
@sophiecosgrove
Copy link

Are there any updates on this?

@kamilturek kamilturek force-pushed the f-aws-imagebuilder-pipeline-workflow branch from 51fb500 to 68027c9 Compare July 11, 2024 20:48
@kamilturek kamilturek requested a review from a team as a code owner July 11, 2024 20:48
@ewbankkit ewbankkit self-assigned this Jul 12, 2024
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=TestAccImageBuilderImagePipeline_' PKG=imagebuilder ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/imagebuilder/... -v -count 1 -parallel 3  -run=TestAccImageBuilderImagePipeline_ -timeout 360m
=== RUN   TestAccImageBuilderImagePipeline_basic
=== PAUSE TestAccImageBuilderImagePipeline_basic
=== RUN   TestAccImageBuilderImagePipeline_disappears
=== PAUSE TestAccImageBuilderImagePipeline_disappears
=== RUN   TestAccImageBuilderImagePipeline_description
=== PAUSE TestAccImageBuilderImagePipeline_description
=== RUN   TestAccImageBuilderImagePipeline_distributionARN
=== PAUSE TestAccImageBuilderImagePipeline_distributionARN
=== RUN   TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled
=== PAUSE TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled
=== RUN   TestAccImageBuilderImagePipeline_imageRecipeARN
=== PAUSE TestAccImageBuilderImagePipeline_imageRecipeARN
=== RUN   TestAccImageBuilderImagePipeline_containerRecipeARN
=== PAUSE TestAccImageBuilderImagePipeline_containerRecipeARN
=== RUN   TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
=== PAUSE TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
=== RUN   TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
=== PAUSE TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
=== RUN   TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled
=== PAUSE TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled
=== RUN   TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes
=== PAUSE TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes
=== RUN   TestAccImageBuilderImagePipeline_infrastructureARN
=== PAUSE TestAccImageBuilderImagePipeline_infrastructureARN
=== RUN   TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition
=== PAUSE TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition
=== RUN   TestAccImageBuilderImagePipeline_Schedule_scheduleExpression
=== PAUSE TestAccImageBuilderImagePipeline_Schedule_scheduleExpression
=== RUN   TestAccImageBuilderImagePipeline_Schedule_timezone
=== PAUSE TestAccImageBuilderImagePipeline_Schedule_timezone
=== RUN   TestAccImageBuilderImagePipeline_status
=== PAUSE TestAccImageBuilderImagePipeline_status
=== RUN   TestAccImageBuilderImagePipeline_tags
=== PAUSE TestAccImageBuilderImagePipeline_tags
=== RUN   TestAccImageBuilderImagePipeline_workflow
=== PAUSE TestAccImageBuilderImagePipeline_workflow
=== RUN   TestAccImageBuilderImagePipeline_workflowParameter
=== PAUSE TestAccImageBuilderImagePipeline_workflowParameter
=== CONT  TestAccImageBuilderImagePipeline_basic
=== CONT  TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes
=== CONT  TestAccImageBuilderImagePipeline_workflowParameter
--- PASS: TestAccImageBuilderImagePipeline_basic (25.01s)
=== CONT  TestAccImageBuilderImagePipeline_workflow
--- PASS: TestAccImageBuilderImagePipeline_workflowParameter (31.59s)
=== CONT  TestAccImageBuilderImagePipeline_tags
--- PASS: TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes (33.39s)
=== CONT  TestAccImageBuilderImagePipeline_status
--- PASS: TestAccImageBuilderImagePipeline_workflow (32.86s)
=== CONT  TestAccImageBuilderImagePipeline_Schedule_timezone
--- PASS: TestAccImageBuilderImagePipeline_status (33.46s)
=== CONT  TestAccImageBuilderImagePipeline_Schedule_scheduleExpression
--- PASS: TestAccImageBuilderImagePipeline_tags (41.31s)
=== CONT  TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition
--- PASS: TestAccImageBuilderImagePipeline_Schedule_timezone (34.62s)
=== CONT  TestAccImageBuilderImagePipeline_infrastructureARN
--- PASS: TestAccImageBuilderImagePipeline_Schedule_scheduleExpression (31.73s)
=== CONT  TestAccImageBuilderImagePipeline_imageRecipeARN
--- PASS: TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition (32.74s)
=== CONT  TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled
--- PASS: TestAccImageBuilderImagePipeline_infrastructureARN (32.99s)
=== CONT  TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
--- PASS: TestAccImageBuilderImagePipeline_imageRecipeARN (35.04s)
=== CONT  TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
=== NAME  TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
    acctest.go:1617: skipping test for aws/us-west-2: Error running apply: exit status 1
        
        Error: creating Image Builder Image Pipeline: ResourceDependencyException: Resource dependency error: Amazon Inspector is not enabled for 'ecr' resources in account '123456789012'.
        
          with aws_imagebuilder_image_pipeline.test,
          on terraform_plugin_test.tf line 105, in resource "aws_imagebuilder_image_pipeline" "test":
         105: resource "aws_imagebuilder_image_pipeline" "test" {
        
--- PASS: TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled (34.31s)
=== CONT  TestAccImageBuilderImagePipeline_containerRecipeARN
--- SKIP: TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced (17.00s)
=== CONT  TestAccImageBuilderImagePipeline_distributionARN
=== NAME  TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
    acctest.go:1617: skipping test for aws/us-west-2: Error running apply: exit status 1
        
        Error: updating Image Builder Image Pipeline (arn:aws:imagebuilder:us-west-2:123456789012:image-pipeline/tf-acc-test-5586128456531043210): ResourceDependencyException: Resource dependency error: Amazon Inspector is not enabled for 'ec2' resources in account '123456789012'.
        
          with aws_imagebuilder_image_pipeline.test,
          on terraform_plugin_test.tf line 105, in resource "aws_imagebuilder_image_pipeline" "test":
         105: resource "aws_imagebuilder_image_pipeline" "test" {
        
--- SKIP: TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled (29.36s)
=== CONT  TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled
--- PASS: TestAccImageBuilderImagePipeline_containerRecipeARN (35.31s)
=== CONT  TestAccImageBuilderImagePipeline_description
--- PASS: TestAccImageBuilderImagePipeline_distributionARN (34.06s)
=== CONT  TestAccImageBuilderImagePipeline_disappears
--- PASS: TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled (31.26s)
--- PASS: TestAccImageBuilderImagePipeline_disappears (21.75s)
--- PASS: TestAccImageBuilderImagePipeline_description (32.42s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder	212.373s

@ewbankkit
Copy link
Contributor

@kamilturek Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit a60d3b9 into hashicorp:main Jul 12, 2024
52 checks passed
@github-actions github-actions bot added this to the v5.59.0 milestone Jul 12, 2024
@kamilturek kamilturek deleted the f-aws-imagebuilder-pipeline-workflow branch July 12, 2024 12:13
Copy link

This functionality has been released in v5.59.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 Aug 20, 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. external-maintainer Contribution from a trusted external contributor. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. size/L 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.

[Enhancement]: Support for Image Builder workflows
4 participants