# BasicTargetTrackingScalingPolicyProps

Properties for a Target Tracking policy that include the metric but exclude the target.

Extends: BasicTargetTrackingScalingPolicyProps
Extends: BaseTargetTrackingProps

- Source: [`aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts#L66)

## 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

- `customMetric`: [IMetric](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.IMetric.html) — A custom metric for application autoscaling.

  **Default:** No custom metric.

  The metric must track utilization. Scaling out will happen if the metric is higher than
  the target value, scaling in will happen in the metric is lower than the target value.

  The metric must be in the same account and region as the scaling policy.

  Exactly one of customMetric or predefinedMetric must be specified.

- `disableScaleIn`: boolean = false — Indicates whether scale in by the target tracking policy is disabled.

  If the value is true, scale in is disabled and the target tracking policy
  won't remove capacity from the scalable resource. Otherwise, scale in is
  enabled and the target tracking policy can remove capacity from the
  scalable resource.

- `policyName`: string — A name for the scaling policy.

  **Default:** Automatically generated name.

- `predefinedMetric`: [PredefinedMetric](/cdk/api/v2/docs/aws-cdk-lib.aws_applicationautoscaling.PredefinedMetric.html) — A predefined metric for application autoscaling.

  **Default:** No predefined metrics.

  The metric must track utilization. Scaling out will happen if the metric is higher than
  the target value, scaling in will happen in the metric is lower than the target value.

  Exactly one of customMetric or predefinedMetric must be specified.

- `resourceLabel`: string — Identify the resource associated with the metric type.

  **Default:** No resource label.

  Only used for predefined metric ALBRequestCountPerTarget.

  Example value: `app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>`

- `scaleInCooldown`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Period after a scale in activity completes before another scale in activity can start.

  **Default:** Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency

- `scaleOutCooldown`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Period after a scale out activity completes before another scale out activity can start.

  **Default:** Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency

- `targetValue`: number (required) — The target value for the metric.
