Skip to content

Commit

Permalink
Merge pull request #2 from lorengordon/patch/force-defaults
Browse files Browse the repository at this point in the history
Sets defaults for optional inputs so they always have values
  • Loading branch information
lorengordon authored Jan 26, 2024
2 parents 4ea700d + 93a50da commit 661ac9f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.0
current_version = 1.0.1
commit = True
message = Bumps version to {new_version}
tag = False
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

### [1.0.1](https://github.com/plus3it/terraform-aws-tardigrade-s3-backend/releasestag/1.0.1)

**Released**: 2023.01.25

**Summary**:

* Sets defaults for optional inputs so they always have values

### [1.0.0](https://github.com/plus3it/terraform-aws-tardigrade-s3-backend/releasestag/1.0.0)

**Released**: 2023.12.28
**Released**: 2023.12.28

**Summary**:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_backend_config"></a> [backend\_config](#input\_backend\_config) | Object of S3 backend config | <pre>object({<br> bucket = string<br> force_destroy = optional(bool, true)<br> versioning = optional(string, "Enabled")<br> public_access_block = optional(object({<br> block_public_acls = optional(bool, true)<br> block_public_policy = optional(bool, true)<br> ignore_public_acls = optional(bool, true)<br> restrict_public_buckets = optional(bool, true)<br> }))<br> server_side_encryption_configuration = optional(object({<br> bucket_key_enabled = optional(bool, true)<br> sse_algorithm = optional(string, "aws:kms")<br> kms_master_key_id = optional(string)<br> }))<br> dynamodb_table = object({<br> name = string<br> deletion_protection_enabled = optional(bool, true)<br> billing_mode = optional(string, "PAY_PER_REQUEST")<br> })<br> })</pre> | n/a | yes |
| <a name="input_backend_config"></a> [backend\_config](#input\_backend\_config) | Object of S3 backend config | <pre>object({<br> bucket = string<br> force_destroy = optional(bool, true)<br> versioning = optional(string, "Enabled")<br> public_access_block = optional(object({<br> block_public_acls = optional(bool, true)<br> block_public_policy = optional(bool, true)<br> ignore_public_acls = optional(bool, true)<br> restrict_public_buckets = optional(bool, true)<br> }), {})<br> server_side_encryption_configuration = optional(object({<br> bucket_key_enabled = optional(bool, true)<br> sse_algorithm = optional(string, "aws:kms")<br> kms_master_key_id = optional(string)<br> }), {})<br> dynamodb_table = object({<br> name = string<br> deletion_protection_enabled = optional(bool, true)<br> billing_mode = optional(string, "PAY_PER_REQUEST")<br> })<br> })</pre> | n/a | yes |

## Outputs

Expand Down
31 changes: 15 additions & 16 deletions tests/create_all/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@ module "state_bucket" {
source = "../../"

backend_config = {
bucket = "test-bucket-for-backend"
force_destroy = true
versioning = "Enabled"
bucket = "test-bucket-for-backend-${local.id}"

public_access_block = {
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}

server_side_encryption_configuration = {
bucket_key_enabled = true
sse_algorithm = "aws:kms"
kms_master_key_id = null
}
dynamodb_table = {
name = "test-ddb-for-backend"
name = "test-ddb-for-backend-${local.id}"

deletion_protection_enabled = false
}
}
}

resource "random_string" "this" {
length = 8
upper = false
special = false
numeric = false
}

locals {
id = random_string.this.result
}
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ variable "backend_config" {
block_public_policy = optional(bool, true)
ignore_public_acls = optional(bool, true)
restrict_public_buckets = optional(bool, true)
}))
}), {})
server_side_encryption_configuration = optional(object({
bucket_key_enabled = optional(bool, true)
sse_algorithm = optional(string, "aws:kms")
kms_master_key_id = optional(string)
}))
}), {})
dynamodb_table = object({
name = string
deletion_protection_enabled = optional(bool, true)
Expand Down

0 comments on commit 661ac9f

Please sign in to comment.