mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Update custom-conditions.mdx
Made a change to code example within the *Preconditions and Postconditions* section so that it technically makes sense; prior it was missing the data resource that was being called within the precondition lifecycle event on line 135, and the aws_instance resource was not utilizing the ami being provided by the data source in line 129, so i changed that as well.
This commit is contained in:
parent
cc964e6b0b
commit
d08fcd63db
@ -115,9 +115,18 @@ The following example shows use cases for preconditions and postconditions. The
|
||||
|
||||
```hcl
|
||||
|
||||
data "aws_ami" "example" {
|
||||
owners = ["amazon"]
|
||||
|
||||
filter {
|
||||
name = "image-id"
|
||||
values = ["ami-abc123"]
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_instance" "example" {
|
||||
instance_type = "t2.micro"
|
||||
ami = "ami-abc123"
|
||||
instance_type = "t3.micro"
|
||||
ami = data.aws_ami.example.id
|
||||
|
||||
lifecycle {
|
||||
# The AMI ID must refer to an AMI that contains an operating system
|
||||
|
Loading…
Reference in New Issue
Block a user