From 5841db00b3c9d5b633b074bc19788e08eb020f8c Mon Sep 17 00:00:00 2001 From: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com> Date: Mon, 16 May 2022 16:28:15 -0400 Subject: [PATCH 1/2] Change private to public dns :-) --- website/docs/language/expressions/custom-conditions.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/language/expressions/custom-conditions.mdx b/website/docs/language/expressions/custom-conditions.mdx index b6fa0f1109de..7329f814b55e 100644 --- a/website/docs/language/expressions/custom-conditions.mdx +++ b/website/docs/language/expressions/custom-conditions.mdx @@ -109,7 +109,7 @@ The following example shows use cases for preconditions and postconditions. The - **The AMI ID must refer to an AMI that contains an operating system for the `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. -- **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. +- **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. - **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. @@ -127,10 +127,10 @@ resource "aws_instance" "example" { error_message = "The selected AMI must be for the x86_64 architecture." } - # The EC2 instance must be allocated a private DNS hostname. + # The EC2 instance must be allocated a public DNS hostname. postcondition { - condition = self.private_dns != "" - error_message = "EC2 instance must be in a VPC that has private DNS hostnames enabled." + condition = self.public_dns != "" + error_message = "EC2 instance must be in a VPC that has public DNS hostnames enabled." } } } From 1666aa84630b89f832288b826b74bab2f54791ff Mon Sep 17 00:00:00 2001 From: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com> Date: Mon, 16 May 2022 16:43:15 -0400 Subject: [PATCH 2/2] Update website/docs/language/expressions/custom-conditions.mdx Co-authored-by: Robin Norwood --- website/docs/language/expressions/custom-conditions.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/language/expressions/custom-conditions.mdx b/website/docs/language/expressions/custom-conditions.mdx index 7329f814b55e..3397b5eb2387 100644 --- a/website/docs/language/expressions/custom-conditions.mdx +++ b/website/docs/language/expressions/custom-conditions.mdx @@ -129,7 +129,7 @@ resource "aws_instance" "example" { # The EC2 instance must be allocated a public DNS hostname. postcondition { - condition = self.public_dns != "" + condition = self.public_dns != "" error_message = "EC2 instance must be in a VPC that has public DNS hostnames enabled." } }