Skip to content

Instantly share code, notes, and snippets.

@leehanchung
Created December 21, 2019 00:04
Show Gist options
  • Save leehanchung/d32ab92d647a84dfcb47632ca3c31207 to your computer and use it in GitHub Desktop.
Save leehanchung/d32ab92d647a84dfcb47632ca3c31207 to your computer and use it in GitHub Desktop.
Bash script to create Sagemaker Inference Endpoint from Sagemaker Model
#!/usr/bin/env bash
MODEL_NAME=<<name your model>>
ENDPOINT_CONFIG_NAME=<<name your endpointn config>>
ENDPOINT_NAME=<<name your endpoint>>
# Using one ml.c4.large instance for the endpoint
PRODUCTION_VARIANTS="VariantName=Default,ModelName=${MODEL_NAME},"\
"InitialInstanceCount=1,InstanceType=ml.c4.large"
aws sagemaker create-endpoint-config --endpoint-config-name ${ENDPOINT_CONFIG_NAME} \
--production-variants ${PRODUCTION_VARIANTS}
aws sagemaker create-endpoint --endpoint-name ${ENDPOINT_NAME} \
--endpoint-config-name ${ENDPOINT_CONFIG_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment