Review SageMaker endpoint storage encryption keys

Distinguish default SageMaker endpoint storage encryption from requirements for a separate KMS key.

Description

SageMaker encrypts endpoint storage volumes by default. Set kms_key_arn if you must control the key for a supported volume. Local storage on some Nitro instances uses hardware encryption.

Potential impact

The default key may fall outside your organization's requirements. Missing key permissions can prevent an endpoint from deploying or serving requests.

Remediation

Check the instance's storage type and grant SageMaker access to the required key. For a running endpoint, create a new configuration with a different name, update the endpoint to use it, then test an inference request. Check S3 model files, data capture, logs, TLS and invocation permissions separately.

Examples

These excerpts configure the endpoint's volume. Provide the referenced model, key and permissions in the full configuration.

Key omitted

hcl
resource "aws_sagemaker_endpoint_configuration" "ml_endpoint_config" {
  name = "my-endpoint-config"

  production_variants {
    variant_name           = "variant-1"
    model_name             = aws_sagemaker_model.model.name
    initial_instance_count = 1
    instance_type          = "ml.t2.medium"
  }
}

The first configuration uses the default storage encryption.

KMS key specified

hcl
resource "aws_sagemaker_endpoint_configuration" "ml_endpoint_config" {
  name = "my-endpoint-config"

  production_variants {
    variant_name           = "variant-1"
    model_name             = aws_sagemaker_model.model.name
    initial_instance_count = 1
    instance_type          = "ml.t2.medium"
  }

  kms_key_arn = aws_kms_key.sagemaker.arn
}

kms_key_arn selects the key for supported volumes.

References