- What is the Terraform?
- iac 3 parts
- server templating tool
- configuration management tool
- provisioning tool
- Terraform is this position
- snipet ec2 + web service?
- swarm cluster
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.
- Infrastructure as Code
- written by GO
- HCL declarative language:
.tf
$ brew install terraform
$ export AWS_ACCES_KEY_ID
$ export AWS_SECRET_ACCESS_KEY
# main.tf
provider "aws" {
region = "us-east-1"
}
resource "aws_instance" "example" {
ami = "ami-40d28157"
instance_type = "t2.micro"
}
$ terraform init
$ terraform plan
terraform graph > out.dot
brew install graphviz
dot -T png -O out.dot
https://dreampuf.github.io/GraphvizOnline/
- s3: encrypt + version
- terraform remote config (automatically pull & push)
- 모든 팀원이 프로젝트마다 remote 셋팅을...
- 동시에 수정하게 될 경우.
- terraform pro, enterprise
- using build server
- terragrunt using DynamoDB
- written by GO
.tf
: HCL declarative language
- AWS
- Azure
- Google Cloud
- Digital Ocean
- OpenStack
- server
- database
- load balancers
- network topology
- Puppet
- Chef
- Ansible
- SaltStack
- Terraform
- CloudFormation
- OpenStack Heat
- docker
- packer
- configuration management VS provisioning
- mutable infrastructure VS immutable
- procedual language VS declarative
- master VS masterless
- agent VS agentless
- large community VS small
- Mature VS cutting-edge
config change ex) update openssl...: update all exist servers
- hard to reproducable
management change ex) dev server/ live server
- live server accumulated months of changes
- dev servers are not reflected!!
To make instances 10 to 15
- 10 instances
- 5 instances (depends on previous state)
- result 15 instances
- 10 instances
- 15 instances
- result 15 instances
코드의 관리 관점으로 본다면 declarative가 훨씬 나아보인다.
- issue: open, close, all, active change in month
- stars
- contributors
- #commit in close months
- libraries?
- stackoverflow
- jobs
- indeed.com mention