Terraform syntax: Difference between revisions
From wikinotes
No edit summary |
No edit summary |
||
Line 27: | Line 27: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Basics --> | </blockquote><!-- Basics --> | ||
= Comments = | |||
<blockquote> | |||
<syntaxhighlight lang="tf"> | |||
# comment | |||
// comment | |||
/* multiline | |||
* comment | |||
*/ | |||
</syntaxhighlight> | |||
</blockquote><!-- Comments --> |
Revision as of 15:32, 25 September 2022
Terraform files use the extension *.tf
.
It is based on the HCF language.
Documentation
terraform language https://www.terraform.io/language
Basics
- blocks contain configuration for an object using a key/value format
- labels can optionally be assigned a block (as many as you'd like)
- arguments are how the key-value assignments within a block are referred to.
# ${BLOCK_TYPE} [${LABEL}..] { # ${IDENTIFIER} = ${EXPRESSION} # argument # } resource "aws_vpc" "main" { cidr_block = var.base_cidr_block }
Comments
# comment // comment /* multiline * comment */