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

aws_backup_plan enable_continuous_backup rule with no schedule set causes permanent diff #22627

Closed
tomelliff opened this issue Jan 17, 2022 · 3 comments
Labels
bug Addresses a defect in current functionality. service/backup Issues and PRs that pertain to the backup service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@tomelliff
Copy link
Contributor

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

Affected Resource(s)

  • aws_backup_plan

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_backup_plan" "example" {
  name = "example"

  rule {
    rule_name                = "continuous"
    target_vault_name        = "Default"
    enable_continuous_backup = true
    # schedule                 = "cron(0 5 ? * * *)"

    lifecycle {
      delete_after       = 35
    }
  }
}

Expected Behavior

With the schedule commented out, it should apply and not have a diff.

Actual Behavior

With the schedule not set or commented out it applies but then there is a perpetual diff as Terraform attempts to force it to remove the schedule that AWS automatically sets when it's not present even when that doesn't make sense, such as with a continuous backup rule:

  # aws_backup_plan.example will be updated in-place
  ~ resource "aws_backup_plan" "example" {
        id       = "aeb67d66-c6a8-4144-83ea-13e14c576824"
        name     = "example"
        tags     = {}
        # (3 unchanged attributes hidden)

      - rule {
          - completion_window        = 180 -> null
          - enable_continuous_backup = true -> null
          - recovery_point_tags      = {} -> null
          - rule_name                = "continuous" -> null
          - schedule                 = "cron(0 5 ? * * *)" -> null
          - start_window             = 60 -> null
          - target_vault_name        = "Default" -> null

          - lifecycle {
              - cold_storage_after = 0 -> null
              - delete_after       = 35 -> null
            }
        }
      + rule {
          + completion_window        = 180
          + enable_continuous_backup = true
          + rule_name                = "continuous"
          + start_window             = 60
          + target_vault_name        = "Default"

          + lifecycle {
              + delete_after = 35
            }
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Uncommenting the schedule parameter makes the diff go away.

Steps to Reproduce

  1. terraform apply

References

  • #0000
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/backup Issues and PRs that pertain to the backup service. labels Jan 17, 2022
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 22, 2022
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jan 15, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2024
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 Mar 16, 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/backup Issues and PRs that pertain to the backup service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

3 participants