Skip to content

Instantly share code, notes, and snippets.

@juliensimon
Created May 17, 2019 14:28
Show Gist options
  • Save juliensimon/bebdcb1f9755ec46411213fd1b239d59 to your computer and use it in GitHub Desktop.
Save juliensimon/bebdcb1f9755ec46411213fd1b239d59 to your computer and use it in GitHub Desktop.
AWSTemplateFormatVersion: 2010-09-09
Parameters:
ModelName:
Description: Model name
Type: String
ModelDataUrl:
Description: Location of model artefact
Type: String
TrainingImage:
Description: The container used to train the model
Type: String
InstanceType:
Description: Instance type
Type: String
Default: ml.t2.xlarge
InstanceCount:
Description: Instance count
Type: String
Default: 1
RoleArn:
Description: Execution Role ARN
Type: String
Resources:
Model:
Type: "AWS::SageMaker::Model"
Properties:
Containers:
-
Image: !Ref TrainingImage
ModelDataUrl: !Ref ModelDataUrl
ExecutionRoleArn: !Ref RoleArn
ModelName: !Ref ModelName
Endpoint:
Type: "AWS::SageMaker::Endpoint"
Properties:
EndpointConfigName: !GetAtt EndpointConfig.EndpointConfigName
#Using a custom name will prevent updates with change sets
#EndpointName: !Ref EndpointName
EndpointConfig:
Type: "AWS::SageMaker::EndpointConfig"
Properties:
ProductionVariants:
-
ModelName: !GetAtt Model.ModelName
VariantName: variant-1
InitialInstanceCount: !Ref InstanceCount
InstanceType: !Ref InstanceType
InitialVariantWeight: 1.0
#Using a custom name will prevent updates with change sets
#EndpointConfigName: !Ref EndpointConfigName
Outputs:
EndpointId:
Value: !Ref Endpoint
EndpointName:
Value: !GetAtt Endpoint.EndpointName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment