skip to Main Content

We are trying to configure data_capture_config currently in terraform. This builds fine with ‘Input’ or ‘Output’ but not ‘InputAndOutput.’ We’ve updated the aws provider to the most recent version that should support this, though we continue to get this error below.

data_capture_config {
    initial_sampling_percentage = 100
    destination_s3_uri          = "s3://xxx/xxx/inferences/"
    capture_options {
      capture_mode = "Input"
    }
    enable_capture = true
  }

Error: creating SageMaker Endpoint: ValidationException: Cannot create endpoint using DeploymentConfig due to unsupported features in the requested endpoint configuration. Please refer documentation for a list of exclusions.
status code: 400, request id: xxxx

I am looking for suggestions to troubleshoot this.

We’ve tried deleting the endpoint and endpoint config prior to a build. Here are some background documentation we’ve referred to.

https://github.com/hashicorp/terraform-provider-aws/pull/

Complete Codeblock

resource "aws_sagemaker_endpoint" "synthetic" {
  name                 = "synthetic-endpoint-${var.stack-name}"
  endpoint_config_name = aws_sagemaker_endpoint_configuration.synthetic_config.name
  deployment_config {
    blue_green_update_policy {
      maximum_execution_timeout_in_seconds = 3000
        traffic_routing_configuration {
          type                     = "ALL_AT_ONCE"
          wait_interval_in_seconds = 60
      }
    }
  }
  
  depends_on = [
    aws_sagemaker_endpoint_configuration.synthetic_config,
    aws_sagemaker_model.synthetic_model
  ]
}
    
resource "aws_sagemaker_endpoint_configuration" "synthetic_config" {
  name        = "synthetic-endpoint-config-${var.stack-name}"
  kms_key_arn = var.kms_key_arn
    
  production_variants {
    variant_name           = "synthetic-variant-1-${var.stack-name}"
    model_name             = aws_sagemaker_model.synthetic_model.name
    initial_instance_count = xxx
    instance_type          = "xxx.large"
  }

  data_capture_config {
    initial_sampling_percentage = 100
    destination_s3_uri          = "s3://xxxx/inferences/"
    capture_options {
      capture_mode = "Input"
    }
    enable_capture = true
  }
 
  depends_on = [
    aws_sagemaker_model.synthetic_model
  ]
}
    
resource "aws_sagemaker_model" "synthetic_model" {
  name               = "synthetic-model-${var.stack-name}"
  execution_role_arn = aws_iam_role.sagemaker_role.arn
  primary_container {
    image = "${var.ecr_url}:synthetic-${var.image_version}"
      environment = {
        SAGEMAKER_SUBMIT_DIRECTORY    = "xxx",
        SAGEMAKER_PROGRAM             = "predict.py",
        SAGEMAKER_CONTAINER_LOG_LEVEL = 20,
        SAGEMAKER_REGION              = var.region,
        SM_MODEL_DIR                  = "xxx",
        MODEL_PATH                    = "${var.model_path}"
        S3_BUCKET_MODEL               = var.s3_bucket_model
        STACK_NAME                    = "${var.stack-name}"
      }
    }
  }
}

2

Answers


  1. Chosen as BEST ANSWER

    This tf syntax seemed to resolve the requirement as workaround:

    data_capture_config {
        initial_sampling_percentage = 100
        destination_s3_uri          = "s3://xxx/inferences/"
        capture_options {
          capture_mode = "Input"
        }
        capture_options {
          capture_mode = "Output"
        }
        enable_capture = true
      }
    

  2. This should work :

    "CaptureOptions": [
                {
                    "CaptureMode": "Input"
                },
                {
                    "CaptureMode": "Output"
                }
            ]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search