-
Notifications
You must be signed in to change notification settings - Fork 9.5k
r/aws_sagemaker_image_version: read correct version
after create
#42536
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
Conversation
Community GuidelinesThis 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
Pull Request Authors
|
✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible. |
068bbdf
to
b371036
Compare
Previously the read operation would always retrieve the latest image version matching the `image_name` argument, rather than tracking the version created by a given resource instance. This change updates the `id` attribute to a comma-delimited string concatenating `image_name` and `version`, enabling subsequent read operations to correctly match the version created by this resource, and supporting import of existing versions which are not the most recently created. It also fixes issues observed when managing multiple image versions of the same name in a single workspace. ```console % SAGEMAKER_IMAGE_VERSION_BASE_IMAGE="<redacted>" make testacc PKG=sagemaker TESTS=TestAccSageMakerImageVersion_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.8 test ./internal/service/sagemaker/... -v -count 1 -parallel 20 -run='TestAccSageMakerImageVersion_' -timeout 360m -vet=off 2025/05/08 10:39:43 Initializing Terraform AWS Provider... --- PASS: TestAccSageMakerImageVersion_Disappears_image (80.09s) --- PASS: TestAccSageMakerImageVersion_basic (82.82s) --- PASS: TestAccSageMakerImageVersion_disappears (84.49s) --- PASS: TestAccSageMakerImageVersion_multiple (88.17s) --- PASS: TestAccSageMakerImageVersion_update (91.47s) --- PASS: TestAccSageMakerImageVersion_upgrade_V5_98_0 (102.47s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker 108.081s ```
b371036
to
7b86ead
Compare
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 🚀.
% SAGEMAKER_IMAGE_VERSION_BASE_IMAGE=... make testacc TESTARGS='-run=TestAccSageMakerImageVersion_' PKG=sagemaker ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.2 test ./internal/service/sagemaker/... -v -count 1 -parallel 3 -run=TestAccSageMakerImageVersion_ -timeout 360m -vet=off
2025/05/12 11:59:41 Creating Terraform AWS Provider (SDKv2-style)...
2025/05/12 11:59:41 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN TestAccSageMakerImageVersion_basic
=== PAUSE TestAccSageMakerImageVersion_basic
=== RUN TestAccSageMakerImageVersion_update
=== PAUSE TestAccSageMakerImageVersion_update
=== RUN TestAccSageMakerImageVersion_disappears
=== PAUSE TestAccSageMakerImageVersion_disappears
=== RUN TestAccSageMakerImageVersion_Disappears_image
=== PAUSE TestAccSageMakerImageVersion_Disappears_image
=== RUN TestAccSageMakerImageVersion_multiple
=== PAUSE TestAccSageMakerImageVersion_multiple
=== RUN TestAccSageMakerImageVersion_upgrade_V5_98_0
=== PAUSE TestAccSageMakerImageVersion_upgrade_V5_98_0
=== CONT TestAccSageMakerImageVersion_basic
=== CONT TestAccSageMakerImageVersion_Disappears_image
=== CONT TestAccSageMakerImageVersion_disappears
--- PASS: TestAccSageMakerImageVersion_disappears (77.47s)
=== CONT TestAccSageMakerImageVersion_update
--- PASS: TestAccSageMakerImageVersion_basic (79.39s)
=== CONT TestAccSageMakerImageVersion_upgrade_V5_98_0
--- PASS: TestAccSageMakerImageVersion_Disappears_image (79.95s)
=== CONT TestAccSageMakerImageVersion_multiple
--- PASS: TestAccSageMakerImageVersion_multiple (81.79s)
--- PASS: TestAccSageMakerImageVersion_update (88.92s)
--- PASS: TestAccSageMakerImageVersion_upgrade_V5_98_0 (111.13s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker 195.041s
Warning This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
@jar-b any way you could backport this to a 5.x version? I need it fast for a customer project ! |
Unfortunately not. In this case we explicitly opted to make this change in a major version given the breakage in the format of the Depending on how quickly this fix is required you could use the next V6 beta ( |
Description
Previously the read operation would always retrieve the latest image version matching the
image_name
argument, rather than tracking the version created by a given resource instance. This change updates theid
attribute to a comma-delimited string concatenatingimage_name
andversion
, enabling subsequent read operations to correctly match the version created by this resource, and supporting import of existing versions which are not the most recently created. It also fixes issues observed when managing multiple image versions of the same name in a single workspace.Relations
Closes #40597
Relates #41101
Output from Acceptance Testing