Class CfnModel
The AWS::SageMaker::Model
resource to create a model to host at an Amazon SageMaker endpoint.
Inherited Members
Namespace: Amazon.CDK.AWS.Sagemaker
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnModel : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnModel
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
For more information, see Deploying a Model on Amazon SageMaker Hosting Services in the Amazon SageMaker Developer Guide .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html
CloudformationResource: AWS::SageMaker::Model
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 {
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",
ModelDataSource = new ModelDataSourceProperty {
S3DataSource = new S3DataSourceProperty {
CompressionType = "compressionType",
S3DataType = "s3DataType",
S3Uri = "s3Uri",
// the properties below are optional
HubAccessConfig = new HubAccessConfigProperty {
HubContentArn = "hubContentArn"
},
ModelAccessConfig = new ModelAccessConfigProperty {
AcceptEula = false
}
}
},
ModelDataUrl = "modelDataUrl",
ModelPackageName = "modelPackageName",
MultiModelConfig = new MultiModelConfigProperty {
ModelCacheSetting = "modelCacheSetting"
}
} },
EnableNetworkIsolation = false,
ExecutionRoleArn = "executionRoleArn",
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",
ModelDataSource = new ModelDataSourceProperty {
S3DataSource = new S3DataSourceProperty {
CompressionType = "compressionType",
S3DataType = "s3DataType",
S3Uri = "s3Uri",
// the properties below are optional
HubAccessConfig = new HubAccessConfigProperty {
HubContentArn = "hubContentArn"
},
ModelAccessConfig = new ModelAccessConfigProperty {
AcceptEula = false
}
}
},
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(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 |
CfnModel(Construct, String, ICfnModelProps) |
Properties
AttrId | |
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 | Tag Manager which manages the tags for this resource. |
TagsRaw | 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(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
CfnModel(Construct, String, ICfnModelProps)
public CfnModel(Construct scope, string id, ICfnModelProps props = null)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnModelProps
Resource properties.
Properties
AttrId
public virtual string AttrId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Id
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
EnableNetworkIsolation
Isolates the model container.
public virtual object EnableNetworkIsolation { get; set; }
Property Value
System.Object
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
InferenceExecutionConfig
Specifies details of how containers in a multi-container endpoint are called.
public virtual object InferenceExecutionConfig { get; set; }
Property Value
System.Object
ModelName
The name of the new model.
public virtual string ModelName { get; set; }
Property Value
System.String
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
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
A list of key-value pairs to apply to this resource.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
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
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>