mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #31171 from fractos/patch-1
Fix custom conditions example
This commit is contained in:
commit
6c7db7186a
@ -312,12 +312,12 @@ data "aws_vpc" "example" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_internet_gateway" "example" {
|
resource "aws_internet_gateway" "example" {
|
||||||
for_each = aws_vpc.example
|
for_each = data.aws_vpc.example
|
||||||
vpc_id = each.value.id
|
vpc_id = each.value.id
|
||||||
|
|
||||||
lifecycle {
|
lifecycle {
|
||||||
precondition {
|
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."
|
error_message = "VPC ${each.key} must be available."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user