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

Aurora Serverless "BackupWindow" parameter not working #81

Open
sebastianmacarescu opened this issue Sep 21, 2020 · 6 comments
Open

Aurora Serverless "BackupWindow" parameter not working #81

sebastianmacarescu opened this issue Sep 21, 2020 · 6 comments
Labels
bug 🐛 An issue with the system

Comments

@sebastianmacarescu
Copy link

sebastianmacarescu commented Sep 21, 2020

Describe the Bug

It seems like AWS does not support (or maybe is bugged) "preferred_maintenance_window " and "preferred_backup_window"
Existing AWS issue: aws-cloudformation/cloudformation-coverage-roadmap#396
This was also reported internally in AWS team

Expected Behavior

Everything should work as expected

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Run '....'
  3. Enter '....'
  4. See error

Screenshots

Create a serverless database from a snapshot. Right after it's finished terraform will throw:
Error: error modifying RDS Cluster (tc-staging-shared-main-rds): InvalidParameterCombination: You currently can't modify BackupWindow with Aurora Serverless. status code: 400, request id: aa5042ba-f0be-49ea-a695-e68da91a01f8

If you run terraform again it will say the cluster is tainted and must be replaced.
Moreover a lot of values are just wrong. The created resource has totally different values than specified in terraform code:

  • backup_retention_period (1 day instead of configured 7)
  • preferred_backup_window
  • preferred_maintenance_window
  • master_username (the module passes a default but the instance was created from a snapshot)

image
image

Environment (please complete the following information):

  • OS: Windows 10

Additional Context

I think you could have a dedicated resource for serverless clusters with the above fields omitted

@sebastianmacarescu sebastianmacarescu added the bug 🐛 An issue with the system label Sep 21, 2020
@aknysh
Copy link
Member

aknysh commented Sep 23, 2020

@sebastianmacarescu thanks for reporting this.
Will it work if you just set all those parameters to null?

@sebastianmacarescu
Copy link
Author

Tried to set it to null but I get validation error, preferred_maintenance_window must be of format ...

@joshuabalduff
Copy link
Sponsor

+1

@nitrocode
Copy link
Member

From this commit e82b41f

@joshmello @sebastianmacarescu does it work if you tried setting the following to null ?

  maintenance_window = null
  backup_window      = null
  retention_period   = null

@sebastianmacarescu
Copy link
Author

@nitrocode when I tested last year no, it did not work setting to null.
Got validation error, preferred_maintenance_window must be of format ...

@nitrocode
Copy link
Member

nitrocode commented Feb 19, 2022

It seems like an aws api issue. A serverless aurora does have these parameters and these can be modified in the browser but not from the aws api. The workaround from the issue you linked above is to comment out the preferred parameters and we do that in terraform by setting them to null which seems to error out because of a presumably API bug... not much we can do here since a dynamic only works on blocks and not root level arguments.

You can see from the below code we're passing in the input vars unaltered to the corresponding resource.

preferred_backup_window = var.backup_window

preferred_maintenance_window = var.maintenance_window

preferred_backup_window = var.backup_window

preferred_maintenance_window = var.maintenance_window

Looks like a user has documented that serverless engine mode has a few limitations which could be worked around by the aws provider.

aws-cloudformation/cloudformation-coverage-roadmap#396 (comment)

@joshmello @sebastianmacarescu you may have better luck creating another ticket with the aws provider. When you do, please include a minimal example using the raw resource aws_rds_cluster to reproduce the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

4 participants