Untitled

mail@pastecode.io avatarunknown
plain_text
a month ago
3.9 kB
1
Indexable
Never
variable "project_id" {
  type        = string
  description = "The ID of the project in which the resource belongs. If it is not provided, the provider project is used"
}

variable "name" {
  type        = string
  description = "The name of the bucket."
}

variable "location" {
  type        = string
  description = "The GCS location"
  default     = "US"
}


variable "uniform_bucket_level_access" {
  type        = bool
  description = "Enables Uniform bucket-level access access to a bucket."
  default     = true

}

variable "force_destroy" {
  description = "Optional, Default: false) When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, Terraform will fail that run."
  type        = bool
  default     = false
}

variable "storage_class" {
  type        = string
  description = "Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE."
  default     = "STANDARD"
}

variable "labels" {
  type        = map(string)
  description = "Labels for the bucket"
  default     = null
}

variable "versioning" {
  type        = bool
  description = "The bucket's Versioning configuration."
  default     = false
}


variable "folders" {
  type        = list(string)
  description = "List of folder to create in the bucket"
  default     = []
}
variable "retention_policy" {
  type = object({
    is_locked        = bool
    retention_period = number
  })
  description = "Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below."
  default     = null
}

# variable "iam_members" {
#     type = list(object({
#         role = string
#         member = string
#     }))
# }

variable "lifecycle_rules" {
  default = []
  type = list(object({
    action = map(string)
    # Action(object) contains: 
    # type - The type of the action of this Lifecycle Rule. Supported values include: Delete and SetStorageClass.
    # storage_class - (Required if action type is SetStorageClass) The target Storage Class of objects affected by this Lifecycle Rule.

    condition = any
    # Condition(object) contains:

    # - age - (Optional) Minimum age of an object in days to satisfy this condition.
    # - created_before - (Optional) Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.
    # - with_state - (Optional) Match to live and/or archived objects. Supported values include: "LIVE", "ARCHIVED", "ANY".
    # - num_newer_versions - (Optional) Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.

  }))
  description = "The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted"
}

variable "log_object_prefix" {
  description = "(Optional, Computed) The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name"
  type        = string
  default     = null
}

variable "log_bucket" {
  description = "The bucket that will receive log objects."
  type        = string
  default     = null
}

# variable "bindings" {
#     type = map(list(string))
#     description = "Map with list of members for each role for created bucket"
# }

variable "admins" {
  type        = list(string)
  description = "Members who will get roles/storage.objectAdmin role on given bucket"
  default     = []
}

variable "creators" {
  type        = list(string)
  description = "Members who will get roles/storage.objectCreator role on given bucket"
  default     = []
}

variable "viewers" {
  type        = list(string)
  description = "Members who will get roles/storage.objectViewer role on given bucket"
  default     = []
}

variable "storage_admins" {
  type        = list(string)
  description = "Members who will get roles/storage.admin role on given bucket"
  default     = []
}