sparse-intern-71089
11/09/2020, 1:00 PMelegant-island-39916
11/09/2020, 3:39 PMpulumi_aws.appautoscaling
module:
kafka_ebs_autoscaling_target = appautoscaling.Target(
"kafka-ebs-autoscaling-target",
max_capacity=kafka_max_volume_size_gb,
min_capacity=1, # Minimum capacity cannot be greater than 1 (AWS Limit)
service_namespace="kafka",
scalable_dimension="kafka:broker-storage:VolumeSize",
resource_id=msk_cluster.arn,
)
appautoscaling.Policy(
"kafka-ebs-autoscaling-policy",
service_namespace=kafka_ebs_autoscaling_target.service_namespace,
scalable_dimension=kafka_ebs_autoscaling_target.scalable_dimension,
resource_id=kafka_ebs_autoscaling_target.resource_id,
policy_type="TargetTrackingScaling",
target_tracking_scaling_policy_configuration={
"predefinedMetricSpecification": {
"predefinedMetricType": "KafkaBrokerStorageUtilization",
},
"disableScaleIn": True, # MSK does not support EBS scale in
"scaleOutCooldown": 300,
# Percentage of disk space usage to target.
# AWS recommends between 50-60%.
"targetValue": 55,
},
)