Terraform Module Block Syntax: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 30: Line 30:
==source==
==source==


The <code>source</code> argument is required. It is a <font color=darkgray>meta-argument</font> defined by the Terraform CLI. Its value is either the path to the local directory that contains the dependency module's [[Terraform_Concepts#Configuration|configuration]] files or a remote module source that Terraform should download and use. This value must be a literal string with no template sequences; arbitrary expressions are not allowed.
The <code>source</code> argument is required. It is a <font color=darkgray>meta-argument</font> defined by the Terraform CLI. Its value is either the path to the local directory that contains the dependency module's [[Terraform_Concepts#Configuration|configuration]] files or a remote module source that Terraform should download and use. This value must be a literal string with no template sequences; arbitrary expressions are not allowed. For more details see: {{Internal|Terraform_Concepts#Module_Sources|Module Sources}}

Revision as of 20:44, 28 February 2020

External

Internal

Overview

TODO: this section must be expanded based on https://www.terraform.io/docs/configuration/modules.html and https://www.terraform.io/docs/modules/index.html

Example

module "some-module" {

  source = "terraform-aws-modules/eks/aws"
  version = "~> 9.0"

  cluster_name = local.cluster_name
  vpc_id = var.aws_vpc_id

  ...

  tags = {
    Environment = var.environment_name
  }
}

Arguments

source

The source argument is required. It is a meta-argument defined by the Terraform CLI. Its value is either the path to the local directory that contains the dependency module's configuration files or a remote module source that Terraform should download and use. This value must be a literal string with no template sequences; arbitrary expressions are not allowed. For more details see:

Module Sources