Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Creates a model in Amazon SageMaker. In the request, you name the model and describe a primary container. For the primary container, you specify the Docker image that contains inference code, artifacts (from prior training), and a custom environment map that the inference code uses when you deploy the model for predictions.
Use this API to create a model if you want to use Amazon SageMaker hosting services or run a batch transform job.
To host your model, you create an endpoint configuration with the
CreateEndpointConfig
API, and then create an endpoint with the
CreateEndpoint
API. Amazon SageMaker then deploys all of the
containers that you defined for the model in the hosting environment.
For an example that calls this method when deploying a model to Amazon SageMaker hosting services, see Deploy the Model to Amazon SageMaker Hosting Services (Amazon Web Services SDK for Python (Boto 3)).
To run a batch transform using your model, you start a job with the
CreateTransformJob
API. Amazon SageMaker uses your model and your
dataset to get inferences which are then saved to a specified S3
location.
In the CreateModel
request, you must define a container with the
PrimaryContainer
parameter.
In the request, you also provide an IAM role that Amazon SageMaker can assume to access model artifacts and docker image for deployment on ML compute hosting instances or for batch transform jobs. In addition, you also use the IAM role to manage permissions the inference code needs. For example, if the inference code access any other Amazon Web Services resources, you grant necessary permissions via this role.
Synopsis
- data CreateModel = CreateModel' {}
- newCreateModel :: Text -> Text -> CreateModel
- createModel_primaryContainer :: Lens' CreateModel (Maybe ContainerDefinition)
- createModel_enableNetworkIsolation :: Lens' CreateModel (Maybe Bool)
- createModel_containers :: Lens' CreateModel (Maybe [ContainerDefinition])
- createModel_vpcConfig :: Lens' CreateModel (Maybe VpcConfig)
- createModel_inferenceExecutionConfig :: Lens' CreateModel (Maybe InferenceExecutionConfig)
- createModel_tags :: Lens' CreateModel (Maybe [Tag])
- createModel_modelName :: Lens' CreateModel Text
- createModel_executionRoleArn :: Lens' CreateModel Text
- data CreateModelResponse = CreateModelResponse' {
- httpStatus :: Int
- modelArn :: Text
- newCreateModelResponse :: Int -> Text -> CreateModelResponse
- createModelResponse_httpStatus :: Lens' CreateModelResponse Int
- createModelResponse_modelArn :: Lens' CreateModelResponse Text
Creating a Request
data CreateModel Source #
See: newCreateModel
smart constructor.
CreateModel' | |
|
Instances
Create a value of CreateModel
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:primaryContainer:CreateModel'
, createModel_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.
$sel:enableNetworkIsolation:CreateModel'
, createModel_enableNetworkIsolation
- Isolates the model container. No inbound or outbound network calls can
be made to or from the model container.
$sel:containers:CreateModel'
, createModel_containers
- Specifies the containers in the inference pipeline.
$sel:vpcConfig:CreateModel'
, createModel_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.
$sel:inferenceExecutionConfig:CreateModel'
, createModel_inferenceExecutionConfig
- Specifies details of how containers in a multi-container endpoint are
called.
$sel:tags:CreateModel'
, createModel_tags
- An array of key-value pairs. You can use tags to categorize your Amazon
Web Services resources in different ways, for example, by purpose,
owner, or environment. For more information, see
Tagging Amazon Web Services Resources.
$sel:modelName:CreateModel'
, createModel_modelName
- The name of the new model.
$sel:executionRoleArn:CreateModel'
, createModel_executionRoleArn
- The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can
assume to access model artifacts and docker image for deployment on ML
compute instances or for batch transform jobs. Deploying on ML compute
instances is part of model hosting. For more information, see
Amazon SageMaker Roles.
To be able to pass this role to Amazon SageMaker, the caller of this API
must have the iam:PassRole
permission.
Request Lenses
createModel_primaryContainer :: Lens' CreateModel (Maybe ContainerDefinition) Source #
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.
createModel_enableNetworkIsolation :: Lens' CreateModel (Maybe Bool) Source #
Isolates the model container. No inbound or outbound network calls can be made to or from the model container.
createModel_containers :: Lens' CreateModel (Maybe [ContainerDefinition]) Source #
Specifies the containers in the inference pipeline.
createModel_vpcConfig :: Lens' CreateModel (Maybe VpcConfig) Source #
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.
createModel_inferenceExecutionConfig :: Lens' CreateModel (Maybe InferenceExecutionConfig) Source #
Specifies details of how containers in a multi-container endpoint are called.
createModel_tags :: Lens' CreateModel (Maybe [Tag]) Source #
An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.
createModel_modelName :: Lens' CreateModel Text Source #
The name of the new model.
createModel_executionRoleArn :: Lens' CreateModel Text Source #
The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs. Deploying on ML compute instances is part of model hosting. For more information, see Amazon SageMaker Roles.
To be able to pass this role to Amazon SageMaker, the caller of this API
must have the iam:PassRole
permission.
Destructuring the Response
data CreateModelResponse Source #
See: newCreateModelResponse
smart constructor.
CreateModelResponse' | |
|
Instances
newCreateModelResponse Source #
:: Int | |
-> Text | |
-> CreateModelResponse |
Create a value of CreateModelResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:httpStatus:CreateModelResponse'
, createModelResponse_httpStatus
- The response's http status code.
$sel:modelArn:CreateModelResponse'
, createModelResponse_modelArn
- The ARN of the model created in Amazon SageMaker.
Response Lenses
createModelResponse_httpStatus :: Lens' CreateModelResponse Int Source #
The response's http status code.
createModelResponse_modelArn :: Lens' CreateModelResponse Text Source #
The ARN of the model created in Amazon SageMaker.