-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

HashiCorp Terraform Associate (003) Exam Guide
By :

In this section, you will read about IP network functions supported in Terraform. These are helpful when you work with the setup of AWS resources such as VPC and are creating public and private subnets within the VPC and similar components to provision new infrastructure from scratch. Understanding these functions requires knowledge of network-addressing concepts.
The examples used in the section will be available with the filename 7. ip-network-functions.txt
in the GitHub link provided at the start of this chapter.
The cidrhost()
function returns the full IP address for a given host number within the given IP address prefix.
The function will accept both the IPv4 and IPv6 prefixes.
Here is an example:
$ cidrhost("192.168.1.1/16", 10)
> "192.168.0.10"
The cidrnetmask()
function converts an IPv4 address prefix to a subnet mask address. This will throw an error if...