Skip to content

Commit

Permalink
Document HCL limitation of key interpolation. Fixes #159
Browse files Browse the repository at this point in the history
  • Loading branch information
Slavek Kabrda committed Apr 10, 2019
1 parent 3d63a8c commit 8396b4e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions website/docs/r/monitor.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ The following arguments are supported:
"role:db" = 1412798116
}

Note: due to [HCL limitations](https://github.com/hashicorp/terraform/issues/2042), it is impossible to use interpolations in keys.
For example, the following will result in muting the scope `role:${var:role}` (no interpolation is done):

silenced {
"role:${var:role}" = 0
}

To workaround this, you can use the [map function](https://www.terraform.io/docs/configuration/functions/map.html) of HCL:

silenced = ${map("role:${var:role}", 0)}

## Attributes Reference

The following attributes are exported:
Expand Down

0 comments on commit 8396b4e

Please sign in to comment.