import json
import boto3


def lambda_handler(event, context):
    sm_client = boto3.client("sagemaker")

    # The name of the model created in the Pipeline CreateModelStep
    model_name = event["model_name"]
    model_package_arn = event["model_package_arn"]
    endpoint_config_name = event["endpoint_config_name"]
    endpoint_name = event["endpoint_name"]
    endpoint_instance_type = event["endpoint_instance_type"]
    role = event["role"]
    container = {"ModelPackageName": model_package_arn}

    create_model_respose = sm_client.create_model(ModelName=model_name, ExecutionRoleArn=role, Containers=[container])

    create_endpoint_config_response = sm_client.create_endpoint_config(
        EndpointConfigName=endpoint_config_name,
        ProductionVariants=[
            {
                "InstanceType": endpoint_instance_type,
                "InitialVariantWeight": 1,
                "InitialInstanceCount": 1,
                "ModelName": model_name,
                "VariantName": "AllTraffic",
            }
        ],
    )

    create_endpoint_response = sm_client.create_endpoint(
        EndpointName=endpoint_name, EndpointConfigName=endpoint_config_name
    )

    return {
        "statusCode": 200,
        "body": json.dumps("Created Endpoint!"),
        "other_key": "example_value",
    }
6d1c870e575a9e19949abc890ae8f5f8813a7613
<mask token>

<mask token>


def lambda_handler(event, context):
    sm_client = boto3.client('sagemaker')
    model_name = event['model_name']
    model_package_arn = event['model_package_arn']
    endpoint_config_name = event['endpoint_config_name']
    endpoint_name = event['endpoint_name']
    endpoint_instance_type = event['endpoint_instance_type']
    role = event['role']
    container = {'ModelPackageName': model_package_arn}
    create_model_respose = sm_client.create_model(ModelName=model_name,
        ExecutionRoleArn=role, Containers=[container])
    create_endpoint_config_response = sm_client.create_endpoint_config(
        EndpointConfigName=endpoint_config_name, ProductionVariants=[{
        'InstanceType': endpoint_instance_type, 'InitialVariantWeight': 1,
        'InitialInstanceCount': 1, 'ModelName': model_name, 'VariantName':
        'AllTraffic'}])
    create_endpoint_response = sm_client.create_endpoint(EndpointName=
        endpoint_name, EndpointConfigName=endpoint_config_name)
    return {'statusCode': 200, 'body': json.dumps('Created Endpoint!'),
        'other_key': 'example_value'}

import json
import boto3


def lambda_handler(event, context):
    sm_client = boto3.client('sagemaker')
    model_name = event['model_name']
    model_package_arn = event['model_package_arn']
    endpoint_config_name = event['endpoint_config_name']
    endpoint_name = event['endpoint_name']
    endpoint_instance_type = event['endpoint_instance_type']
    role = event['role']
    container = {'ModelPackageName': model_package_arn}
    create_model_respose = sm_client.create_model(ModelName=model_name,
        ExecutionRoleArn=role, Containers=[container])
    create_endpoint_config_response = sm_client.create_endpoint_config(
        EndpointConfigName=endpoint_config_name, ProductionVariants=[{
        'InstanceType': endpoint_instance_type, 'InitialVariantWeight': 1,
        'InitialInstanceCount': 1, 'ModelName': model_name, 'VariantName':
        'AllTraffic'}])
    create_endpoint_response = sm_client.create_endpoint(EndpointName=
        endpoint_name, EndpointConfigName=endpoint_config_name)
    return {'statusCode': 200, 'body': json.dumps('Created Endpoint!'),
        'other_key': 'example_value'}

import json
import boto3


def lambda_handler(event, context):
    sm_client = boto3.client("sagemaker")

    # The name of the model created in the Pipeline CreateModelStep
    model_name = event["model_name"]
    model_package_arn = event["model_package_arn"]
    endpoint_config_name = event["endpoint_config_name"]
    endpoint_name = event["endpoint_name"]
    endpoint_instance_type = event["endpoint_instance_type"]
    role = event["role"]
    container = {"ModelPackageName": model_package_arn}

    create_model_respose = sm_client.create_model(ModelName=model_name, ExecutionRoleArn=role, Containers=[container])

    create_endpoint_config_response = sm_client.create_endpoint_config(
        EndpointConfigName=endpoint_config_name,
        ProductionVariants=[
            {
                "InstanceType": endpoint_instance_type,
                "InitialVariantWeight": 1,
                "InitialInstanceCount": 1,
                "ModelName": model_name,
                "VariantName": "AllTraffic",
            }
        ],
    )

    create_endpoint_response = sm_client.create_endpoint(
        EndpointName=endpoint_name, EndpointConfigName=endpoint_config_name
    )

    return {
        "statusCode": 200,
        "body": json.dumps("Created Endpoint!"),
        "other_key": "example_value",
    }