Skip to content
v2.277.0

ScalableTaskCountProps Struct ​

The properties of a scalable attribute representing task count.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_applicationautoscaling as appscaling } from 'aws-cdk-lib';
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const role: iam.Role;
const scalableTaskCountProps: ecs.ScalableTaskCountProps = {
  dimension: 'dimension',
  maxCapacity: 123,
  resourceId: 'resourceId',
  role: role,
  serviceNamespace: appscaling.ServiceNamespace.ECS,

  // the properties below are optional
  minCapacity: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_applicationautoscaling as appscaling
from aws_cdk import aws_ecs as ecs
from aws_cdk import aws_iam as iam

# role: iam.Role

scalable_task_count_props = ecs.ScalableTaskCountProps(
    dimension="dimension",
    max_capacity=123,
    resource_id="resourceId",
    role=role,
    service_namespace=appscaling.ServiceNamespace.ECS,

    # the properties below are optional
    min_capacity=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.applicationautoscaling.*;
import software.amazon.awscdk.services.ecs.*;
import software.amazon.awscdk.services.iam.*;

Role role;

ScalableTaskCountProps scalableTaskCountProps = ScalableTaskCountProps.builder()
        .dimension("dimension")
        .maxCapacity(123)
        .resourceId("resourceId")
        .role(role)
        .serviceNamespace(ServiceNamespace.ECS)

        // the properties below are optional
        .minCapacity(123)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ApplicationAutoScaling;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.IAM;

Role role;

var scalableTaskCountProps = new ScalableTaskCountProps {
    Dimension = "dimension",
    MaxCapacity = 123,
    ResourceId = "resourceId",
    Role = role,
    ServiceNamespace = ServiceNamespace.ECS,

    // the properties below are optional
    MinCapacity = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var role Role

scalableTaskCountProps := &ScalableTaskCountProps{
	Dimension: jsii.String("dimension"),
	MaxCapacity: jsii.Number(123),
	ResourceId: jsii.String("resourceId"),
	Role: role,
	ServiceNamespace: awscdk.Aws_applicationautoscaling.ServiceNamespace_ECS,

	// the properties below are optional
	MinCapacity: jsii.Number(123),
}

Properties ​

dimensionstringdimensionstrdimensionStringDimensionstringDimension*string required #
Scalable dimension of the attribute.
maxCapacitynumbermax_capacityint | floatmaxCapacityNumberMaxCapacitydoubleMaxCapacity*float64 required #
Maximum capacity to scale to.
minCapacityoptionalnumbermin_capacityoptionalint | floatminCapacityoptionalNumberMinCapacityoptionaldoubleMinCapacityoptional*float64 = 1 #
Minimum capacity to scale to.
resourceIdstringresource_idstrresourceIdStringResourceIdstringResourceId*string required #
Resource ID of the attribute.
roleIRoleroleIRoleroleIRoleRoleIRoleRoleIRole required #
Role to use for scaling.
serviceNamespaceServiceNamespaceservice_namespaceServiceNamespaceserviceNamespaceServiceNamespaceServiceNamespaceServiceNamespaceServiceNamespaceServiceNamespace required #
Service namespace of the scalable attribute.