This message was deleted.
# general
s
This message was deleted.
1
e
I've figured it out, using the
pulumi_aws.appautoscaling
module:
Copy code
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,
    },
)
🎉 1