Fix custom conditions example

Original code block erroneously references `aws_vpc.example` but appears to actually mean `data.aws_vpc.example`.
This commit is contained in:
Adam Christie 2022-06-01 12:41:15 +01:00 committed by GitHub
parent 70ddcc7d0d
commit 50919044d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,12 +312,12 @@ data "aws_vpc" "example" {
}
resource "aws_internet_gateway" "example" {
for_each = aws_vpc.example
for_each = data.aws_vpc.example
vpc_id = each.value.id
lifecycle {
precondition {
condition = aws_vpc.example[each.key].state == "available"
condition = data.aws_vpc.example[each.key].state == "available"
error_message = "VPC ${each.key} must be available."
}
}