Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
colinfish-toast opened this issue Mar 5, 2024 · 3 comments · Fixed by #34382
Closed
Labels
bug Addresses a defect in current functionality. service/appautoscaling Issues and PRs that pertain to the appautoscaling service.
Milestone

Comments

@colinfish-toast
Copy link
Contributor

Terraform Core Version

1.7.4

AWS Provider Version

5.39.1

Affected Resource(s)

  • aws_appautoscaling_scheduled_action

Expected Behavior

  • Set up scheduled actions with the same name on the same dynamodb table for both table read and write.
  • The subsequent plan, terraform should show no changes required.

Actual Behavior

  • Set up scheduled actions with the same name on the same dynamodb table for both table read and write.
  • The subsequent plan, terraform show's a diff on the scheduled action for "ScalableDimension": "dynamodb:index:WriteCapacityUnits"
    • Old value matches whatever was set for the ReadCapacityUnits scalable dimension.

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

@colinfish-toast colinfish-toast added the bug Addresses a defect in current functionality. label Mar 5, 2024
Copy link

github-actions bot commented Mar 5, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/appautoscaling Issues and PRs that pertain to the appautoscaling service. service/dynamodb Issues and PRs that pertain to the dynamodb service. labels Mar 5, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 5, 2024
@justinretzolk justinretzolk removed service/dynamodb Issues and PRs that pertain to the dynamodb service. needs-triage Waiting for first response or review from a maintainer. labels Mar 7, 2024
@github-actions github-actions bot added this to the v5.42.0 milestone Mar 18, 2024
Copy link

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!

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/appautoscaling Issues and PRs that pertain to the appautoscaling service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants