docs: Add local values usage example
This commit is contained in:
parent
9f570a0c84
commit
fd4cc78839
|
@ -35,6 +35,12 @@ locals {
|
||||||
default_name_prefix = "${var.project_name}-web"
|
default_name_prefix = "${var.project_name}-web"
|
||||||
name_prefix = "${var.name_prefix != "" ? var.name_prefix : local.default_name_prefix}"
|
name_prefix = "${var.name_prefix != "" ? var.name_prefix : local.default_name_prefix}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Using a local value
|
||||||
|
resource "aws_s3_bucket" "files" {
|
||||||
|
bucket = "${local.name_prefix}-files"
|
||||||
|
# ...
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
Loading…
Reference in New Issue