【terraform】02-快速开始
Install
Linux
1
2
3
4wget https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_linux_amd64.zip
unzip terraform_1.7.5_linux_amd64.zip
mv terraform /usr/local/bin/
terraform version
HashiCorp Configuration Language (HCL)
1 | <block> <parameters> { |

- Local Provider 文档可见 Local Provider
Simple Case
local.tf1
2
3
4resource "local_file" "hello" {
filename = "../hello-terrafrom/hello.txt"
content = "hello world"
}terraform init
terraform plan
tefform apply
terraform show
terraform destroy
Terraform Concepts

input variables
variables.tf

variables empty in variables.tf

interactive mode

command line flags

environment variables

variable defination file

Varivable definition precedence


Resource Attribute Reference

Resource Dependencies


output variables


lifecycle

create_before_destroy
before

after

prevent_destroy

ignore_changes

Data source

Resource and Data source

for_each
loop in terraform

Reference
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 cv-programmer!







