Skip to content

Commit

Permalink
Update custom-conditions.mdx
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zisom-hc authored Sep 26, 2022
1 parent cc964e6 commit d08fcd6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions website/docs/language/expressions/custom-conditions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d08fcd6

Please sign in to comment.