hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.76k stars 9.11k forks source link

[Bug]: aws_appautoscaling_scheduled_action pulling incorrect values on read from api #36098

Closed colinfish-toast closed 6 months ago

colinfish-toast commented 6 months ago

Terraform Core Version

1.7.4

AWS Provider Version

5.39.1

Affected Resource(s)

Expected Behavior

Actual Behavior

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

provider "aws" {
  version = "5.39.1"
  region  = "us-east-1"
}

resource "aws_dynamodb_table" "example" {
  name           = "example"
  hash_key       = "id"
  billing_mode   = "PROVISIONED"
  read_capacity  = 5
  write_capacity = 5

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

resource "aws_appautoscaling_target" "read" {
  service_namespace  = "dynamodb"
  resource_id        = "table/${aws_dynamodb_table.example.name}"
  scalable_dimension = "dynamodb:table:ReadCapacityUnits"
  min_capacity       = 5
  max_capacity       = 10
}

resource "aws_appautoscaling_target" "write" {
  service_namespace  = "dynamodb"
  resource_id        = "table/${aws_dynamodb_table.example.name}"
  scalable_dimension = "dynamodb:table:WriteCapacityUnits"
  min_capacity       = 5
  max_capacity       = 10
}
resource "aws_appautoscaling_scheduled_action" "scale_up_read" {
  name               = "same-action-name"
  service_namespace  = "dynamodb"
  resource_id        = "table/${aws_dynamodb_table.example.name}"
  scalable_dimension = "dynamodb:table:ReadCapacityUnits"
  schedule           = "at(2024-01-01T00:00:00)"
  scalable_target_action {
    min_capacity = 10
    max_capacity = 10
  }
}

resource "aws_appautoscaling_scheduled_action" "scale_up_write" {
  name               = "same-action-name"
  service_namespace  = "dynamodb"
  resource_id        = "table/${aws_dynamodb_table.example.name}"
  scalable_dimension = "dynamodb:table:WriteCapacityUnits"
  schedule           = "at(2024-01-01T00:00:00)"
  scalable_target_action {
    min_capacity = 10
    max_capacity = 10
  }
}

Steps to Reproduce

Steps to Reproduce the Issue:

  1. Initialize Terraform: terraform init
  2. Apply the Terraform configuration: terraform apply
  3. After applying, run terraform plan and observe if there is a diff for the ScalableDimension "dynamodb:index:WriteCapacityUnits".

Debug Output

n/a

Panic Output

n/a

Important Factoids

No response

References

Re-opens issue #33873 Fix is pending in PR #34382

Would you like to implement a fix?

None

github-actions[bot] commented 6 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 6 months ago

This functionality has been released in v5.42.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 5 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.