def gen_endpoint_config(
    endpoint_config_name,
    model_name,
    initial_instance_count,
    instance_type,
    data_capture_sample_percent,
    data_capture_s3_prefix,
    enable_data_capture=False,
):
    """
    Generates the endpoint_config for the Sagemaker Endpoint. We can specify all the
    production variants here.
    """
    endpoint_config = {
        "SagemakerEndpointConfig": {
            "Type": "AWS::SageMaker::EndpointConfig",
            "DependsOn": "SagemakerModel",
            "Properties": {
                # "EndpointConfigName": endpoint_config_name,
                "DataCaptureConfig": {
                    "EnableCapture": enable_data_capture,
                    "InitialSamplingPercentage": data_capture_sample_percent,
                    "DestinationS3Uri": data_capture_s3_prefix,
                    "CaptureOptions": [
                        {"CaptureMode": "Input"},
                        {"CaptureMode": "Output"},
                    ],
                },
                "ProductionVariants": [
                    {
                        "InitialInstanceCount": initial_instance_count,
                        "InitialVariantWeight": 1,
                        "InstanceType": instance_type,
                        "ModelName": {"Fn::GetAtt": ["SagemakerModel", "ModelName"]},
                        "VariantName": "default",
                    }
                ],
            },
        },
    }

    return endpoint_config