From d08fcd63db30f937b57df67e591a12e7075ec181 Mon Sep 17 00:00:00 2001 From: zisom-hc <85522021+zisom-hc@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:53:47 -0700 Subject: [PATCH] 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. --- .../docs/language/expressions/custom-conditions.mdx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/website/docs/language/expressions/custom-conditions.mdx b/website/docs/language/expressions/custom-conditions.mdx index 4e60256c74..29a408af4c 100644 --- a/website/docs/language/expressions/custom-conditions.mdx +++ b/website/docs/language/expressions/custom-conditions.mdx @@ -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