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:
zisom-hc 2022-09-26 14:53:47 -07:00 committed by GitHub
parent cc964e6b0b
commit d08fcd63db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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