跳转至

terraform-cmd

install-

  • RHEL
    sudo yum install -y yum-utils
    sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
    sudo yum -y install terraform
    
  • AL2
    sudo yum install -y yum-utils shadow-utils
    sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
    sudo yum -y install terraform
    

variable

variable "region" {
  description = "region"
  type        = string
  default = "us-east-2"
}
terraform apply -var "region=us-east-2"

workspace

# create new one
terraform workspace new test
# show current 
terraform workspace show
# list all 
terraform workspace list

state

terraform state list
terraform state show xxxxxx