Skip to content

Commit e6b5121

Browse files
feat: Add support for static web sites hosting.
Co-authored-by: Philippe LEAL <[email protected]>
1 parent 566edef commit e6b5121

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module "my_bucket" {
3333
| [scaleway_object_bucket_acl.this](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/object_bucket_acl) | resource |
3434
| [scaleway_object_bucket_lock_configuration.this](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/object_bucket_lock_configuration) | resource |
3535
| [scaleway_object_bucket_policy.this](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/object_bucket_policy) | resource |
36+
| [scaleway_object_bucket_website_configuration.this](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/object_bucket_website_configuration) | resource |
3637

3738
## Inputs
3839

@@ -47,6 +48,7 @@ module "my_bucket" {
4748
| <a name="input_tags"></a> [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 |
4849
| <a name="input_versioning_enabled"></a> [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 |
4950
| <a name="input_versioning_lock_configuration"></a> [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 |
51+
| <a name="input_website_index"></a> [website_index](#input_website_index) | Website Configuration. | `string` | `null` | no |
5052

5153
## Outputs
5254

main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,14 @@ resource "scaleway_object_bucket_policy" "this" {
4242
policy = jsonencode(var.policy)
4343
project_id = var.project_id
4444
}
45+
46+
resource "scaleway_object_bucket_website_configuration" "this" {
47+
count = var.website_index != null ? 1 : 0
48+
49+
bucket = scaleway_object_bucket.this.name
50+
project_id = var.project_id
51+
52+
index_document {
53+
suffix = var.website_index
54+
}
55+
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@ variable "versioning_lock_configuration" {
6868
years = null,
6969
}
7070
}
71+
72+
variable "website_index" {
73+
description = "Website Configuration."
74+
type = string
75+
default = null
76+
}

0 commit comments

Comments
 (0)