@aws-cdk_aws-sagemaker-alpha.ScalableInstanceCount

class ScalableInstanceCount (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Sagemaker.Alpha.ScalableInstanceCount
Gogithub.com/aws/aws-cdk-go/awscdksagemakeralpha/v2#ScalableInstanceCount
Javasoftware.amazon.awscdk.services.sagemaker.alpha.ScalableInstanceCount
Pythonaws_cdk.aws_sagemaker_alpha.ScalableInstanceCount
TypeScript (source)@aws-cdk/aws-sagemaker-alpha ยป ScalableInstanceCount

Implements IConstruct, IDependable

A scalable sagemaker endpoint attribute.

Example

import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';

declare const model: sagemaker.Model;

const variantName = 'my-variant';
const endpointConfig = new sagemaker.EndpointConfig(this, 'EndpointConfig', {
  instanceProductionVariants: [
    {
      model: model,
      variantName: variantName,
    },
  ]
});

const endpoint = new sagemaker.Endpoint(this, 'Endpoint', { endpointConfig });
const productionVariant = endpoint.findInstanceProductionVariant(variantName);
const instanceCount = productionVariant.autoScaleInstanceCount({
  maxCapacity: 3
});
instanceCount.scaleOnInvocations('LimitRPS', {
  maxRequestsPerSecond: 30,
});

Initializer

new ScalableInstanceCount(scope: Construct, id: string, props: ScalableInstanceCountProps)

Parameters

  • scope Construct
  • id string
  • props ScalableInstanceCountProps

Constructs a new instance of the ScalableInstanceCount class.

Construct Props

NameTypeDescription
dimension๐Ÿ”นstringScalable dimension of the attribute.
maxCapacity๐Ÿ”นnumberMaximum capacity to scale to.
resourceId๐Ÿ”นstringResource ID of the attribute.
role๐Ÿ”นIRoleRole to use for scaling.
serviceNamespace๐Ÿ”นServiceNamespaceService namespace of the scalable attribute.
minCapacity?๐Ÿ”นnumberMinimum capacity to scale to.

dimension๐Ÿ”น

Type: string

Scalable dimension of the attribute.


maxCapacity๐Ÿ”น

Type: number

Maximum capacity to scale to.


resourceId๐Ÿ”น

Type: string

Resource ID of the attribute.


role๐Ÿ”น

Type: IRole

Role to use for scaling.


serviceNamespace๐Ÿ”น

Type: ServiceNamespace

Service namespace of the scalable attribute.


minCapacity?๐Ÿ”น

Type: number (optional, default: 1)

Minimum capacity to scale to.

Properties

NameTypeDescription
node๐Ÿ”นNodeThe tree node.

node๐Ÿ”น

Type: Node

The tree node.

Methods

NameDescription
scaleOnInvocations(id, props)๐Ÿ”นScales in or out to achieve a target requests per second per instance.
toString()๐Ÿ”นReturns a string representation of this construct.

scaleOnInvocations(id, props)๐Ÿ”น

public scaleOnInvocations(id: string, props: InvocationsScalingProps): void

Parameters

  • id string
  • props InvocationsScalingProps

Scales in or out to achieve a target requests per second per instance.


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.