Difference between revisions of "Terraform modules"

From wikieduonline
Jump to navigation Jump to search
Line 21: Line 21:
 
  module "yourmodule" {
 
  module "yourmodule" {
 
   [[Terraform modules: source|source]] = "[[github.com]]/your-project/terraform-your-templates/modules/yourmodule"
 
   [[Terraform modules: source|source]] = "[[github.com]]/your-project/terraform-your-templates/modules/yourmodule"
 +
}
 +
 +
 +
module "ec2_instance" {
 +
  source  = "terraform-aws-modules/ec2-instance/aws"
 +
  [[version]] = "~> 3.0"
 
  }
 
  }
  

Revision as of 21:31, 27 February 2022

Modules naming convention: terraform-PROVIDER-NAME

Modules

Examples in main.tf

module "consul" {
  source = "./path/to/you/module"
}
module "yourmodule" {
  source = "github.com/your-project/terraform-your-templates/modules/yourmodule"
}


module "ec2_instance" {
  source  = "terraform-aws-modules/ec2-instance/aws"
  version = "~> 3.0"
}

Related commands

Related terms

See also

Advertising: