# ScalableTargetProps

Properties for a scalable target.

Extends: ScalableTargetProps
Used as props by: ScalableTarget

- Source: [`aws-applicationautoscaling/lib/scalable-target.ts`](https://github.com/aws/aws-cdk/blob/v2.276.0/packages/aws-cdk-lib/aws-applicationautoscaling/lib/scalable-target.ts#L30)

## Example

```ts
const shardsScalableTarget = new appscaling.ScalableTarget(this, 'ElastiCacheRedisShardsScalableTarget', {
  serviceNamespace: appscaling.ServiceNamespace.ELASTICACHE,
  scalableDimension: 'elasticache:replication-group:NodeGroups',
  minCapacity: 2,
  maxCapacity: 10,
  resourceId: 'replication-group/main-cluster',
});

shardsScalableTarget.scaleToTrackMetric('ElastiCacheRedisShardsCPUUtilization', {
  targetValue: 20,
  predefinedMetric: appscaling.PredefinedMetric.ELASTICACHE_PRIMARY_ENGINE_CPU_UTILIZATION,
});
```

## Properties

- `maxCapacity`: number (required) — The maximum value that Application Auto Scaling can use to scale a target during a scaling activity.

- `minCapacity`: number (required) — The minimum value that Application Auto Scaling can use to scale a target during a scaling activity.

- `resourceId`: string (required) — The resource identifier to associate with this scalable target.

  This string consists of the resource type and unique identifier.

  Example value: `service/ecsStack-MyECSCluster-AB12CDE3F4GH/ecsStack-MyECSService-AB12CDE3F4GH`

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — Role that allows Application Auto Scaling to modify your scalable target.

  **Default:** A role is automatically created

- `scalableDimension`: string (required) — The scalable dimension that's associated with the scalable target.

  Specify the service namespace, resource type, and scaling property.

  Example value: `ecs:service:DesiredCount`

- `serviceNamespace`: [ServiceNamespace](/cdk/api/v2/docs/aws-cdk-lib.aws_applicationautoscaling.ServiceNamespace.html) (required) — The namespace of the AWS service that provides the resource or custom-resource for a resource provided by your own application or service.

  For valid AWS service namespace values, see the RegisterScalableTarget
  action in the Application Auto Scaling API Reference.
