Skip to content

Commit 26ead07

Browse files
authored
Merge pull request #31059 from hashicorp/fix-postconditions-example
Change private to public in custom conditions example
2 parents 1fd140f + 1666aa8 commit 26ead07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

website/docs/language/expressions/custom-conditions.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The following example shows use cases for preconditions and postconditions. The
109109
- **The AMI ID must refer to an AMI that contains an operating system for the
110110
`x86_64` architecture.** The precondition would detect if the caller accidentally built an AMI for a different architecture, which may not be able to run the software this virtual machine is intended to host.
111111

112-
- **The EC2 instance must be allocated a private DNS hostname.** In Amazon Web Services, EC2 instances are assigned private DNS hostnames only if they belong to a virtual network configured in a certain way. The postcondition would detect if the selected virtual network is not configured correctly, prompting the user to debug the network settings.
112+
- **The EC2 instance must be allocated a public DNS hostname.** In Amazon Web Services, EC2 instances are assigned public DNS hostnames only if they belong to a virtual network configured in a certain way. The postcondition would detect if the selected virtual network is not configured correctly, prompting the user to debug the network settings.
113113

114114
- **The EC2 instance will have an encrypted root volume.** The precondition ensures that the root volume is encrypted, even though the software running in this EC2 instance would probably still operate as expected on an unencrypted volume. This lets Terraform produce an error immediately, before any other components rely on the new EC2 instance.
115115

@@ -127,10 +127,10 @@ resource "aws_instance" "example" {
127127
error_message = "The selected AMI must be for the x86_64 architecture."
128128
}
129129
130-
# The EC2 instance must be allocated a private DNS hostname.
130+
# The EC2 instance must be allocated a public DNS hostname.
131131
postcondition {
132-
condition = self.private_dns != ""
133-
error_message = "EC2 instance must be in a VPC that has private DNS hostnames enabled."
132+
condition = self.public_dns != ""
133+
error_message = "EC2 instance must be in a VPC that has public DNS hostnames enabled."
134134
}
135135
}
136136
}

0 commit comments

Comments
 (0)