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

RDSv3: Error "missing input for argument [KeepDays]" when keep_days is 0 #2262

Closed
kaibernhard opened this issue Aug 11, 2023 · 4 comments
Closed
Assignees

Comments

@kaibernhard
Copy link

Terraform provider version

1.35.5

Affected Resource(s)

  • opentelekomcloud_rds_instance_v3

Terraform Configuration Files

The issue can be reproduced with the example Create a single db instance.

Steps to Reproduce

  • prepare cluster, provide vars for example (availability_zone, subnet_id, vpc_id)
  • change keep_days = 1 to keep_days = 0
  • run terraform apply and note that the error only occurs after confirming yes, not before, and not when running terraform plan.

Expected Behavior

terraform apply succeeds without errors, since the documentation for keep_days claims the value range is from 0 to 732 and terraform plan succeeds.

Actual Behavior

terraform apply fails:

opentelekomcloud_rds_instance_v3.instance: Still creating... [5m0s elapsed]
╷
│ Error: error updating OpenTelekomCloud RDSv3 Backup Strategy: error building request body: missing input for argument [KeepDays]
│ 
│   with opentelekomcloud_rds_instance_v3.instance,
│   on main.tf line 31, in resource "opentelekomcloud_rds_instance_v3" "instance":
│   31: resource "opentelekomcloud_rds_instance_v3" "instance" {
│ 
╵
@artem-lifshits artem-lifshits self-assigned this Aug 11, 2023
otc-zuul bot pushed a commit that referenced this issue Aug 14, 2023
RDS: Fix `keep_days` zero values

Summary of the Pull Request
Fix resource break when keep_days is set to 0.
PR Checklist

 Refers to: #2262
 Tests passed.
 Release notes added.

Acceptance Steps Performed
=== RUN   TestAccRdsPostgre13V3ParamsBasic
--- PASS: TestAccRdsPostgre13V3ParamsBasic (457.13s)
=== RUN   TestAccRdsInstanceV3Basic
--- PASS: TestAccRdsInstanceV3Basic (836.01s)
PASS

Process finished with the exit code 0

Reviewed-by: Aloento
@artem-lifshits
Copy link
Member

Hello @kaibernhard please check latest.

@kaibernhard
Copy link
Author

Hello @artem-lifshits, thank you very much for your help. I don't see the error message any longer with 1.35.6, but it doesn't seem to apply the change to 0. So, if the setting was at a non-zero value, and I want to change it to 0, there is no error message and terraform apply completes, but when I run terraform apply again, it detects the non-zero value and wants to change to 0 again, and again, and again. When checking in OTC console, the backup policy still shows Automated Backup enabled - I would expect that to be disabled with keep_days = 0.

otc-zuul bot pushed a commit that referenced this issue Aug 28, 2023
…2286)

[RDS]: fix `keep_days` update for `opentelekomcloud_rds_instance_v3`

Summary of the Pull Request
Fix keep_days update when changing from 1 to 0 value.
PR Checklist

 Refers to: #2262
 Tests passed.
 Release notes added.

Acceptance Steps Performed
=== RUN   TestAccRdsInstanceV3Basic
--- PASS: TestAccRdsInstanceV3Basic (762.16s)
=== RUN   TestAccRdsPostgre13V3ParamsBasic
--- PASS: TestAccRdsPostgre13V3ParamsBasic (533.63s)
=== RUN   TestAccRdsInstanceV3ElasticIP
--- PASS: TestAccRdsInstanceV3ElasticIP (761.48s)
=== RUN   TestAccRdsInstanceV3OptionalParams
--- PASS: TestAccRdsInstanceV3OptionalParams (394.23s)
=== RUN   TestAccRdsInstanceV3Backup
--- PASS: TestAccRdsInstanceV3Backup (359.66s)
PASS

Process finished with exit code 0

Reviewed-by: Vladimir Vshivkov
Reviewed-by: Anton Sidelnikov
Reviewed-by: Aloento
@artem-lifshits
Copy link
Member

@kaibernhard please check the latest release.

@kaibernhard
Copy link
Author

Fix confirmed, thank you @artem-lifshits!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants