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

[Enhancement]: SageMaker Endpoints: add InputAndOutput capture options mode #37330

Open
jtornblad opened this issue May 7, 2024 · 3 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/sagemaker Issues and PRs that pertain to the sagemaker service.

Comments

@jtornblad
Copy link

Description

For SageMaker endpoints, data capture can be configured to capture the Input, Output OR both as "InputAndOutput". Currently the provider rejects this option setting for "InputAndOutput" with the error message:

Error: expected data_capture_config.0.capture_options.0.capture_mode to be one of [Input Output], got InputAndOutput

For capture_mode, the aws_sagemaker_endpoint_configuration should accept "Input", "Output" OR "InputAndOutput" as valid values.

Affected Resource(s) and/or Data Source(s)

aws_sagemaker_endpoint_configuration

Potential Terraform Configuration

resource "aws_sagemaker_endpoint_configuration" "my_endpoint_configuration" {
  name        = "my_endpoint_configuration"

  production_variants {
    variant_name           = "variant-1"
    model_name             = aws_sagemaker_model.my_model.name
    initial_instance_count = 1
    instance_type          = "ml.t2.medium"
  }
  data_capture_config {
    initial_sampling_percentage = 100
    destination_s3_uri          = "s3://my_bucket/my_path"
    capture_options {
      capture_mode = "InputAndOutput"
    }
    enable_capture = true
  }
  depends_on = [
    aws_sagemaker_model.my_model
  ]
}

References

See SageMaker allowed values for capture mode in endpoint configuration at https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CaptureOption.html#sagemaker-Type-CaptureOption-CaptureMode

Would you like to implement a fix?

Yes

@jtornblad jtornblad added the enhancement Requests to existing resources that expand the functionality or scope. label May 7, 2024
Copy link

github-actions bot commented May 7, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/sagemaker Issues and PRs that pertain to the sagemaker service. label May 7, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 7, 2024
@justinretzolk justinretzolk changed the title [Enhancement]: [Enhancement]: SageMaker Endpoints: add InputAndOutput capture options mode May 8, 2024
@justinretzolk justinretzolk added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. and removed needs-triage Waiting for first response or review from a maintainer. labels May 8, 2024
@aayushsss1
Copy link

@justinretzolk @jtornblad

It looks like this is already supported here -

ValidateFunc: validation.StringInSlice(sagemaker.CaptureMode_Values(), false),

and this function is being called from the aws-sdk-go with the InputAndOutput option already defined

const (
	// CaptureModeInput is a CaptureMode enum value
	CaptureModeInput = "Input"

	// CaptureModeOutput is a CaptureMode enum value
	CaptureModeOutput = "Output"

	// CaptureModeInputAndOutput is a CaptureMode enum value
	CaptureModeInputAndOutput = "InputAndOutput"
)

// CaptureMode_Values returns all elements of the CaptureMode enum
func CaptureMode_Values() []string {
	return []string{
		CaptureModeInput,
		CaptureModeOutput,
		CaptureModeInputAndOutput,
	}
}

@CrazyFunker
Copy link

@aayushsss1 I have tried InputAndOutput today with the latest TF AWS provider (v5.50.0), unfortunately this only applies:
Data capture options: Prediction request only, without Prediction response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/sagemaker Issues and PRs that pertain to the sagemaker service.
Projects
None yet
Development

No branches or pull requests

4 participants