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

$40976 Fix validation for SageMaker App Image Config: API rejects valid UID/GID pairs defined in provider schema #41112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

richardissailing
Copy link

Description of Changes

This PR fixes the validation for the aws_sagemaker_app_image_config resource's FileSystemConfig by updating the allowed values for default_uid and default_gid to match AWS API requirements. Currently, the provider schema allows values (0) that the AWS API rejects.

Fixes #40976

Output from Acceptance Testing

make testacc TESTS=TestAccSageMakerAppImageConfig_KernelGatewayImage_fileSystem  PKG=sagemaker
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/sagemaker/... -v -count 1 -parallel 20 -run='TestAccSageMakerAppImageConfig_KernelGatewayImage_fileSystem'  -timeout 360m -vet=off
2025/01/27 19:57:13 Initializing Terraform AWS Provider...
=== RUN   TestAccSageMakerAppImageConfig_KernelGatewayImage_fileSystemValidation
=== PAUSE TestAccSageMakerAppImageConfig_KernelGatewayImage_fileSystemValidation
=== CONT  TestAccSageMakerAppImageConfig_KernelGatewayImage_fileSystemValidation
--- PASS: TestAccSageMakerAppImageConfig_KernelGatewayImage_fileSystemValidation (90.94s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker  91.119s

Additional Details

The AWS SageMaker API only supports specific values for FileSystemConfig:

  • default_uid: 1000
  • default_gid: 100

However, the current provider schema allows values (0) that the API rejects with:

Error: updating SageMaker App Image Config: operation error SageMaker: UpdateAppImageConfig, https response error StatusCode: 400, RequestID: ace80b14-653d-47c0-8225-01aa5cd43ad7, api error ValidationException: Unsupported FileSystemConfig parameters. Only supported values of DefaultUId and DefaultGID are 1000 and 100 respectively

This PR updates the schema validation to only allow the supported values, providing better user experience by failing fast during plan phase rather than during apply.

@richardissailing richardissailing requested a review from a team as a code owner January 27, 2025 23:53
Copy link

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 tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/sagemaker Issues and PRs that pertain to the sagemaker service. needs-triage Waiting for first response or review from a maintainer. labels Jan 27, 2025
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/sagemaker Issues and PRs that pertain to the sagemaker service. 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.

[Bug]: SageMaker App Image Config: API rejects valid UID/GID pairs defined in provider schema
2 participants