-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Prevent modification of backup plan rule.schedule #8737
Comments
I am also running into this bug. My workaround is to manually remove the plan and have terraform recreate it.
|
Also getting this. Changing from: resource "aws_backup_plan" "advanced" {
name = "${var.environment}-Advanced"
rule {
rule_name = "Daily"
target_vault_name = "${aws_backup_vault.advanced.id}"
schedule = "cron(0 5 ? * 1-5,7 *)"
start_window = 60
completion_window = 360
recovery_point_tags = {
BackupRule = "Daily"
BackupVault = "${aws_backup_vault.advanced.id}"
Environment = "${var.environment}"
}
lifecycle {
delete_after = 7
}
}
rule {
rule_name = "Weekly"
target_vault_name = "${aws_backup_vault.advanced.id}"
schedule = "cron(0 5 ? * 6 *)"
start_window = 60
completion_window = 3600
recovery_point_tags = {
BackupRule = "Weekly"
BackupVault = "${aws_backup_vault.advanced.id}"
Environment = "${var.environment}"
}
lifecycle {
cold_storage_after = 60
delete_after = 180
}
}
tags = {
BackupPlan = "${var.environment}-Advanced"
Environment = "${var.environment}"
ServiceProvider = "Rackspace"
Terraform = "true"
}
} To: resource "aws_backup_plan" "advanced" {
name = "${var.environment}-Advanced"
rule {
rule_name = "Daily"
target_vault_name = "${aws_backup_vault.advanced.id}"
schedule = "cron(0 2 ? * 1-5,7 *)" # CHANGE HERE
start_window = 60
completion_window = 360
recovery_point_tags = {
BackupRule = "Daily"
BackupVault = "${aws_backup_vault.advanced.id}"
Environment = "${var.environment}"
}
lifecycle {
delete_after = 7
}
}
rule {
rule_name = "Weekly"
target_vault_name = "${aws_backup_vault.advanced.id}"
schedule = "cron(0 2 ? * 6 *)" # CHANGE HERE
start_window = 60
completion_window = 3600
recovery_point_tags = {
BackupRule = "Weekly"
BackupVault = "${aws_backup_vault.advanced.id}"
Environment = "${var.environment}"
}
lifecycle {
cold_storage_after = 60
delete_after = 180
}
}
tags = {
BackupPlan = "${var.environment}-Advanced"
Environment = "${var.environment}"
ServiceProvider = "Rackspace"
Terraform = "true"
}
} Results in:
UPDATE: on a more basic example this doesn't appear to happen. This: resource "aws_backup_plan" "basic" {
name = "${var.environment}-Basic"
rule {
rule_name = "Daily"
target_vault_name = "${aws_backup_vault.basic.id}"
schedule = "cron(0 5 ? * * *)"
}
} To this: resource "aws_backup_plan" "basic" {
name = "${var.environment}-Basic"
rule {
rule_name = "Daily"
target_vault_name = "${aws_backup_vault.basic.id}"
schedule = "cron(0 5 ? * * *)"
}
rule {
rule_name = "Weekly"
target_vault_name = "${aws_backup_vault.basic.id}"
schedule = "cron(0 5 ? * * *)"
}
} To this: resource "aws_backup_plan" "basic" {
name = "${var.environment}-Basic"
rule {
rule_name = "Daily"
target_vault_name = "${aws_backup_vault.basic.id}"
schedule = "cron(0 6 ? * * *)" # CHANGE HERE
}
rule {
rule_name = "Weekly"
target_vault_name = "${aws_backup_vault.basic.id}"
schedule = "cron(0 5 ? * * *)"
}
} And back to a single rule again causes no errors. |
Updated module syntax and tried using v0.12.1 = Same thing. |
This is the same error as #8431. |
The fixes for these issues has been merged and will release with version 2.34.0 of the Terraform AWS Provider, on Thursday. Thanks to @ewbankkit for the implementation. |
This has been released in version 2.34.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
v0.11.14
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
1 error occurred:
* module.aws-backup.aws_backup_plan.this: 1 error occurred:
* aws_backup_plan.this: error updating Backup Plan: InvalidParameter: 2 validation error(s) found.
Expected Behavior
The schedule settings should've changed with the configuration that originally created the schedule.
Actual Behavior
The updated schedule does not get applied.
Steps to Reproduce
Create a backup plan with a set schedule. Once created and deployed, change the schedule by adding a minute or changing the hour.
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: