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
-
arnoptional computed - string -
enable_network_isolationoptional - bool -
execution_role_arnrequired - string -
idoptional computed - string -
nameoptional computed - string -
tagsoptional - map from string to string -
containerlist block-
container_hostnameoptional - string -
environmentoptional - map from string to string -
imagerequired - string -
modeoptional - string -
model_data_urloptional - string -
image_configlist block-
repository_access_moderequired - string
-
-
-
primary_containerlist block-
container_hostnameoptional - string -
environmentoptional - map from string to string -
imagerequired - string -
modeoptional - string -
model_data_urloptional - string -
image_configlist block-
repository_access_moderequired - string
-
-
-
vpc_configlist block-
security_group_idsrequired - set of string -
subnetsrequired - 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
-
ExecutionRoleArnrequired - String -
EnableNetworkIsolationoptional - Boolean -
PrimaryContaineroptional - ContainerDefinition -
ModelNameoptional - String -
VpcConfigoptional - VpcConfig -
Containersoptional - List of ContainerDefinition -
InferenceExecutionConfigoptional - InferenceExecutionConfig -
Tagsoptional - List of Tag
Explanation in CloudFormation Registry
The
AWS::SageMaker::Modelresource 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.