Class CfnModel
A CloudFormation AWS::SageMaker::Model
.
Inherited Members
Namespace: Amazon.CDK.AWS.Sagemaker
Assembly: Amazon.CDK.AWS.Sagemaker.dll
Syntax (csharp)
public class CfnModel : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnModel
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
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 .
CloudformationResource: AWS::SageMaker::Model
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;
var environment;
var cfnModel = new CfnModel(this, "MyCfnModel", new CfnModelProps {
ExecutionRoleArn = "executionRoleArn",
// the properties below are optional
Containers = new [] { new ContainerDefinitionProperty {
ContainerHostname = "containerHostname",
Environment = environment,
Image = "image",
ImageConfig = new ImageConfigProperty {
RepositoryAccessMode = "repositoryAccessMode",
// the properties below are optional
RepositoryAuthConfig = new RepositoryAuthConfigProperty {
RepositoryCredentialsProviderArn = "repositoryCredentialsProviderArn"
}
},
InferenceSpecificationName = "inferenceSpecificationName",
Mode = "mode",
ModelDataUrl = "modelDataUrl",
ModelPackageName = "modelPackageName",
MultiModelConfig = new MultiModelConfigProperty {
ModelCacheSetting = "modelCacheSetting"
}
} },
EnableNetworkIsolation = false,
InferenceExecutionConfig = new InferenceExecutionConfigProperty {
Mode = "mode"
},
ModelName = "modelName",
PrimaryContainer = new ContainerDefinitionProperty {
ContainerHostname = "containerHostname",
Environment = environment,
Image = "image",
ImageConfig = new ImageConfigProperty {
RepositoryAccessMode = "repositoryAccessMode",
// the properties below are optional
RepositoryAuthConfig = new RepositoryAuthConfigProperty {
RepositoryCredentialsProviderArn = "repositoryCredentialsProviderArn"
}
},
InferenceSpecificationName = "inferenceSpecificationName",
Mode = "mode",
ModelDataUrl = "modelDataUrl",
ModelPackageName = "modelPackageName",
MultiModelConfig = new MultiModelConfigProperty {
ModelCacheSetting = "modelCacheSetting"
}
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
VpcConfig = new VpcConfigProperty {
SecurityGroupIds = new [] { "securityGroupIds" },
Subnets = new [] { "subnets" }
}
});
Synopsis
Constructors
CfnModel(Construct, String, ICfnModelProps) | Create a new |
CfnModel(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnModel(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrModelName | The name of the model, such as |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
Containers | Specifies the containers in the inference pipeline. |
EnableNetworkIsolation | Isolates the model container. |
ExecutionRoleArn | The Amazon Resource Name (ARN) of the IAM role that SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs. |
InferenceExecutionConfig | Specifies details of how containers in a multi-container endpoint are called. |
ModelName | The name of the new model. |
PrimaryContainer | The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions. |
Tags | A list of key-value pairs to apply to this resource. |
VpcConfig | A VpcConfig object that specifies the VPC that you want your model to connect to. Control access to and from your model container by configuring the VPC. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnModel(Construct, String, ICfnModelProps)
Create a new AWS::SageMaker::Model
.
public CfnModel(Construct scope, string id, ICfnModelProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnModelProps
- resource properties.
CfnModel(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnModel(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnModel(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnModel(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrModelName
The name of the model, such as MyModel
.
public virtual string AttrModelName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: ModelName
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
Containers
Specifies the containers in the inference pipeline.
public virtual object Containers { get; set; }
Property Value
System.Object
Remarks
EnableNetworkIsolation
Isolates the model container.
public virtual object EnableNetworkIsolation { get; set; }
Property Value
System.Object
Remarks
No inbound or outbound network calls can be made to or from the model container.
ExecutionRoleArn
The Amazon Resource Name (ARN) of the IAM role that SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs.
public virtual string ExecutionRoleArn { get; set; }
Property Value
System.String
Remarks
Deploying on ML compute instances is part of model hosting. For more information, see SageMaker Roles .
To be able to pass this role to SageMaker, the caller of this API must have the iam:PassRole
permission.
InferenceExecutionConfig
Specifies details of how containers in a multi-container endpoint are called.
public virtual object InferenceExecutionConfig { get; set; }
Property Value
System.Object
Remarks
ModelName
The name of the new model.
public virtual string ModelName { get; set; }
Property Value
System.String
Remarks
PrimaryContainer
The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions.
public virtual object PrimaryContainer { get; set; }
Property Value
System.Object
Remarks
Tags
A list of key-value pairs to apply to this resource.
public virtual TagManager Tags { get; }
Property Value
Remarks
For more information, see Resource Tag and Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide .
VpcConfig
A VpcConfig object that specifies the VPC that you want your model to connect to. Control access to and from your model container by configuring the VPC. VpcConfig
is used in hosting services and in batch transform. For more information, see Protect Endpoints by Using an Amazon Virtual Private Cloud and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private Cloud .
public virtual object VpcConfig { get; set; }
Property Value
System.Object
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>