Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Added a variable for specifying additional secret names. (#10)
Browse files Browse the repository at this point in the history
Flags for enabling IAM policies for predefined app specific secrets are now deprecated.
  • Loading branch information
sflanker authored May 2, 2024
1 parent 94a67a2 commit 180f1da
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
9 changes: 7 additions & 2 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ locals {
"batcave/defectdojo-rabbitmq-specific",
"batcave/defectdojo-redis-specific"
]
include_gitlab_secrets = var.enable_gitlab_secret_arns == true ? concat(local.secret_names, local.gitlab_secret_names) : local.secret_names
all_secret_names = var.enable_defectdojo_secret_arns == true ? concat(local.include_gitlab_secrets, local.defectdojo_secret_names) : local.include_gitlab_secrets
include_gitlab_secrets = var.enable_gitlab_secret_arns == true ? concat(local.secret_names, local.gitlab_secret_names) : local.secret_names

all_secret_names = (
var.enable_defectdojo_secret_arns == true ?
concat(local.include_gitlab_secrets, local.defectdojo_secret_names, var.additional_secret_names) :
concat(local.include_gitlab_secrets, var.additional_secret_names)
)
}

output "secret_arns"{
Expand Down
16 changes: 12 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,21 @@ variable "external_secrets_service_accounts" {
}

variable "enable_gitlab_secret_arns" {
type = bool
default = false
description = "DEPRECATED: when set to true enables creation of IAM policies for GitLab secrets. Use additional_secret_names instead."
type = bool
default = false
}

variable "enable_defectdojo_secret_arns" {
type = bool
default = false
description = "DEPRECATED: when set to true enables creation of IAM policies for DefectDojo secrets. Use additional_secret_names instead."
type = bool
default = false
}

variable "additional_secret_names" {
description = "A list of additional secret names to create IAM policies for."
type = list(string)
default = []
}

variable "aws_region" {
Expand Down

0 comments on commit 180f1da

Please sign in to comment.