Skip to content

Commit e1dd7a2

Browse files
feat: Add in overwrite variable and pass through to the call to the ssm par… (#11)
Co-authored-by: Anton Babenko <393243+antonbabenko@users.noreply.github.com> Co-authored-by: Anton Babenko <anton@antonbabenko.com>
1 parent ac079a0 commit e1dd7a2

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ No modules.
198198
| <a name="input_ignore_value_changes"></a> [ignore\_value\_changes](#input\_ignore\_value\_changes) | Whether to create SSM Parameter and ignore changes in value | `bool` | `false` | no |
199199
| <a name="input_key_id"></a> [key\_id](#input\_key\_id) | KMS key ID or ARN for encrypting a parameter (when type is SecureString) | `string` | `null` | no |
200200
| <a name="input_name"></a> [name](#input\_name) | Name of SSM parameter | `string` | `null` | no |
201+
| <a name="input_overwrite"></a> [overwrite](#input\_overwrite) | Overwrite an existing parameter. If not specified, defaults to false during create operations to avoid overwriting existing resources and then true for all subsequent operations once the resource is managed by Terraform. Only relevant if ignore\_value\_changes is false. | `bool` | `false` | no |
201202
| <a name="input_secure_type"></a> [secure\_type](#input\_secure\_type) | Whether the type of the value should be considered as secure or not? | `bool` | `false` | no |
202203
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to resources | `map(string)` | `{}` | no |
203204
| <a name="input_tier"></a> [tier](#input\_tier) | Parameter tier to assign to the parameter. If not specified, will use the default parameter tier for the region. Valid tiers are Standard, Advanced, and Intelligent-Tiering. Downgrading an Advanced tier parameter to Standard will recreate the resource. | `string` | `null` | no |

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ resource "aws_ssm_parameter" "this" {
2424
allowed_pattern = var.allowed_pattern
2525
data_type = var.data_type
2626

27+
overwrite = var.overwrite
28+
2729
tags = var.tags
2830
}
2931

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,9 @@ variable "tags" {
7979
type = map(string)
8080
default = {}
8181
}
82+
83+
variable "overwrite" {
84+
description = "Overwrite an existing parameter. If not specified, defaults to false during create operations to avoid overwriting existing resources and then true for all subsequent operations once the resource is managed by Terraform. Only relevant if ignore_value_changes is false."
85+
type = bool
86+
default = false
87+
}

wrappers/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module "wrapper" {
1010
ignore_value_changes = try(each.value.ignore_value_changes, var.defaults.ignore_value_changes, false)
1111
key_id = try(each.value.key_id, var.defaults.key_id, null)
1212
name = try(each.value.name, var.defaults.name, null)
13+
overwrite = try(each.value.overwrite, var.defaults.overwrite, false)
1314
secure_type = try(each.value.secure_type, var.defaults.secure_type, false)
1415
tags = try(each.value.tags, var.defaults.tags, {})
1516
tier = try(each.value.tier, var.defaults.tier, null)

0 commit comments

Comments
 (0)