Terraform resources
From wikinotes
Resources are the composable building blocks of your terraform configuration.
Documentation
overview https://www.terraform.io/language/resources provisioners https://www.terraform.io/language/resources/provisioners/syntax
Meta Arguments
Meta Arguments are available on all resource types, and allow you to customize how they are built.
provider # google, aws, ... depends_on # build-order count for_each lifecycle
Provisioners
You can use provisioners to hand off the additional information to another configuration management tool.
resource "aws_instance" "web" { # ... provisioner "local-exec" { command = "echo The server's IP address is ${self.private_ip}" } }Provisioner communication-style can be configured with a
connection
block.provisioner "file" { source = "conf/myapp.conf" destination = "/etc/myapp.conf" connection { type = "ssh" user = "root" password = "${var.root_password}" host = "${var.host}" } }There are three types of provisioners: