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

Exception is raised when building a backup plan and vault together (non-deterministically) #8193

Closed
nayyara-cropsey opened this issue Apr 4, 2019 · 8 comments · Fixed by #10641
Labels
bug Addresses a defect in current functionality. service/backup Issues and PRs that pertain to the backup service.
Milestone

Comments

@nayyara-cropsey
Copy link

nayyara-cropsey commented Apr 4, 2019

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 "me too" comments, 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 Version

Terraform v0.11.11

Affected Resource(s)

  • aws_backup_plan

Terraform Configuration Files

locals {
    tier_1_id = "PlatformTier1"
}

resource "aws_backup_vault" "tier_1_vault" {
    name        = "PlatformTier1Vault"
    kms_key_arn = "${var.tier_1_kms_key}"
    tags        = {
        BackupPlan  = "${local.tier_1_id}"
        Environment = "${var.environment}"
    }
}

resource aws_backup_plan "tier_1_plan" {


    name = "PlatformTier1Backup"
    rule = {
        rule_name           = "Tier1DefaultRule"
        target_vault_name   = "${aws_backup_vault.tier_1_vault.name}"
        schedule            = "cron(0 12 * * ? *)"
        recovery_point_tags = {
            BackupPlan  = "${local.tier_1_id}"
            Environment = "${var.environment}"
        }
    }

    tags = {
        BackupPlan  = "${local.tier_1_id}"
        Environment = "${var.environment}"
    }
}

Debug Output

Panic Output

aws_backup_vault.tier_1_vault: Creating...
  arn:              "" => "<computed>"
  kms_key_arn:      "" => "arn:aws:kms:us-east-1:****:key/*****"
  name:             "" => "PlatformTier1Vault"
  recovery_points:  "" => "<computed>"
  tags.%:           "" => "2"
  tags.BackupPlan:  "" => "PlatformTier1"
  tags.Environment: "" => "staging"
aws_backup_vault.tier_1_vault: Creation complete after 1s (ID: PlatformTier1Vault)

Error: Error applying plan:

1 error(s) occurred:

* aws_backup_plan.tier_1_plan: aws_backup_plan.tier_1_plan: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

