https://gasidaseo.notion.site/gasidaseo/CloudNet-Blog-c9dfa44a27ff431dafdd2edacc8a1863
1
terraform destroy -auto-approve
rm -rf *
2
NICKNAME=masterseo
cat <<EOT > variables.tf
variable "createBucket" {
type = bool
default = true
}
EOT
cat <<EOT > s3.tf
provider "aws" {
region = "ap-northeast-2"
}
resource "aws_s3_bucket" "this" {
count = var.createBucket? 1 : 0
bucket = "$NICKNAME-bucket"
}
EOT
terraform init && terraform plan && terraform apply -auto-approve
aws s3 ls
버킷이 만들어진다
NICKNAME=masterseo
cat <<EOT > variables.tf
variable "createBucket" {
type = bool
default = false
}
EOT
cat <<EOT > s3.tf
provider "aws" {
region = "ap-northeast-2"
}
resource "aws_s3_bucket" "this" {
count = var.createBucket? 1 : 0
bucket = "$NICKNAME-bucket"
}
EOT
terraform init && terraform plan && terraform apply -auto-approve
aws s3 ls
안만들어진다.
다음
https://brunch.co.kr/@topasvga/2822
https://brunch.co.kr/@topasvga/2421
감사합니다.