d/aws_ami: warn when most_recent is true and filters are missing#40211
Merged
Conversation
Contributor
Community NoteVoting for Prioritization
For Submitters
|
jar-b
force-pushed
the
f-ami-ds-warning
branch
from
November 20, 2024 17:16
87859bf to
a5a1825
Compare
When `most_recent` is set to `true` and certain filtering criteria are missing, it's possible for this data source to return an image published by a third party. To bring visibility to this possibility in a non-breaking way, the provider will now append a warning diagnostic when an affected combination of arguments is detected. ```console % make testacc PKG=ec2 TESTS=TestAccEC2AMIDataSource_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.2 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2AMIDataSource_' -timeout 360m --- PASS: TestAccEC2AMIDataSource_linuxInstance (11.17s) --- PASS: TestAccEC2AMIDataSource_localNameFilter (11.37s) --- PASS: TestAccEC2AMIDataSource_instanceStore (11.40s) --- PASS: TestAccEC2AMIDataSource_productCode (11.55s) --- PASS: TestAccEC2AMIDataSource_windowsInstance (12.23s) --- PASS: TestAccEC2AMIDataSource_gp3BlockDevice (111.44s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 116.580s ```
jar-b
force-pushed
the
f-ami-ds-warning
branch
from
November 20, 2024 17:30
a5a1825 to
dbb33f7
Compare
jar-b
marked this pull request as ready for review
November 20, 2024 18:13
Contributor
|
This functionality has been released in v5.77.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! |
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When
most_recentis set totrueand certain filtering criteria are missing, it's possible for this data source to return an image published by a third party. To bring visibility to this possibility in a non-breaking way, the provider will now append a warning diagnostic when an affected combination of arguments is detected.For practitioners, the resulting diagnostic will look similar to the following:
Relations
Closes #40197
Output from Acceptance Testing