Skip to content

Commit

Permalink
chore: remove more unused items and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
hazmei committed Mar 27, 2024
1 parent 258e42d commit 0e5b61c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ module "vault_secretsync" {
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_associate_secrets"></a> [associate\_secrets](#input\_associate\_secrets) | Map of vault kv to create secret sync association | <pre>map(<br> object({<br> mount = string<br> secret_name = list(string)<br> })<br> )</pre> | `{}` | no |
| <a name="input_delete_all_secret_associations"></a> [delete\_all\_secret\_associations](#input\_delete\_all\_secret\_associations) | Delete the secret associations | `bool` | `false` | no |
| <a name="input_delete_sync_destination"></a> [delete\_sync\_destination](#input\_delete\_sync\_destination) | Delete the sync destination. Secret associations must be removed beforehand. | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | Prefix name for the destination | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | AWS region | `string` | `"ap-southeast-1"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to set on the secrets managed at the destination | `map(string)` | `{}` | no |
Expand Down
6 changes: 2 additions & 4 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
locals {
age_in_days = timeadd(plantimestamp(), "-2160h") # 90 days (90*24 hours)
sync_base_path = "sys/sync/destinations"
destination_name = "${var.name}-${var.region}-${random_id.this.hex}"
delete_sync_destination = alltrue([var.delete_all_secret_associations, var.delete_sync_destination])
age_in_days = timeadd(plantimestamp(), "-2160h") # 90 days (90*24 hours)
destination_name = "${var.name}-${var.region}-${random_id.this.hex}"

associate_secrets = flatten([
for app_name, secret in var.associate_secrets : [
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#######################################

resource "vault_secrets_sync_aws_destination" "aws" {
name = var.name
name = local.destination_name
access_key_id = aws_iam_access_key.vault_secretsync.id
secret_access_key = aws_iam_access_key.vault_secretsync.secret
region = data.aws_region.current.name
Expand Down
12 changes: 0 additions & 12 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
variable "delete_sync_destination" {
type = bool
default = false
description = "Delete the sync destination. Secret associations must be removed beforehand."
}

variable "delete_all_secret_associations" {
type = bool
default = false
description = "Delete the secret associations"
}

variable "name" {
type = string
description = "Prefix name for the destination"
Expand Down

0 comments on commit 0e5b61c

Please sign in to comment.