TFNFR29 - Sensitive Data Outputs
An output
block that contains confidential data MUST be declared with sensitive = true
.
An output
block that contains confidential data MUST be declared with sensitive = true
.
Module owners MUST set a branch protection policy on their GitHub Repositories for AVM modules against their default branch, typically main
, to do the following:
If you use the template repository as mentioned in the contribution guide, the above will automatically be set.
Sometimes we notice that the name of certain output
is not appropriate anymore, however, since we have to ensure forward compatibility in the same major version, its name MUST NOT be changed directly. It MUST be moved to an independent deprecated_outputs.tf
file, then redefine a new output in output.tf
and make sure it’s compatible everywhere else in the module.
In locals.tf
, file we could declare multiple locals
blocks, but only locals
blocks are allowed.
You MAY declare locals
blocks next to a resource
block or data
block for some advanced scenarios, like making a fake module to execute some light-weight tests aimed at the expressions.
Expressions in locals
block MUST be arranged alphabetically.
Good examples:
locals {
name = coalesce(var.name, "name")
tags = merge(var.tags, {
env = "prod"
})
}
locals {
tags = merge(var.tags, {
env = "prod"
})
}
locals {
name = coalesce(var.name, "name")
}
Precise local types SHOULD be used.
Good example:
{
name = "John"
age = 52
}
Bad example:
{
name = "John"
age = "52" # age should be number
}
A toggle variable MUST be used to allow users to avoid the creation of a new resource
block by default if it is added in a minor or patch version.
Potential breaking(surprise) changes introduced by resource
block
resource
without count
or for_each
for conditional creation, or creating by defaultdynamic
or omitting it by defaultresource
block without one or more corresponding moved
blocksresource
’s count
to for_each
, or vice versaTerraform moved
block
could be your cure.
From Terraform AzureRM 3.0, the default value of prevent_deletion_if_contains_resources
in provider
block is true
. This will lead to an unstable test because the test subscription has some policies applied, and they will add some extra resources during the run, which can cause failures during destroy of resource groups.
newres
is a command-line tool that generates Terraform configuration files for a specified resource type. It automates the process of creating variables.tf
and main.tf
files, making it easier to get started with Terraform and reducing the time spent on manual configuration.