AWS Amazon SageMaker Model
This page shows how to write Terraform and CloudFormation for Amazon SageMaker Model and write them securely.
aws_sagemaker_model (Terraform)
The Model in Amazon SageMaker can be configured in Terraform with the resource name aws_sagemaker_model
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_sagemaker_model" "examplea" {
execution_role_arn = aws_iam_role.examplea.arn
}
resource "aws_iam_role" "examplea" {
assume_role_policy = data.aws_iam_policy_document.assume_role.json
resource "aws_sagemaker_model" "this" {
name = "rs-model-a-1"
execution_role_arn = aws_iam_role.execution_role.arn
container {
image = data.aws_sagemaker_prebuilt_ecr_image.scikit.registry_path
resource "aws_sagemaker_model" "this" {
enable_network_isolation = var.enable_network_isolation
execution_role_arn = var.execution_role_arn
name = var.name
tags = var.tags
resource "aws_sagemaker_model" "test_model" {
execution_role_arn = aws_iam_role.test_role.arn
primary_container {
image = "1234567890.dkr.ecr.us-east-1.amazonaws.com/foo:1"
}
resource "aws_sagemaker_model" "test_model" {
execution_role_arn = aws_iam_role.test_role.arn
primary_container {
image = "1234567890.dkr.ecr.us-east-1.amazonaws.com/foo:1"
}
Parameters
-
arn
optional computed - string -
enable_network_isolation
optional - bool -
execution_role_arn
required - string -
id
optional computed - string -
name
optional computed - string -
tags
optional - map from string to string -
container
list block-
container_hostname
optional - string -
environment
optional - map from string to string -
image
required - string -
mode
optional - string -
model_data_url
optional - string -
image_config
list block-
repository_access_mode
required - string
-
-
-
primary_container
list block-
container_hostname
optional - string -
environment
optional - map from string to string -
image
required - string -
mode
optional - string -
model_data_url
optional - string -
image_config
list block-
repository_access_mode
required - string
-
-
-
vpc_config
list block-
security_group_ids
required - set of string -
subnets
required - set of string
-
Explanation in Terraform Registry
Provides a SageMaker model resource.
AWS::SageMaker::Model (CloudFormation)
The Model in SageMaker can be configured in CloudFormation with the resource name AWS::SageMaker::Model
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
ExecutionRoleArn
required - String -
EnableNetworkIsolation
optional - Boolean -
PrimaryContainer
optional - ContainerDefinition -
ModelName
optional - String -
VpcConfig
optional - VpcConfig -
Containers
optional - List of ContainerDefinition -
InferenceExecutionConfig
optional - InferenceExecutionConfig -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::SageMaker::Model
resource to create a model to host at an Amazon SageMaker endpoint. For more information, see Deploying a Model on Amazon SageMaker Hosting Services in the Amazon SageMaker Developer Guide.
Frequently asked questions
What is AWS Amazon SageMaker Model?
AWS Amazon SageMaker Model is a resource for Amazon SageMaker of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon SageMaker Model?
For Terraform, the JamesWoolfenden/terraform-aws-sagemaker, dominodatalab/domino-research and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.