Comments (1)
An example of this would be like so:
myvars.tfvars
foo = "bar"
main.12.tf
locals {
calculated_vars = {
something = "calculated"
}
}
resource "aws_ecs_task_definition" "service" {
family = "service"
container_definitions = templatefile("mydef.json", local.calculated_vars, true)
# 3rd param would be "inherit variables", default: false
}
main.11.tf
locals {
calculated_vars = {
something = "calculated"
}
}
data "template_file" "def" {
template = "${file("mydef.json")}"
vars = local.calculated_vars
inherit_vars = true # default: false
}
resource "aws_ecs_task_definition" "service" {
family = "service"
container_definitions = data.template_file.def.rendered
}
mydef.json (the var.
prefix can be used to avoid collisions):
{
"whatisfoo": "${var.foo}",
"whatiscalculated": "${something}"
}
from terraform-provider-template.
Related Issues (20)
- Template 2.0.0 tries to interpulate percent (%) signs followed by curly-braces {} HOT 3
- Breaking change in substitution in v2.0.0 HOT 1
- Extremely unprofessional backward incompatible release HOT 1
- The new 2.0.0 doesn't parse %${var} core HOT 6
- Make Terraform validate template_file on plan phase
- Feature request: Render variables in filenames in template_dir
- Template provider - Better error message at template parsing HOT 2
- Terraform template creating the wrong type of numbers HOT 5
- template_dir doesn't work on Terraform v0.12.4 HOT 2
- template_dir doesn't skip hidden files HOT 1
- [regression] provider-template fails rendering when template file has % in the content starting from v2.0.0 HOT 3
- go module uses invalid version HOT 4
- Passing Lists as Template Variables HOT 2
- template_dir can't handle subdirectories correctly on windows: open <filename>: The system cannot find the path specified.
- depends_on should wait for template_dir generation HOT 3
- Provider cannot be migrated to terraform-plugin-sdk as it uses `lang` pkg directly
- Terragrunt panic due to api body size. HOT 2
- Unsupported functions in template file HOT 1
- Changes from nearly a year ago not published
- Provider archived
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-template.