×

Konfiguratsiya fayliga misol

 
main.tf  konfiguratsiya fayliga misol
    
 
terraform {
 required_providers {
     clouparduz = {
   source = "tf.cloupard.uz/clouparduz/clouparduz"
  }
 }
}
provider "clouparduz" {
key_file = "key.json"
}
# kirish kalitlarini yaratish
resource "clouparduz_storage_access_key" "mykey" {
storage_id = clouparduz_storage.storage_test.id
note = "mykey for mystorage"
}
# saqlashni yaratish
resource "clouparduz_storage" "storage_test" {
name = "mystorage"
}
# baket yaratish
resource "clouparduz_storage_bucket" "mybucket" {
storage_id = clouparduz_storage.storage_test.id
name = "mybucket"
note = "bucket1 on mystorage"
# saqlasj sinfi - issiq
storage_class_id = var.storage_warm
# anonim kirish - faqat o'qish
anonymous_access_type = 1
move_into_commercial_mode_on_test_out = false
# versiyalash - o'chirilgan
versioning = false
}
# faylni yuklash
resource "clouparduz_storage_object" "txt1" {
 key = "txt1"
 source = "txt1.txt"
 access_key = clouparduz_storage_access_key.mykey.key_id
 secret_key = clouparduz_storage_access_key.mykey.key
 bucket = clouparduz_storage_bucket.mybucket.name
}
variable "storage_warm" {
 default = "f664c922-d51e-48e6-b4bf-c27d19eae126"
}
variable "storage_cold" {
 default = "16475147-2eb0-489f-8c38-db8350df7c25"
}