테라폼으로 웹서비스를 관리해보자.
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo dnf repolist
sudo yum -y install terraform
terraform version
Terraform v1.7.3
액세스키와 시크릿키 준비한다.
1
mkdir -p ~/.config/openstack/
cat << EOF > ~/.config/openstack/clouds.yaml
clouds:
hands-on:
region_name: '{REGION_NAME}'
interface: 'public'
auth_type: "v3applicationcredential"
auth:
auth_url: 'https://iam.kakaoi.io/identity/v3'
application_credential_id: "{사용자 액세스 키 ID}"
application_credential_secret: "{사용자 액세스 보안 키}"
EOF
1
git clone -b terraform-3tier-library https://github.com/kakaoenterprise/kc-handson-config.git
2
cd ./kc-handson-config
3
vim terraform.tfvars
1
export OS_CLOUD=hands-on
2
terraform init
3
terraform plan
4
terraform apply
terraform destroy
참고 자료
https://docs.kakaocloud.com/tutorial/automation/terraform-web-service-auto
https://brunch.co.kr/@topasvga/3651
감사합니다.