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

v3.20.0 breaks already running AWS Back configuration #16583

Closed
arnvid opened this issue Dec 4, 2020 · 16 comments · Fixed by #16605
Closed

v3.20.0 breaks already running AWS Back configuration #16583

arnvid opened this issue Dec 4, 2020 · 16 comments · Fixed by #16605
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/backup Issues and PRs that pertain to the backup service.
Milestone

Comments

@arnvid
Copy link

arnvid commented Dec 4, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.12.29

  • provider.aws v3.20.0
  • provider.datadog v2.17.0
  • provider.external v2.0.0
  • provider.local v2.0.0
  • provider.null v3.0.0

Terraform v0.13.5

  • provider registry.terraform.io/arnvid/appstream v1.0.8
  • provider registry.terraform.io/hashicorp/archive v2.0.0
  • provider registry.terraform.io/hashicorp/aws v3.20.0
  • provider registry.terraform.io/hashicorp/local v2.0.0
  • provider registry.terraform.io/hashicorp/random v3.0.0
  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/hashicorp/time v0.6.0

Affected Resource(s)

aws_backup_plan

Terraform Configuration Files

resource "aws_backup_plan" "default" {
  name = "deep_default_backup_plan"
  rule {
    rule_name         = "default"
    target_vault_name = aws_backup_vault.this.id
    schedule          = "cron(0 0 * * ? *)"
    lifecycle {
      delete_after = "14"
    }
  }
}```

### Expected Behavior

Plan to create or update a backup plan

### Actual Behavior

Error: expected rule.0.lifecycle.0.delete_after to be at least (90), got 14

### References
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_plan

For lifecycle the following attributes are supported:

cold_storage_after - (Optional) Specifies the number of days after creation that a recovery point is moved to cold storage.
delete_after - (Optional) Specifies the number of days after creation that a recovery point is deleted. Must be 90 days greater than cold_storage_after.

* #0000
@ghost ghost added the service/backup Issues and PRs that pertain to the backup service. label Dec 4, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 4, 2020
@arnvid
Copy link
Author

arnvid commented Dec 4, 2020

Setting it to 90 removes the error but shows this little thing:
- rule {
- lifecycle {
- cold_storage_after = 0 -> null
- delete_after = 30 -> null
}
}
+ rule {
+ lifecycle {
+ delete_after = 90
}

@anGie44 anGie44 added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 4, 2020
@XDanny322
Copy link

FWIW, going back to 3.19 (not3.20).. worked for me

provider "aws" {
  # Pinned due to https://github.com/hashicorp/terraform-provider-aws/issues/16583
  version = "~> 3.0,!= 3.20"
  region  = var.region
}

@emanuelr93
Copy link

Same issue also for me +1

@bflad
Copy link
Contributor

bflad commented Dec 4, 2020

There has been some prior history with this particular API handling: #8151 (comment)

@tfmm
Copy link

tfmm commented Dec 4, 2020

+1 breaking several production configurations

@abebars
Copy link
Contributor

abebars commented Dec 4, 2020

The same issue also for me +1

@DrFaust92
Copy link
Collaborator

@arnvid
Copy link
Author

arnvid commented Dec 4, 2020

Introduced by #16476 according to https://docs.aws.amazon.com/aws-backup/latest/devguide/API_Lifecycle.html

The current change acts like it would be mandatory to keep a backup for 90 days even cold storage is not used

@DrFaust92
Copy link
Collaborator

Ill open up a follow up PR to remove validation.

@Spenser309
Copy link

+1 here affected by this as well. using 3.19.0 fixes the issue for me.

@caiohasouza
Copy link

+1

1 similar comment
@mattialepriberluti
Copy link

+1

@dthvt
Copy link
Contributor

dthvt commented Dec 8, 2020

Hey guys, no need to add "+1" comments. Just add yourself to the thumbs up emoji reaction to the main issue description. That helps the team prioritize issues w/o constant comment spam that doesn't add anything to the technical discussion.

@anGie44 anGie44 added this to the v3.21.0 milestone Dec 9, 2020
@anGie44
Copy link
Contributor

anGie44 commented Dec 9, 2020

Hi @arnvid et al., we've merged in a fix that will prevent these plan-time validations. Expect it out in v3.21.0 of the AWS Provider, likely out this Thursday.

@ghost
Copy link

ghost commented Dec 11, 2020

This has been released in version 3.21.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 for triage. Thanks!

@ghost
Copy link

ghost commented Jan 9, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators Jan 9, 2021
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. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/backup Issues and PRs that pertain to the backup service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.