diff --git a/README.md b/README.md index 9b47a41..38d9e4d 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ module "my_bucket" { | [scaleway_object_bucket_acl.this](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/object_bucket_acl) | resource | | [scaleway_object_bucket_lock_configuration.this](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/object_bucket_lock_configuration) | resource | | [scaleway_object_bucket_policy.this](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/object_bucket_policy) | resource | +| [scaleway_object_bucket_website_configuration.this](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/object_bucket_website_configuration) | resource | ## Inputs @@ -47,6 +48,7 @@ module "my_bucket" { | [tags](#input_tags) | A list of tags for the bucket. As the Scaleway console does not support key/value tags, tags are written with the format value/value. | `list(string)` | `[]` | no | | [versioning_enabled](#input_versioning_enabled) | Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket. | `bool` | `false` | no | | [versioning_lock_configuration](#input_versioning_lock_configuration) | Specifies the Object Lock rule for the bucket. Requires versioning. | ```object({ mode = string, days = optional(number), years = optional(number), })``` | ```{ "days": null, "mode": "GOVERNANCE", "years": null }``` | no | +| [website_index](#input_website_index) | Website Configuration. | `string` | `null` | no | ## Outputs diff --git a/main.tf b/main.tf index 2853972..9afaf0a 100644 --- a/main.tf +++ b/main.tf @@ -42,3 +42,14 @@ resource "scaleway_object_bucket_policy" "this" { policy = jsonencode(var.policy) project_id = var.project_id } + +resource "scaleway_object_bucket_website_configuration" "this" { + count = var.website_index != null ? 1 : 0 + + bucket = scaleway_object_bucket.this.name + project_id = var.project_id + + index_document { + suffix = var.website_index + } +} diff --git a/variables.tf b/variables.tf index bedfb0f..dda1446 100644 --- a/variables.tf +++ b/variables.tf @@ -68,3 +68,9 @@ variable "versioning_lock_configuration" { years = null, } } + +variable "website_index" { + description = "Website Configuration." + type = string + default = null +}