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]: Changing to IO2 storage on RDS instance fails #36648

Closed
nhenjes opened this issue Mar 29, 2024 · 4 comments · Fixed by #37257
Closed

[Bug]: Changing to IO2 storage on RDS instance fails #36648

nhenjes opened this issue Mar 29, 2024 · 4 comments · Fixed by #37257
Assignees
Labels
bug Addresses a defect in current functionality. service/kms Issues and PRs that pertain to the kms service. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@nhenjes
Copy link
Contributor

nhenjes commented Mar 29, 2024

Terraform Core Version

1.4.6

AWS Provider Version

5.40.0

Affected Resource(s)

  • resource/aws_db_instance

Expected Behavior

We should be able to switch from gp3 with provisioned iops to io2 without changing the allocated storage

Actual Behavior

When changing from gp3 to io2, AWS expects the allocated storage to be passed. Because this value didn't change however, the call to the AWS API excludes the allocated storage value and produces the error

│ Error: updating RDS DB Instance (<database-name>): operation error RDS: ModifyDBInstance, https response error StatusCode: 400, RequestID: <request-id>, api error InvalidParameterCombination: You must specify both the storage size and iops when modifying the storage size or iops on a DB instance that has iops.

Creating a new database with io2 works however because it's a new value that Terraform passes to the API

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

data "aws_rds_orderable_db_instance" "custom-sqlserver" {
  engine                     = "custom-sqlserver-se"
  engine_version             = "15.00.4249.2.v1"
  storage_type               = "gp3"
  preferred_instance_classes = ["db.r5.xlarge", "db.r5.2xlarge", "db.r5.4xlarge"]
}

# The RDS instance resource requires an ARN. Look up the ARN of the KMS key.
data "aws_kms_key" "by_id" {
  key_id = "example-ef278353ceba4a5a97de6784565b9f78" # KMS key
}

resource "aws_db_instance" "example" {
  allocated_storage                     = 500
  auto_minor_version_upgrade  = false
  custom_iam_instance_profile = "AWSRDSCustomSQLServerInstanceProfile"
  backup_retention_period        = 7
  db_subnet_group_name          = local.db_subnet_group_name # Copy the subnet group from the RDS Console
  engine                                        = data.aws_rds_orderable_db_instance.custom-sqlserver.engine
  engine_version                          = data.aws_rds_orderable_db_instance.custom-sqlserver.engine_version
  identifier                                     = "sql-instance-demo"
  instance_class                           = data.aws_rds_orderable_db_instance.custom-sqlserver.instance_class
  kms_key_id                                = data.aws_kms_key.by_id.arn
  multi_az                                      = false # Custom for SQL Server does support multi-az
  password                                    = "avoid-plaintext-passwords"
  storage_encrypted                    = true
  storage_type.                             = "gp3"
  username                                    = "test"

  timeouts {
    create = "3h"
    delete = "3h"
    update = "3h"
  }
}

Steps to Reproduce

Create an RDS instance with gp3, then change only the storage type from gp3 to io2

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

@nhenjes nhenjes added the bug Addresses a defect in current functionality. label Mar 29, 2024
Copy link

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/kms Issues and PRs that pertain to the kms service. service/rds Issues and PRs that pertain to the rds service. labels Mar 29, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 29, 2024
@justinretzolk justinretzolk removed service/kms Issues and PRs that pertain to the kms service. needs-triage Waiting for first response or review from a maintainer. labels Apr 1, 2024
@github-actions github-actions bot added the service/kms Issues and PRs that pertain to the kms service. label May 3, 2024
@YakDriver YakDriver self-assigned this Nov 22, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 22, 2024
@github-actions github-actions bot added this to the v5.78.0 milestone Nov 22, 2024
Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 26, 2024
Copy link

This functionality has been released in v5.78.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 Dec 27, 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/kms Issues and PRs that pertain to the kms service. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
3 participants