class ScalableInstanceCount (construct)
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.Sagemaker.Alpha.ScalableInstanceCount | 
|  Go | github.com/aws/aws-cdk-go/awscdksagemakeralpha/v2#ScalableInstanceCount | 
|  Java | software.amazon.awscdk.services.sagemaker.alpha.ScalableInstanceCount | 
|  Python | aws_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 ScalableInstance Count Props 
Constructs a new instance of the ScalableInstanceCount class.
Construct Props
| Name | Type | Description | 
|---|---|---|
| dimension | string | Scalable dimension of the attribute. | 
| max | number | Maximum capacity to scale to. | 
| resource | string | Resource ID of the attribute. | 
| role | IRole | Role to use for scaling. | 
| service | Service | Service namespace of the scalable attribute. | 
| min | number | Minimum 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:
Service
Service namespace of the scalable attribute.
minCapacity?
Type:
number
(optional, default: 1)
Minimum capacity to scale to.
Properties
| Name | Type | Description | 
|---|---|---|
| node | Node | The tree node. | 
node
Type:
Node
The tree node.
Methods
| Name | Description | 
|---|---|
| scale | Scales in or out to achieve a target requests per second per instance. | 
| to | Returns a string representation of this construct. | 
scaleOnInvocations(id, props)  
public scaleOnInvocations(id: string, props: InvocationsScalingProps): void
Parameters
- id string
- props InvocationsScaling Props 
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.
