Skip to content

[Bug]: Only one TargetTrackingScaling policy for a given metric (aws_dynamodb_table and aws_appautoscaling_policy) #41179

Open
@YakDriver

Description

@YakDriver

Terraform Core Version

1.10.5

AWS Provider Version

5.58.0

Affected Resource(s)

  • aws_dynamodb_table
  • aws_appautoscaling_policy

Expected Behavior

Apply is successful

Actual Behavior

Receive an error

Relevant Error/Panic Output Snippet

Error: putting Application Auto Scaling Scaling Policy (dynamodb-read-capacity-utilization-table/patrick_example): operation error Application Auto Scaling: PutScalingPolicy, https response error StatusCode: 400, RequestID: 33d396fa-aa46-4c39-ab7b-8b93554adbf7, ValidationException: Only one TargetTrackingScaling policy for a given metric specification is allowed.

   with aws_appautoscaling_policy.dynamodb-table_read_policy_replica,
   on main_workaround.tf line 147, in resource "aws_appautoscaling_policy" "dynamodb-table_read_policy_replica":
  147: resource "aws_appautoscaling_policy" "dynamodb-table_read_policy_replica" {

Terraform Configuration Files

provider "aws" {
  alias  = "main"
  region = "us-west-2"
}

provider "aws" {
  alias  = "alt"
  region = "us-east-2"
}

resource "aws_dynamodb_table" "example" {
  provider = aws.main
  name     = "patrick_example"
  hash_key = "TestTableHashKey"

  read_capacity    = 28
  write_capacity   = 28
  billing_mode     = "PROVISIONED"
  # billing_mode = "PAY_PER_REQUEST"
  stream_enabled   = true
  stream_view_type = "NEW_AND_OLD_IMAGES"

  attribute {
    name = "TestTableHashKey"
    type = "S"
  }

  lifecycle {
    ignore_changes = [replica]
  }
}

resource "aws_appautoscaling_target" "dynamodb-table_read_target" {
  provider           = aws.main
  max_capacity       = 735
  min_capacity       = 28
  resource_id        = "table/${aws_dynamodb_table.example.name}"
  scalable_dimension = "dynamodb:table:ReadCapacityUnits"
  service_namespace  = "dynamodb"
}

resource "aws_appautoscaling_policy" "dynamodb-table_read_policy" {
  provider           = aws.main
  name               = "dynamodb-read-capacity-utilization-${aws_appautoscaling_target.dynamodb-table_read_target.resource_id}"
  policy_type        = "TargetTrackingScaling"
  resource_id        = aws_appautoscaling_target.dynamodb-table_read_target.resource_id
  scalable_dimension = aws_appautoscaling_target.dynamodb-table_read_target.scalable_dimension
  service_namespace  = aws_appautoscaling_target.dynamodb-table_read_target.service_namespace

  target_tracking_scaling_policy_configuration {
    predefined_metric_specification {
      predefined_metric_type = "DynamoDBReadCapacityUtilization"
    }
    target_value = 50
  }
}

resource "aws_appautoscaling_target" "dynamodb-table_write_target" {
  provider     = aws.main
  max_capacity = 900
  min_capacity = 28

  resource_id        = "table/${aws_dynamodb_table.example.name}"
  scalable_dimension = "dynamodb:table:WriteCapacityUnits"
  service_namespace  = "dynamodb"
}

resource "aws_appautoscaling_policy" "dynamodb-table_write_policy" {
  provider           = aws.main
  name               = "dynamodb-write-capacity-utilization-${aws_appautoscaling_target.dynamodb-table_write_target.resource_id}"
  policy_type        = "TargetTrackingScaling"
  resource_id        = aws_appautoscaling_target.dynamodb-table_write_target.resource_id
  scalable_dimension = aws_appautoscaling_target.dynamodb-table_write_target.scalable_dimension
  service_namespace  = aws_appautoscaling_target.dynamodb-table_write_target.service_namespace

  target_tracking_scaling_policy_configuration {
    predefined_metric_specification {
      predefined_metric_type = "DynamoDBWriteCapacityUtilization"
    }
    target_value = 50
  }
}

##########################################################
######                   REPLICA
##########################################################
resource "time_sleep" "wait_10_seconds" {
  depends_on = [aws_dynamodb_table.example]

  create_duration = "10s"
}


resource "aws_dynamodb_table_replica" "example" {
  provider         = aws.alt
  global_table_arn = aws_dynamodb_table.example.arn

  tags = {
    Name = "IZPAWS"
    Pozo = "Amargo"
  }

  depends_on = [time_sleep.wait_10_seconds]
}


resource "aws_appautoscaling_target" "dynamodb-table_write_replica" {
  provider     = aws.alt
  max_capacity = 840
  min_capacity = 28

  resource_id = "table/${aws_dynamodb_table.example.name}"
  scalable_dimension = "dynamodb:table:WriteCapacityUnits"
  service_namespace  = "dynamodb"

  depends_on = [aws_dynamodb_table_replica.example]
}

resource "aws_appautoscaling_policy" "dynamodb-table_write_policy_replica" {
  provider           = aws.alt
  name               = "dynamodb-write-capacity-utilization-${aws_appautoscaling_target.dynamodb-table_write_replica.resource_id}"
  policy_type        = "TargetTrackingScaling"
  resource_id        = aws_appautoscaling_target.dynamodb-table_write_replica.resource_id
  scalable_dimension = aws_appautoscaling_target.dynamodb-table_write_replica.scalable_dimension
  service_namespace  = aws_appautoscaling_target.dynamodb-table_write_replica.service_namespace

  target_tracking_scaling_policy_configuration {
    predefined_metric_specification {
      predefined_metric_type = "DynamoDBWriteCapacityUtilization"
    }
    target_value = 50
  }
}

resource "aws_appautoscaling_target" "dynamodb-table_read_target_replica" {
  provider           = aws.alt
  max_capacity       = 700
  min_capacity       = 28
  resource_id        = "table/${aws_dynamodb_table.example.name}"
  scalable_dimension = "dynamodb:table:ReadCapacityUnits"
  service_namespace  = "dynamodb"

  depends_on = [aws_dynamodb_table_replica.example]
}

resource "aws_appautoscaling_policy" "dynamodb-table_read_policy_replica" {
  provider           = aws.alt
  name               = "dynamodb-read-capacity-utilization-${aws_appautoscaling_target.dynamodb-table_read_target_replica.resource_id}"
  policy_type        = "TargetTrackingScaling"
  resource_id        = aws_appautoscaling_target.dynamodb-table_read_target_replica.resource_id
  scalable_dimension = aws_appautoscaling_target.dynamodb-table_read_target_replica.scalable_dimension
  service_namespace  = aws_appautoscaling_target.dynamodb-table_read_target_replica.service_namespace

  target_tracking_scaling_policy_configuration {
    predefined_metric_specification {
      predefined_metric_type = "DynamoDBReadCapacityUtilization"
    }
    target_value = 50
  }
}

Steps to Reproduce

  1. terraform apply with aws_dynamodb_table.example.billing_mode = "PROVISIONED"
  2. terraform apply with aws_dynamodb_table.example.billing_mode = "PAY_PER_REQUEST"
  3. terraform apply with aws_dynamodb_table.example.billing_mode = "PROVISIONED"
  4. terraform apply with aws_dynamodb_table.example.billing_mode = "PROVISIONED"

Debug Output

Possible problems from the log:

2024-07-18T13:49:19.838+0200 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_dynamodb_table.example, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .table_class: planned value cty.StringVal("STANDARD") for a non-computed attribute
      - .deletion_protection_enabled: planned value cty.False for a non-computed attribute
      - .tags: planned value cty.MapValEmpty(cty.String) for a non-computed attribute
      - .ttl: block count in plan (1) disagrees with count in config (0)
      - .point_in_time_recovery: block count in plan (1) disagrees with count in config (0)
2024-07-18T13:49:20.767+0200 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_appautoscaling_target.dynamodb-table_write_target, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .tags: planned value cty.MapValEmpty(cty.String) for a non-computed attribute
2024-07-18T13:49:20.981+0200 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_appautoscaling_policy.dynamodb-table_write_policy, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .target_tracking_scaling_policy_configuration[0].disable_scale_in: planned value cty.False for a non-computed attribute
2024-07-18T13:49:21.683+0200 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_dynamodb_table_replica.example, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .point_in_time_recovery: planned value cty.False for a non-computed attribute
      - .table_class_override: planned value cty.StringVal("") for a non-computed attribute
2024-07-18T13:49:30.108+0200 [TRACE] checkPlannedChange: Verifying that actual change (action Create) matches planned change (action Create)
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
aws_appautoscaling_policy.dynamodb-table_write_policy_replica: Creating...
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [INFO]  Starting apply for aws_appautoscaling_policy.dynamodb-table_write_policy_replica
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [DEBUG] aws_appautoscaling_policy.dynamodb-table_read_policy_replica: applying the planned Create change
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [TRACE] GRPCProvider: ApplyResourceChange
2024-07-18T13:49:30.108+0200 [TRACE] GRPCProvider: GetProviderSchema
2024-07-18T13:49:30.108+0200 [TRACE] GRPCProvider: returning cached schema: EXTRA_VALUE_AT_END=registry.terraform.io/hashicorp/aws
2024-07-18T13:49:30.108+0200 [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/hashicorp/aws" is in the global cache
2024-07-18T13:49:30.108+0200 [DEBUG] aws_appautoscaling_policy.dynamodb-table_write_policy_replica: applying the planned Create change
2024-07-18T13:49:30.109+0200 [TRACE] GRPCProvider: ApplyResourceChange
2024-07-18T13:49:30.109+0200 [TRACE] GRPCProvider: GetProviderSchema
2024-07-18T13:49:30.109+0200 [TRACE] GRPCProvider: returning cached schema: EXTRA_VALUE_AT_END=registry.terraform.io/hashicorp/aws
2024-07-18T13:49:30.109+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Received request: @module=sdk.proto tf_resource_type=aws_appautoscaling_policy tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:852 tf_proto_version=5.6 tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309 timestamp="2024-07-18T13:49:30.109+0200"
2024-07-18T13:49:30.109+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Sending request downstream: tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309 tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:22 @module=sdk.proto tf_proto_version=5.6 tf_provider_addr=registry.terraform.io/hashicorp/aws tf_resource_type=aws_appautoscaling_policy timestamp="2024-07-18T13:49:30.109+0200"
2024-07-18T13:49:30.109+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: calling downstream server: tf_mux_provider="*schema.GRPCProviderServer" tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-mux@v0.16.0/internal/logging/mux.go:19 @module=sdk.mux timestamp="2024-07-18T13:49:30.109+0200"
2024-07-18T13:49:30.109+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Received request: @module=sdk.proto tf_provider_addr=registry.terraform.io/hashicorp/aws tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:852 tf_proto_version=5.6 tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 tf_resource_type=aws_appautoscaling_policy timestamp="2024-07-18T13:49:30.109+0200"
2024-07-18T13:49:30.109+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Sending request downstream: @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:22 @module=sdk.proto tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 tf_resource_type=aws_appautoscaling_policy tf_rpc=ApplyResourceChange tf_proto_version=5.6 tf_provider_addr=registry.terraform.io/hashicorp/aws timestamp="2024-07-18T13:49:30.109+0200"
2024-07-18T13:49:30.109+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: calling downstream server: tf_mux_provider="*schema.GRPCProviderServer" tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-mux@v0.16.0/internal/logging/mux.go:19 @module=sdk.mux timestamp="2024-07-18T13:49:30.109+0200"
2024-07-18T13:49:30.109+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: [DEBUG] setting computed for "alarm_arns" from ComputedKeys
2024-07-18T13:49:30.109+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Calling downstream: tf_rpc=ApplyResourceChange @module=sdk.helper_schema tf_mux_provider="*schema.GRPCProviderServer" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309 tf_resource_type=aws_appautoscaling_policy @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:936 timestamp="2024-07-18T13:49:30.109+0200"
2024-07-18T13:49:30.109+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: [DEBUG] setting computed for "alarm_arns" from ComputedKeys
2024-07-18T13:49:30.109+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: [DEBUG] Waiting for state to become: [success]
2024-07-18T13:49:30.110+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Calling downstream: @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:936 tf_resource_type=aws_appautoscaling_policy tf_rpc=ApplyResourceChange tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 @module=sdk.helper_schema tf_mux_provider="*schema.GRPCProviderServer" timestamp="2024-07-18T13:49:30.109+0200"
2024-07-18T13:49:30.110+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: [DEBUG] Waiting for state to become: [success]
2024-07-18T13:49:30.110+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: HTTP Request Sent: @module=aws tf_resource_type=aws_appautoscaling_policy tf_aws.sdk=aws-sdk-go-v2 @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.54/logging/tf_logger.go:45 http.request.header.x_amz_security_token="*****" http.url=https://application-autoscaling.us-east-2.amazonaws.com/ rpc.method=PutScalingPolicy rpc.system=aws-api tf_mux_provider="*schema.GRPCProviderServer" aws.region=us-east-2 net.peer.name=application-autoscaling.us-east-2.amazonaws.com http.method=POST http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA************N6NV/20240718/us-east-2/application-autoscaling/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=*****" tf_provider_addr=registry.terraform.io/hashicorp/aws http.request.header.x_amz_date=20240718T114930Z http.request.header.x_amz_target=AnyScaleFrontendService.PutScalingPolicy http.request.header.amz_sdk_invocation_id=14477f1d-bf52-4569-9be2-2bcab2f2efcb http.request.header.amz_sdk_request="attempt=1; max=25" tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309
  http.request.body=
  | {"PolicyName":"dynamodb-read-capacity-utilization-table/cambiar_example","PolicyType":"TargetTrackingScaling","ResourceId":"table/cambiar_example","ScalableDimension":"dynamodb:table:ReadCapacityUnits","ServiceNamespace":"dynamodb","Targ********************************tion":{"DisableScaleIn":false,"PredefinedMetricSpecification":{"PredefinedMetricType":"DynamoDBReadCapacityUtilization"},"ScaleInCooldown":0,"ScaleOutCooldown":0,"TargetValue":50}}
   http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.9.0 (+https://www.terraform.io) terraform-provider-aws/5.58.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go-v2/1.30.3 os/macos lang/go#1.22.4 md/GOOS#darwin md/GOARCH#amd64 api/applicationautoscaling#1.30.4" http.request.header.content_type=application/x-amz-json-1.1 tf_aws.signing_region="" tf_rpc=ApplyResourceChange http.request_content_length=449 rpc.service="Application Auto Scaling" timestamp="2024-07-18T13:49:30.110+0200"
2024-07-18T13:49:30.110+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: HTTP Request Sent: @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.54/logging/tf_logger.go:45 http.url=https://application-autoscaling.us-east-2.amazonaws.com/ tf_aws.signing_region="" @module=aws http.request.header.x_amz_target=AnyScaleFrontendService.PutScalingPolicy tf_mux_provider="*schema.GRPCProviderServer" tf_rpc=ApplyResourceChange tf_aws.sdk=aws-sdk-go-v2 tf_resource_type=aws_appautoscaling_policy rpc.system=aws-api aws.region=us-east-2 http.request.header.x_amz_date=20240718T114930Z http.request_content_length=452 http.request.header.amz_sdk_request="attempt=1; max=25" http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.9.0 (+https://www.terraform.io) terraform-provider-aws/5.58.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go-v2/1.30.3 os/macos lang/go#1.22.4 md/GOOS#darwin md/GOARCH#amd64 api/applicationautoscaling#1.30.4" net.peer.name=application-autoscaling.us-east-2.amazonaws.com tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 http.method=POST http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA************N6NV/20240718/us-east-2/application-autoscaling/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=*****" http.request.header.x_amz_security_token="*****" rpc.method=PutScalingPolicy
  http.request.body=
  | {"PolicyName":"dynamodb-write-capacity-utilization-table/cambiar_example","PolicyType":"TargetTrackingScaling","ResourceId":"table/cambiar_example","ScalableDimension":"dynamodb:table:WriteCapacityUnits","ServiceNamespace":"dynamodb","Targ********************************tion":{"DisableScaleIn":false,"PredefinedMetricSpecification":{"PredefinedMetricType":"DynamoDBWriteCapacityUtilization"},"ScaleInCooldown":0,"ScaleOutCooldown":0,"TargetValue":50}}
   http.request.header.amz_sdk_invocation_id=823ec3b1-8a16-49c6-bc89-21840fbed127 http.request.header.content_type=application/x-amz-json-1.1 rpc.service="Application Auto Scaling" tf_provider_addr=registry.terraform.io/hashicorp/aws timestamp="2024-07-18T13:49:30.110+0200"
2024-07-18T13:49:30.245+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: HTTP Response Received:
  http.response.body=
  | {"ScalableTargets":[{"CreationTime":1.721302366792E9,"MaxCapacity":900,"MinCapacity":28,"ResourceId":"table/cambiar_example","RoleARN":"arn:aws:iam::487939283316:role/aws-service-role/dynamodb.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_DynamoDBTable","ScalableDimension":"dynamodb:table:WriteCapacityUnits","ScalableTargetARN":"arn:aws:application-autoscaling:us-west-2:487939283316:scalable-target/0d265bf6a762d56f423790b85b580364eda9","ServiceNamespace":"dynamodb","SuspendedState":{"DynamicScalingInSuspended":false,"DynamicScalingOutSuspended":false,"ScheduledScalingSuspended":false}}]}
   http.response.header.content_type=application/x-amz-json-1.1 tf_aws.sdk=aws-sdk-go-v2 tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=4b021a53-2021-778c-9278-8955daa8f621 rpc.service="Application Auto Scaling" rpc.system=aws-api aws.region=us-west-2 http.status_code=200 http.response.header.date="Thu, 18 Jul 2024 11:49:29 GMT" rpc.method=DescribeScalableTargets tf_aws.signing_region="" tf_rpc=ApplyResourceChange @module=aws http.duration=182 http.response_content_length=626 tf_mux_provider="*schema.GRPCProviderServer" tf_resource_type=aws_appautoscaling_target @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.54/logging/tf_logger.go:45 http.response.header.x_amzn_requestid=5254d254-7318-4079-ad1a-804378b061d4 timestamp="2024-07-18T13:49:30.245+0200"
2024-07-18T13:49:30.246+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: HTTP Request Sent: tf_aws.signing_region="" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=4b021a53-2021-778c-9278-8955daa8f621 http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.9.0 (+https://www.terraform.io) terraform-provider-aws/5.58.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go-v2/1.30.3 os/macos lang/go#1.22.4 md/GOOS#darwin md/GOARCH#amd64 api/applicationautoscaling#1.30.4" @module=aws http.method=POST http.request.header.amz_sdk_invocation_id=80bd2ccb-c188-46e3-828f-95eb4e048ae1 http.request.header.x_amz_security_token="*****" http.request.header.x_amz_target=AnyScaleFrontendService.ListTagsForResource net.peer.name=application-autoscaling.us-west-2.amazonaws.com rpc.method=ListTagsForResource rpc.service="Application Auto Scaling" rpc.system=aws-api
  http.request.body=
  | {"ResourceARN":"arn:aws:application-autoscaling:us-west-2:487939283316:scalable-target/0d265bf6a762d56f423790b85b580364eda9"}
   tf_mux_provider="*schema.GRPCProviderServer" http.request.header.content_type=application/x-amz-json-1.1 aws.region=us-west-2 http.request.header.x_amz_date=20240718T114930Z http.request_content_length=125 tf_aws.sdk=aws-sdk-go-v2 @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.54/logging/tf_logger.go:45 http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA************N6NV/20240718/us-west-2/application-autoscaling/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=*****" http.url=https://application-autoscaling.us-west-2.amazonaws.com/ tf_resource_type=aws_appautoscaling_target tf_rpc=ApplyResourceChange http.request.header.amz_sdk_request="attempt=1; max=25" timestamp="2024-07-18T13:49:30.245+0200"
2024-07-18T13:49:30.259+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: HTTP Response Received: http.response.header.content_type=application/x-amz-json-1.1 rpc.system=aws-api tf_provider_addr=registry.terraform.io/hashicorp/aws @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.54/logging/tf_logger.go:45
  http.response.body=
  | {"__type":"ValidationException","Message":"Only one TargetTrackingScaling policy for a given metric specification is allowed."}
   tf_aws.sdk=aws-sdk-go-v2 @module=aws http.duration=148 http.response.header.date="Thu, 18 Jul 2024 11:49:29 GMT" http.response_content_length=127 tf_aws.signing_region="" tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 tf_resource_type=aws_appautoscaling_policy tf_rpc=ApplyResourceChange aws.region=us-east-2 http.response.header.x_amzn_requestid=e806afb3-7de2-491d-ac6d-71eb1b0c045a http.status_code=400 rpc.method=PutScalingPolicy rpc.service="Application Auto Scaling" tf_mux_provider="*schema.GRPCProviderServer" timestamp="2024-07-18T13:49:30.259+0200"
2024-07-18T13:49:30.259+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: request failed with unretryable error https response error StatusCode: 400, RequestID: e806afb3-7de2-491d-ac6d-71eb1b0c045a, ValidationException: Only one TargetTrackingScaling policy for a given metric specification is allowed.: tf_aws.sdk=aws-sdk-go-v2 tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 tf_mux_provider="*schema.GRPCProviderServer" tf_resource_type=aws_appautoscaling_policy @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.54/logging/tf_logger.go:45 @module=aws rpc.service="Application Auto Scaling" tf_provider_addr=registry.terraform.io/hashicorp/aws rpc.system=aws-api tf_rpc=ApplyResourceChange aws.region=us-east-2 rpc.method=PutScalingPolicy timestamp="2024-07-18T13:49:30.259+0200"
2024-07-18T13:49:30.259+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Called downstream: tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:938 tf_resource_type=aws_appautoscaling_policy @module=sdk.helper_schema tf_mux_provider="*schema.GRPCProviderServer" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 timestamp="2024-07-18T13:49:30.259+0200"
2024-07-18T13:49:30.259+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Received downstream response: @module=sdk.proto tf_proto_version=5.6 tf_req_duration_ms=150 tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 tf_resource_type=aws_appautoscaling_policy @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:42 tf_rpc=ApplyResourceChange diagnostic_warning_count=0 tf_provider_addr=registry.terraform.io/hashicorp/aws diagnostic_error_count=1 timestamp="2024-07-18T13:49:30.259+0200"
2024-07-18T13:49:30.259+0200 [ERROR] provider.terraform-provider-aws_v5.58.0_x5: Response contains error diagnostic: diagnostic_severity=ERROR diagnostic_summary="putting Application Auto Scaling Scaling Policy (dynamodb-write-capacity-utilization-table/cambiar_example): operation error Application Auto Scaling: PutScalingPolicy, https response error StatusCode: 400, RequestID: e806afb3-7de2-491d-ac6d-71eb1b0c045a, ValidationException: Only one TargetTrackingScaling policy for a given metric specification is allowed." tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 tf_resource_type=aws_appautoscaling_policy tf_rpc=ApplyResourceChange @module=sdk.proto diagnostic_detail="" tf_proto_version=5.6 tf_provider_addr=registry.terraform.io/hashicorp/aws @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/diag/diagnostics.go:58 timestamp="2024-07-18T13:49:30.259+0200"
2024-07-18T13:49:30.259+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Served request: tf_proto_version=5.6 tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=922766a6-47a0-4b25-7141-79c5665fd622 tf_rpc=ApplyResourceChange @module=sdk.proto tf_resource_type=aws_appautoscaling_policy @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:878 timestamp="2024-07-18T13:49:30.259+0200"
2024-07-18T13:49:30.260+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: HTTP Response Received: rpc.service="Application Auto Scaling" tf_aws.signing_region="" tf_mux_provider="*schema.GRPCProviderServer" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309 @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.54/logging/tf_logger.go:45
  http.response.body=
  | {"__type":"ValidationException","Message":"Only one TargetTrackingScaling policy for a given metric specification is allowed."}
   tf_aws.sdk=aws-sdk-go-v2 aws.region=us-east-2 http.duration=149 http.response.header.content_type=application/x-amz-json-1.1 http.response_content_length=127 rpc.method=PutScalingPolicy tf_rpc=ApplyResourceChange @module=aws http.response.header.date="Thu, 18 Jul 2024 11:49:29 GMT" http.response.header.x_amzn_requestid=41e0d814-8f5c-401f-8d22-c5effaf81b2f http.status_code=400 rpc.system=aws-api tf_resource_type=aws_appautoscaling_policy timestamp="2024-07-18T13:49:30.260+0200"
2024-07-18T13:49:30.260+0200 [DEBUG] provider.terraform-provider-aws_v5.58.0_x5: request failed with unretryable error https response error StatusCode: 400, RequestID: 41e0d814-8f5c-401f-8d22-c5effaf81b2f, ValidationException: Only one TargetTrackingScaling policy for a given metric specification is allowed.: @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.54/logging/tf_logger.go:45 tf_aws.sdk=aws-sdk-go-v2 tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309 tf_resource_type=aws_appautoscaling_policy aws.region=us-east-2 rpc.method=PutScalingPolicy @module=aws tf_mux_provider="*schema.GRPCProviderServer" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_rpc=ApplyResourceChange rpc.service="Application Auto Scaling" rpc.system=aws-api timestamp="2024-07-18T13:49:30.260+0200"
2024-07-18T13:49:30.260+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Called downstream: tf_rpc=ApplyResourceChange @module=sdk.helper_schema tf_mux_provider="*schema.GRPCProviderServer" tf_resource_type=aws_appautoscaling_policy tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309 @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:938 timestamp="2024-07-18T13:49:30.260+0200"
2024-07-18T13:49:30.260+0200 [TRACE] provider.terraform-provider-aws_v5.58.0_x5: Received downstream response: diagnostic_warning_count=0 tf_proto_version=5.6 tf_provider_addr=registry.terraform.io/hashicorp/aws @module=sdk.proto diagnostic_error_count=1 tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309 tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:42 tf_req_duration_ms=151 tf_resource_type=aws_appautoscaling_policy timestamp="2024-07-18T13:49:30.260+0200"
2024-07-18T13:49:30.260+0200 [ERROR] provider.terraform-provider-aws_v5.58.0_x5: Response contains error diagnostic: @module=sdk.proto diagnostic_severity=ERROR tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=870451e5-79a9-b4b1-f412-f9e329394309 @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/diag/diagnostics.go:58 diagnostic_detail="" diagnostic_summary="putting Application Auto Scaling Scaling Policy (dynamodb-read-capacity-utilization-table/cambiar_example): operation error Application Auto Scaling: PutScalingPolicy, https response error StatusCode: 400, RequestID: 41e0d814-8f5c-401f-8d22-c5effaf81b2f, ValidationException: Only one TargetTrackingScaling policy for a given metric specification is allowed." tf_proto_version=5.6 tf_resource_type=aws_appautoscaling_policy tf_rpc=ApplyResourceChange timestamp="2024-07-18T13:49:30.260+0200"

Panic Output

No response

Important Factoids

No response

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/appautoscalingIssues and PRs that pertain to the appautoscaling service.service/dynamodbIssues and PRs that pertain to the dynamodb service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions