Object Storage 관련 모듈을 따로 storage_module로 관리하기 때문에, 폴더 안에 porvider 정보를 작성해준다.
# storage_module/providers.tf
terraform {
required_providers {
ncloud = {
source = "NaverCloudPlatform/ncloud"
version = ">= 3.3.1"
}
}
}
버킷 정보를 작성해준다
# storage_module/bucket.tf
resource "ncloud_objectstorage_bucket" "bucket" {
bucket_name = var.bucket_name
}
추후 다른 모듈에 넘겨줄 일을 위해서 outputs.tf를 작성한다.
# storage_module/outputs.tf
output "bucket_name" {
description = "생성된 버킷 이름"
value = ncloud_objectstorage_bucket.bucket.bucket_name
}
해당 모듈에서 사용할 변수를 정의한다
# storage_module/variables.tf
variable "bucket_name" {
description = "생성할 Object Storage 버킷 이름"
default = "tf-ncp-storage"
}'Infra' 카테고리의 다른 글
| 모니터링 환경 설정 - 배포 포트가 변경될 때 8080...8081,, switching (0) | 2025.05.26 |
|---|---|
| 모니터링 환경을 구축 Promtail, Loki, Prometheus, Grafana, Logback (0) | 2025.05.26 |
| Terraform으로 NCP 구축하기(3) - terraform apply (0) | 2025.05.08 |
| Terraform으로 NCP 구축하기(2) - VPC, Subnet, Server 띄우기 (0) | 2025.05.08 |
| NCP SSL 인증서 발급 및 DNS 인증 (0) | 2025.05.01 |