based on the documentation here, https://github.com/aws/amazon-sagemaker-examples/blob/main/async-inference/Async-Inference-Walkthrough.ipynb, an autoscaling policy could be added to an sagemaker async endpoint . I want to set this via terraform and have this so far (sample below) , but i'm not how to set Dimensions attribute in TargetTrackingScalingPolicyConfiguration in terraform?
TargetTrackingScalingPolicyConfiguration={
"TargetValue": 5.0, SageMakerVariantInvocationsPerInstance
"CustomizedMetricSpecification": {
"MetricName": "ApproximateBacklogSizePerInstance",
"Namespace": "AWS/SageMaker",
"Dimensions": [{"Name": "EndpointName", "Value": endpoint_name}],
"Statistic": "Average",
},
resource "aws_appautoscaling_target" "sagemaker_target" {
max_capacity = 3
min_capacity = 1
resource_id = "myendpoint"
scalable_dimension = "sagemaker:variant:DesiredInstanceCount"
service_namespace = "sagemaker"
}
resource "aws_appautoscaling_policy" "sagemaker_policy" {
name = "somepolicy"
policy_type = "TargetTrackingScaling"
resource_id = aws_appautoscaling_target.sagemaker_target.resource_id
scalable_dimension = aws_appautoscaling_target.sagemaker_target.scalable_dimension
service_namespace = aws_appautoscaling_target.sagemaker_target.service_namespace
target_tracking_scaling_policy_configuration {
customized_metric_specification{
metric_name = "ApproximateBacklogSizePerInstance"
namespace = "AWS/SageMaker"
Dimensions = ....?????
statistic = "Average"
}
target_value = 3
scale_in_cooldown =300
scale_out_cooldown = 600
}
}