Skip to content

Commit a4a6327

Browse files
authored
Merge pull request #5 from Perun-Engineering/feat/buckets-versioning
feat: Buckets versioning
2 parents ececc60 + bca1b7b commit a4a6327

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ In the above diagram, you can see the components and their relations (PostgreSQL
6161
|------|-------------|------|---------|:--------:|
6262
| <a name="input_bucket_prefix"></a> [bucket\_prefix](#input\_bucket\_prefix) | Prefix used for S3 buckets | `string` | `""` | no |
6363
| <a name="input_buckets_lifecycles"></a> [buckets\_lifecycles](#input\_buckets\_lifecycles) | Lifecycle rules for buckets | `map(string)` | `{}` | no |
64+
| <a name="input_buckets_versioning"></a> [buckets\_versioning](#input\_buckets\_versioning) | Versioning for buckets | `map(bool)` | `{}` | no |
6465
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | EKS cluster name where you want to deploy the release | `string` | n/a | yes |
6566
| <a name="input_database_password"></a> [database\_password](#input\_database\_password) | Password to access PostgreSQL database | `string` | n/a | yes |
6667
| <a name="input_gitlab_chart_version"></a> [gitlab\_chart\_version](#input\_gitlab\_chart\_version) | Version of the gitlab chart | `string` | `"7.8.1"` | no |

examples/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ EOF
6565
}
6666
EOF
6767
}
68+
# Default is `false`, determine for each of backup, lfs, artifacts, packages, uploads etc
69+
buckets_versioning = {
70+
backup = true
71+
}
6872

6973
values = [
7074
templatefile("values.yaml", {

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ module "s3_bucket" {
230230
force_destroy = false
231231

232232
versioning = {
233-
enabled = false
233+
enabled = try(var.buckets_versioning[each.key], false)
234234
}
235235

236236
policy = data.aws_iam_policy_document.s3_bucket_policy[each.key].json

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ variable "buckets_lifecycles" {
9595
default = {}
9696
}
9797

98+
variable "buckets_versioning" {
99+
description = "Versioning for buckets"
100+
type = map(bool)
101+
default = {}
102+
}
103+
98104
variable "tags" {
99105
description = "A map of tags to add to all resources"
100106
type = map(string)

0 commit comments

Comments
 (0)