Feature/added gcs website (#325)

* Added GCS website block support

* Terraform linting

* Moved variable to last and re-generated README
This commit is contained in:
Caio Tavares 2021-10-14 14:11:26 -04:00 committed by GitHub
parent c67aad3bb8
commit 7dad4496b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -114,6 +114,7 @@ module "bucket" {
| *storage_class* | Bucket storage class. | <code title="">string</code> | | <code title="MULTI_REGIONAL&#10;validation &#123;&#10;condition &#61; contains&#40;&#91;&#34;STANDARD&#34;, &#34;MULTI_REGIONAL&#34;, &#34;REGIONAL&#34;, &#34;NEARLINE&#34;, &#34;COLDLINE&#34;, &#34;ARCHIVE&#34;&#93;, var.storage_class&#41;&#10;error_message &#61; &#34;Storage class must be one of STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.&#34;&#10;&#125;">...</code> |
| *uniform_bucket_level_access* | Allow using object ACLs (false) or not (true, this is the recommended behavior) , defaults to true (which is the recommended practice, but not the behavior of storage API). | <code title="">bool</code> | | <code title="">true</code> |
| *versioning* | Enable versioning, defaults to false. | <code title="">bool</code> | | <code title="">false</code> |
| *website* | Bucket website. | <code title="object&#40;&#123;&#10;main_page_suffix &#61; string&#10;not_found_page &#61; string&#10;&#125;&#41;">object({...})</code> | | <code title="">null</code> |
## Outputs

View File

@ -38,6 +38,15 @@ resource "google_storage_bucket" "bucket" {
storage_class = lower(var.storage_class)
})
dynamic "website" {
for_each = var.website == null ? [] : [""]
content {
main_page_suffix = var.website.main_page_suffix
not_found_page = var.website.not_found_page
}
}
dynamic "encryption" {
for_each = var.encryption_key == null ? [] : [""]

View File

@ -132,3 +132,12 @@ variable "versioning" {
type = bool
default = false
}
variable "website" {
description = "Bucket website."
type = object({
main_page_suffix = string
not_found_page = string
})
default = null
}