Skip to content

Latest commit

 

History

History
98 lines (75 loc) · 1.53 KB

template_file.md

File metadata and controls

98 lines (75 loc) · 1.53 KB

template_file

back

Index

Terraform

terraform {
  required_providers {
    template = ">= 2.2.0"
  }
}

top

Example Usage

module "template_file" {
  source = "./modules/template/r/template_file"

  # filename - (optional) is a type of string
  filename = null
  # template - (optional) is a type of string
  template = null
  # vars - (optional) is a type of map of string
  vars = {}
}

top

Variables

variable "filename" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "template" {
  description = "(optional) - Contents of the template"
  type        = string
  default     = null
}

variable "vars" {
  description = "(optional) - variables to substitute"
  type        = map(string)
  default     = null
}

top

Resource

resource "template_file" "this" {
  # filename - (optional) is a type of string
  filename = var.filename
  # template - (optional) is a type of string
  template = var.template
  # vars - (optional) is a type of map of string
  vars = var.vars
}

top

Outputs

output "id" {
  description = "returns a string"
  value       = template_file.this.id
}

output "rendered" {
  description = "returns a string"
  value       = template_file.this.rendered
}

output "this" {
  value = template_file.this
}

top