-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add image scanning to imagebuilder image pipeline resource #33005
Add image scanning to imagebuilder image pipeline resource #33005
Conversation
Adding basic test
- add tests - fixed bugs with retrieving and setting the data
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @stromp 👋
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! 😃
Error: InternalValidate with provider["registry.terraform.io/hashicorp/aws"], on <empty> line 0: (source code not available) Internal validation of the provider failed! This is always a bug with the provider itself, and not a user issue. Please report this bug: 1 error occurred: * data source aws_imagebuilder_image_pipeline: image_scanning_configuration: MaxItems is for configurable attributes,there's nothing to configure on computed-only field
…der Image Pipeline: ResourceDependencyException: Resource dependency error: Amazon Inspector is not enabled for 'ecr' resources in account '123456789012'.'
…nchConfiguration_maxParallelLaunches'.
There was a problem hiding this 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=TestAccImageBuilderImagePipelineDataSource_\|TestAccImageBuilderImagePipeline_' PKG=imagebuilder ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/imagebuilder/... -v -count 1 -parallel 3 -run=TestAccImageBuilderImagePipelineDataSource_\|TestAccImageBuilderImagePipeline_ -timeout 180m
=== RUN TestAccImageBuilderImagePipelineDataSource_arn
=== PAUSE TestAccImageBuilderImagePipelineDataSource_arn
=== RUN TestAccImageBuilderImagePipelineDataSource_containerRecipeARN
=== PAUSE TestAccImageBuilderImagePipelineDataSource_containerRecipeARN
=== 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
=== CONT TestAccImageBuilderImagePipelineDataSource_arn
=== CONT TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
=== CONT TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition
=== NAME TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
acctest.go:1415: 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 93, in resource "aws_imagebuilder_image_pipeline" "test":
93: resource "aws_imagebuilder_image_pipeline" "test" {
--- SKIP: TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced (26.29s)
=== CONT TestAccImageBuilderImagePipeline_Schedule_scheduleExpression
--- PASS: TestAccImageBuilderImagePipelineDataSource_arn (39.94s)
=== CONT TestAccImageBuilderImagePipeline_tags
--- PASS: TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition (62.63s)
=== CONT TestAccImageBuilderImagePipeline_status
--- PASS: TestAccImageBuilderImagePipeline_Schedule_scheduleExpression (61.69s)
=== CONT TestAccImageBuilderImagePipeline_Schedule_timezone
--- PASS: TestAccImageBuilderImagePipeline_tags (93.28s)
=== CONT TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes
--- PASS: TestAccImageBuilderImagePipeline_status (74.48s)
=== CONT TestAccImageBuilderImagePipeline_infrastructureARN
--- PASS: TestAccImageBuilderImagePipeline_Schedule_timezone (69.59s)
=== CONT TestAccImageBuilderImagePipeline_distributionARN
--- PASS: TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes (62.60s)
=== CONT TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
--- PASS: TestAccImageBuilderImagePipeline_infrastructureARN (61.54s)
=== CONT TestAccImageBuilderImagePipeline_containerRecipeARN
--- PASS: TestAccImageBuilderImagePipeline_distributionARN (62.48s)
=== CONT TestAccImageBuilderImagePipeline_imageRecipeARN
=== NAME TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
acctest.go:1415: 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-468777412585694857): 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 93, in resource "aws_imagebuilder_image_pipeline" "test":
93: resource "aws_imagebuilder_image_pipeline" "test" {
--- SKIP: TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled (51.74s)
=== CONT TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled
--- PASS: TestAccImageBuilderImagePipeline_containerRecipeARN (68.22s)
=== CONT TestAccImageBuilderImagePipeline_disappears
--- PASS: TestAccImageBuilderImagePipeline_imageRecipeARN (64.99s)
=== CONT TestAccImageBuilderImagePipeline_description
--- PASS: TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled (60.78s)
=== CONT TestAccImageBuilderImagePipeline_basic
--- PASS: TestAccImageBuilderImagePipeline_disappears (45.60s)
=== CONT TestAccImageBuilderImagePipelineDataSource_containerRecipeARN
acctest.go:1415: 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 77, in resource "aws_imagebuilder_image_pipeline" "test":
77: resource "aws_imagebuilder_image_pipeline" "test" {
--- SKIP: TestAccImageBuilderImagePipelineDataSource_containerRecipeARN (24.48s)
=== CONT TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled
--- PASS: TestAccImageBuilderImagePipeline_description (62.37s)
--- PASS: TestAccImageBuilderImagePipeline_basic (42.94s)
--- PASS: TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled (57.90s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder 399.741s
% make testacc TESTARGS='-run=TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfiguration_maxParallelLaunches\|TestAccImageBuilderDistributionConfigurationDataSource_arn' PKG=imagebuilder ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/imagebuilder/... -v -count 1 -parallel 3 -run=TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfiguration_maxParallelLaunches\|TestAccImageBuilderDistributionConfigurationDataSource_arn -timeout 180m
=== RUN TestAccImageBuilderDistributionConfigurationDataSource_arn
=== PAUSE TestAccImageBuilderDistributionConfigurationDataSource_arn
=== RUN TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfiguration_maxParallelLaunches
=== PAUSE TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfiguration_maxParallelLaunches
=== CONT TestAccImageBuilderDistributionConfigurationDataSource_arn
=== CONT TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfiguration_maxParallelLaunches
--- PASS: TestAccImageBuilderDistributionConfigurationDataSource_arn (28.19s)
--- PASS: TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfiguration_maxParallelLaunches (45.62s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder 50.981s
% make testacc TESTARGS='-run=TestAccImageBuilderImageRecipesDataSource_owner' PKG=imagebuilder ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/imagebuilder/... -v -count 1 -parallel 3 -run=TestAccImageBuilderImageRecipesDataSource_owner -timeout 180m
=== RUN TestAccImageBuilderImageRecipesDataSource_owner
=== PAUSE TestAccImageBuilderImageRecipesDataSource_owner
=== CONT TestAccImageBuilderImageRecipesDataSource_owner
--- PASS: TestAccImageBuilderImageRecipesDataSource_owner (25.62s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder 30.508s
@stromp Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.13.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! |
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. |
Description
Adds the image scanning configuration options to:
Relations
Closes #31597
Output from Acceptance Testing