diff --git a/.github/auto-release.yml b/.github/auto-release.yml index c78a4d83..39a7f1e0 100644 --- a/.github/auto-release.yml +++ b/.github/auto-release.yml @@ -46,7 +46,7 @@ template: | replacers: # Remove irrelevant information from Renovate bot -- search: '/---\s+^#.*Renovate configuration(?:.|\n)*?This PR has been generated .*/gm' +- search: '/(?<=---\s+)+^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm' replace: '' # Remove Renovate bot banner image - search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm' diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index c766b1fd..1d06d9b0 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -3,7 +3,9 @@ name: auto-release on: push: branches: + - main - master + - production jobs: publish: @@ -14,7 +16,7 @@ jobs: id: get-merged-pull-request with: github_token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} - # Drafts your next Release notes as Pull Requests are merged into "master" + # Drafts your next Release notes as Pull Requests are merged into "main" - uses: release-drafter/release-drafter@v5 if: "!contains(steps.get-merged-pull-request.outputs.labels, 'no-release')" with: diff --git a/README.md b/README.md index e5c4e2e4..94ca7926 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,7 @@ Available targets: | [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no | | [user\_enabled](#input\_user\_enabled) | Set to `true` to create an IAM user with permission to access the bucket | `bool` | `false` | no | | [versioning\_enabled](#input\_versioning\_enabled) | A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket | `bool` | `true` | no | +| [website\_inputs](#input\_website\_inputs) | Specifies the static website hosting configuration object. |
list(object({| `null` | no | ## Outputs diff --git a/docs/terraform.md b/docs/terraform.md index f12ac41a..ea3534ac 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -78,6 +78,7 @@ | [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no | | [user\_enabled](#input\_user\_enabled) | Set to `true` to create an IAM user with permission to access the bucket | `bool` | `false` | no | | [versioning\_enabled](#input\_versioning\_enabled) | A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket | `bool` | `true` | no | +| [website\_inputs](#input\_website\_inputs) | Specifies the static website hosting configuration object. |
index_document = string
error_document = string
redirect_all_requests_to = string
routing_rules = string
}))
list(object({| `null` | no | ## Outputs diff --git a/main.tf b/main.tf index 4efcd3c4..bcde03a6 100644 --- a/main.tf +++ b/main.tf @@ -105,6 +105,16 @@ resource "aws_s3_bucket" "default" { } } + dynamic "website" { + for_each = var.website_inputs == null ? [] : var.website_inputs + content { + index_document = website.value.index_document + error_document = website.value.error_document + redirect_all_requests_to = website.value.redirect_all_requests_to + routing_rules = website.value.routing_rules + } + } + dynamic "cors_rule" { for_each = var.cors_rule_inputs == null ? [] : var.cors_rule_inputs diff --git a/variables.tf b/variables.tf index 021070a0..295f484e 100644 --- a/variables.tf +++ b/variables.tf @@ -222,4 +222,17 @@ variable "object_lock_configuration" { }) default = null description = "A configuration for S3 object locking. With S3 Object Lock, you can store objects using a `write once, read many` (WORM) model. Object Lock can help prevent objects from being deleted or overwritten for a fixed amount of time or indefinitely." +} + +variable "website_inputs" { + + type = list(object({ + index_document = string + error_document = string + redirect_all_requests_to = string + routing_rules = string + })) + default = null + + description = "Specifies the static website hosting configuration object." } \ No newline at end of file
index_document = string
error_document = string
redirect_all_requests_to = string
routing_rules = string
}))