본문 바로가기

클라우드/GCP 자원 테라폼으로 관리해보기

(12) 임시 GCS

반응형

Terraform으로 GCS를 생성하는 방법에 대해 설명하도록 한다.

 

resource "google_storage_bucket" "function_bucket" {
  name = "function-bucket-hr"
  location = "ASIA"
  project = "pjt-an3-dev-vm-2"
  force_destroy = false
}


resource "google_storage_bucket_object" "archive_2" {
  name   = "test/function.zip"
  bucket = google_storage_bucket.my_bucket.name
  source = "./hello_http/hello_http.zip"
}

 

google_storage_bucket : 버킷을 생성함

google_storage_bucket_object : 버킷에 데이터를 넣는 방법

 

GCP 콘솔에서 생성 확인

 

반응형

'클라우드 > GCP 자원 테라폼으로 관리해보기' 카테고리의 다른 글

(14) GCP VM 인스턴스 등록  (0) 2024.06.09
(13) Cloud Run  (0) 2024.06.09
(11) API Key 추가  (0) 2024.06.09
(10) LoadBalancer 구성  (0) 2024.06.09
(9) GCP API 활성화  (0) 2024.06.09