Skip to content

Commit

Permalink
r/aws_backup_selection: 'condition' and 'not_resources' must be Compu…
Browse files Browse the repository at this point in the history
…ted.
  • Loading branch information
ewbankkit committed Feb 2, 2022
1 parent dd48984 commit d97513b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
2 changes: 2 additions & 0 deletions internal/service/backup/selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func ResourceSelection() *schema.Resource {
"condition": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
ForceNew: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -166,6 +167,7 @@ func ResourceSelection() *schema.Resource {
"not_resources": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
Expand Down
21 changes: 3 additions & 18 deletions internal/service/backup/selection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,11 @@ func testAccSelectionImportStateIDFunc(resourceName string) resource.ImportState

func testAccBackupSelectionConfigBase(rName string) string {
return fmt.Sprintf(`
data "aws_caller_identity" "current" {
}
data "aws_caller_identity" "current" {}
data "aws_partition" "current" {
}
data "aws_partition" "current" {}
data "aws_region" "current" {
}
data "aws_region" "current" {}
resource "aws_backup_vault" "test" {
name = %[1]q
Expand Down Expand Up @@ -356,9 +353,7 @@ resource "aws_backup_selection" "test" {
key = "foo"
value = "bar"
}
condition {}
not_resources = []
resources = [
"arn:${data.aws_partition.current.partition}:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:volume/*"
]
Expand Down Expand Up @@ -388,9 +383,6 @@ resource "aws_backup_selection" "test" {
value = "far"
}
condition {}
not_resources = []
resources = [
"arn:${data.aws_partition.current.partition}:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:volume/*"
]
Expand Down Expand Up @@ -436,7 +428,6 @@ resource "aws_backup_selection" "test" {
}
}
not_resources = []
resources = [
"arn:${data.aws_partition.current.partition}:rds:*:*:cluster:*",
"arn:${data.aws_partition.current.partition}:rds:*:*:db:*"
Expand Down Expand Up @@ -481,9 +472,6 @@ resource "aws_backup_selection" "test" {
value = "bar"
}
condition {}
not_resources = []
resources = aws_ebs_volume.test[*].arn
}
`, rName))
Expand All @@ -504,7 +492,6 @@ resource "aws_backup_selection" "test" {
key = "foo"
value = "bar"
}
condition {}
not_resources = ["arn:${data.aws_partition.current.partition}:fsx:*"]
resources = ["*"]
Expand All @@ -528,8 +515,6 @@ resource "aws_backup_selection" "test" {
value = "bar2"
}
condition {}
not_resources = []
resources = [
"arn:${data.aws_partition.current.partition}:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:volume/*"
]
Expand Down

0 comments on commit d97513b

Please sign in to comment.