#2303
[Terraform] How-To
Install Terraform on Linux server :
wget https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zip unzip terraform_0.12.24_linux_amd64.zip cp terraform /usr/local/bin/ terraform -v
Check https://www.terraform.io/downloads.html for download
Main commands :
Init :
terraform init
Dry run :
terraform plan
Apply :
terraform apply
Destroy :
terraform destroy
Define docker provider (main.tf) :
# Find the latest Nginx image. # Access it somewhere else with ${docker_image.nginx.latest} resource "docker_image" "nginx" { name = "nginx" } resource "docker_container" "nginx" { image = "${docker_image.nginx.latest}" # Container name name = "nginx-tf" # Port mapping ports { internal = 80 external = 80 } # See https://www.terraform.io/docs/providers/docker/r/container.html for more configuration }
Terraform to provision Nginx Docker container – www.golibrary.co Artifactory Disk Usage cli (artifactory-du) | artifactory-du
Terraform Docker provider : https://www.terraform.io/docs/providers/docker/index.html
https://github.com/sakvari/terraform-ec2-swap
https://github.com/leboncoin/terraform-aws-nvme-example
https://www.bogotobogo.com/DevOps/Terraform/Terraform_AWS_sts_AssumeRole_Cross_Account.php
identify providers per module:
replace providers per State:
Error
Replace default kubectl by