Please include the following information in your report:

    Terraform Version: 0.11.11
    Resource ID: aws_backup_plan.tier_1_plan
    Mismatch reason: attribute mismatch: rule.1777926588.completion_window
    Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"rule.1777926588.schedule":*terraform.ResourceAttrDiff{Old:"", New:"cron(0 12 * * ? *)", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1777926588.recovery_point_tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.recovery_point_tags.%":*terraform.ResourceAttrDiff{Old:"0", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.target_vault_name":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1Vault", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1777926588.recovery_point_tags.BackupPlan":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1777926588.start_window":*terraform.ResourceAttrDiff{Old:"", New:"60", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1777926588.recovery_point_tags.Environment":*terraform.ResourceAttrDiff{Old:"", New:"staging", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1777926588.rule_name":*terraform.ResourceAttrDiff{Old:"", New:"Tier1DefaultRule", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "version":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.recovery_point_tags.BackupPlan":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1777926588.lifecycle.#":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "name":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1Backup", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.BackupPlan":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.start_window":*terraform.ResourceAttrDiff{Old:"", New:"60", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.rule_name":*terraform.ResourceAttrDiff{Old:"", New:"Tier1DefaultRule", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.recovery_point_tags.Environment":*terraform.ResourceAttrDiff{Old:"", New:"staging", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.schedule":*terraform.ResourceAttrDiff{Old:"", New:"cron(0 12 * * ? *)", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.lifecycle.#":*terraform.ResourceAttrDiff{Old:"0", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1777926588.target_vault_name":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1Vault", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.Environment":*terraform.ResourceAttrDiff{Old:"", New:"staging", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1777926588.completion_window":*terraform.ResourceAttrDiff{Old:"", New:"180", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.completion_window":*terraform.ResourceAttrDiff{Old:"", New:"180", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
    Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"rule.1267605411.rule_name":*terraform.ResourceAttrDiff{Old:"", New:"Tier1DefaultRule", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.completion_window":*terraform.ResourceAttrDiff{Old:"", New:"180", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.recovery_point_tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "version":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.target_vault_name":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1Vault", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.Environment":*terraform.ResourceAttrDiff{Old:"", New:"staging", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.start_window":*terraform.ResourceAttrDiff{Old:"", New:"60", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.BackupPlan":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.schedule":*terraform.ResourceAttrDiff{Old:"", New:"cron(0 12 * * ? *)", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.recovery_point_tags.BackupPlan":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "name":*terraform.ResourceAttrDiff{Old:"", New:"PlatformTier1Backup", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "rule.1267605411.lifecycle.#":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.1267605411.recovery_point_tags.Environment":*terraform.ResourceAttrDiff{Old:"", New:"staging", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}

Also include as much context as you can about your config, state, and the steps you performed to trigger this error.


Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.


make: *** [apply_backup] Error 1

Expected Behavior

aws_backup_vault.tier_1_vault: Refreshing state... (ID: PlatformTier1Vault)
aws_backup_plan.tier_1_plan: Creating...
  arn:                                             "" => "<computed>"
  name:                                            "" => "PlatformTier1Backup"
  rule.#:                                          "" => "1"
  rule.1267605411.completion_window:               "" => "180"
  rule.1267605411.lifecycle.#:                     "" => "0"
  rule.1267605411.recovery_point_tags.%:           "" => "2"
  rule.1267605411.recovery_point_tags.BackupPlan:  "" => "PlatformTier1"
  rule.1267605411.recovery_point_tags.Environment: "" => "staging"
  rule.1267605411.rule_name:                       "" => "Tier1DefaultRule"
  rule.1267605411.schedule:                        "" => "cron(0 12 * * ? *)"
  rule.1267605411.start_window:                    "" => "60"
  rule.1267605411.target_vault_name:               "" => "PlatformTier1Vault"
  tags.%:                                          "" => "2"
  tags.BackupPlan:                                 "" => "PlatformTier1"
  tags.Environment:                                "" => "staging"
  version:                                         "" => "<computed>"
aws_backup_plan.tier_1_plan: Creation complete after 1s (ID: 5940809d-90a7-466e-96be-76482a43bccf)

Actual Behavior

Fails sometimes but works other times (first time fails and second time works)

Steps to Reproduce

Use the code above and run terraform apply. First time it fails and there after it will pass intermittently.

Important Factoids

References

N/A

@bflad bflad added bug Addresses a defect in current functionality. service/backup Issues and PRs that pertain to the backup service. labels Apr 4, 2019
@nayyara-cropsey
Copy link
Author

I noticed that I get 2 rules created when I have 2 tags (even though the plans says it created one rule).

@tsiq-brianvs
Copy link

tsiq-brianvs commented Apr 8, 2019

I was able to reproduce the same issue with just the aws_backup_plan resource, no aws_backup_vault. Only when I had tags, though.

Terraform Version

Terraform v0.11.13

Terraform Configuration Files

locals {
  required_tags = {
    tag1 = "val1"
    tag2 = "val2"
  }
}

resource "aws_backup_plan" "test" {
  name = "bvs-test-plan-tf"

  rule {
    rule_name         = "bvs-test-rule"
    target_vault_name = "Default"
    schedule          = "rate(12 hours)"

    recovery_point_tags = "${local.required_tags}"
  }

  tags = "${local.required_tags}"
}

Panic Output

Error: Error applying plan:

1 error(s) occurred:

* aws_backup_plan.test: aws_backup_plan.test: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

Please include the following information in your report:

    Terraform Version: 0.11.13
    Resource ID: aws_backup_plan.test
    Mismatch reason: attribute mismatch: rule.908265715.completion_window
    Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "name":*terraform.ResourceAttrDiff{Old:"", New:"bvs-test-plan-tf", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "rule.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.completion_window":*terraform.ResourceAttrDiff{Old:"", New:"180", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.lifecycle.#":*terraform.ResourceAttrDiff{Old:"0", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.recovery_point_tags.%":*terraform.ResourceAttrDiff{Old:"0", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.recovery_point_tags.tag1":*terraform.ResourceAttrDiff{Old:"", New:"val1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.recovery_point_tags.tag2":*terraform.ResourceAttrDiff{Old:"", New:"val2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.rule_name":*terraform.ResourceAttrDiff{Old:"", New:"bvs-test-rule", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.schedule":*terraform.ResourceAttrDiff{Old:"", New:"rate(12 hours)", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.start_window":*terraform.ResourceAttrDiff{Old:"", New:"60", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.target_vault_name":*terraform.ResourceAttrDiff{Old:"", New:"Default", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.completion_window":*terraform.ResourceAttrDiff{Old:"", New:"180", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.lifecycle.#":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.recovery_point_tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.recovery_point_tags.tag1":*terraform.ResourceAttrDiff{Old:"", New:"val1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.recovery_point_tags.tag2":*terraform.ResourceAttrDiff{Old:"", New:"val2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.rule_name":*terraform.ResourceAttrDiff{Old:"", New:"bvs-test-rule", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.schedule":*terraform.ResourceAttrDiff{Old:"", New:"rate(12 hours)", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.start_window":*terraform.ResourceAttrDiff{Old:"", New:"60", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.908265715.target_vault_name":*terraform.ResourceAttrDiff{Old:"", New:"Default", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.tag1":*terraform.ResourceAttrDiff{Old:"", New:"val1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.tag2":*terraform.ResourceAttrDiff{Old:"", New:"val2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "version":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
    Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "name":*terraform.ResourceAttrDiff{Old:"", New:"bvs-test-plan-tf", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "rule.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.completion_window":*terraform.ResourceAttrDiff{Old:"", New:"180", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.lifecycle.#":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.recovery_point_tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.recovery_point_tags.tag1":*terraform.ResourceAttrDiff{Old:"", New:"val1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.recovery_point_tags.tag2":*terraform.ResourceAttrDiff{Old:"", New:"val2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.rule_name":*terraform.ResourceAttrDiff{Old:"", New:"bvs-test-rule", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.schedule":*terraform.ResourceAttrDiff{Old:"", New:"rate(12 hours)", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.start_window":*terraform.ResourceAttrDiff{Old:"", New:"60", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "rule.3857049324.target_vault_name":*terraform.ResourceAttrDiff{Old:"", New:"Default", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.tag1":*terraform.ResourceAttrDiff{Old:"", New:"val1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.tag2":*terraform.ResourceAttrDiff{Old:"", New:"val2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "version":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}

Also include as much context as you can about your config, state, and the steps you performed to trigger this error.

@simonvassella
Copy link

I'm not getting this issue but one that feels related, in that if Recovery Point Tags are specified then the initial apply works fine however any consequent ones fail each time with the below error whether there are changes to the code or not:

  • aws_backup_plan.example: error updating Backup Plan: InvalidParameter: 2 validation error(s) found.
  • missing required field, UpdateBackupPlanInput.BackupPlan.Rules[0].RuleName.
  • missing required field, UpdateBackupPlanInput.BackupPlan.Rules[0].TargetBackupVaultName.

If I don't specify a Recovery Point Tag it works every time. Makes me wonder if its all connected to the Recovery Point Tags section?

Terraform v0.11.13
provider.aws v2.6.0

@caiohasouza
Copy link

+1

@ewbankkit
Copy link
Contributor

ewbankkit commented Oct 25, 2019

I think the diffs didn't match during apply error is due to an inconsistent hashing algorithm used to identify the diff.
A %v format on the recovery_point_tags map is used when calculating the hash value of the rule attribute and this was only guaranteed to be in sorted order in Go 1.12.
The Terraform AWS Provider started using Go 1.12 in v2.1.0 so issue may no longer occur with newer provider versions.
Anyway, while fixing #8431 I will change the hashing to use a known-good consistent hashing for maps.
The error mentioned by @simonvassella in #8193 (comment) is the same as #8431.

@bflad
Copy link
Contributor

bflad commented Oct 29, 2019

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.

@bflad
Copy link
Contributor

bflad commented Oct 31, 2019

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.

@ghost
Copy link

ghost commented Mar 29, 2020

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 and limited conversation to collaborators Mar 29, 2020
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants