From b23309284285e72bdd4627d0f7bc3b5f7b148813 Mon Sep 17 00:00:00 2001 From: MaciejMacQ <55737733+maciejmacq-dev@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:38:09 +0200 Subject: [PATCH] Fix: add var.role (#7) --- README.md | 1 + main.tf | 2 +- variables.tf | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index edb642b..743c677 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ module "terraform_gke_helm_atlantis" { | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | [repos](#input\_repos) | Map of repositories and their configs. Refer to https://www.runatlantis.io/docs/server-side-repo-config.html#example-server-side-repo |
list(object({
id = optional(string, "/.*/")
branch = optional(string)
apply_requirements = optional(list(string))
allowed_overrides = optional(list(string))
allowed_workflows = optional(list(string))
allow_custom_workflows = optional(bool)
delete_source_branch_on_merge = optional(bool)
pre_workflow_hooks = optional(list(object({
run = string
})))
post_workflow_hooks = optional(list(object({
run = string
})))
workflow = optional(string)
######### Helpers #########
allow_all_server_side_workflows = optional(bool, false)
terragrunt_atlantis_config = optional(object({
enabled = optional(bool)
output = optional(string)
automerge = optional(bool)
autoplan = optional(bool)
parallel = optional(bool)
cascade_dependencies = optional(bool)
filter = optional(string)
use_project_markers = optional(bool)
}))
}))
| `[]` | no | | [repos\_common\_config](#input\_repos\_common\_config) | Common config that will be merged into each item of the repos list |
object({
id = optional(string)
branch = optional(string)
apply_requirements = optional(list(string))
allowed_overrides = optional(list(string))
allowed_workflows = optional(list(string))
allow_custom_workflows = optional(bool)
delete_source_branch_on_merge = optional(bool)
pre_workflow_hooks = optional(list(object({
run = string
})))
post_workflow_hooks = optional(list(object({
run = string
})))
workflow = optional(string)
######### Helpers #########
allow_all_server_side_workflows = optional(bool, false)
terragrunt_atlantis_config = optional(object({
enabled = optional(bool)
output = optional(string)
automerge = optional(bool)
autoplan = optional(bool)
parallel = optional(bool)
cascade_dependencies = optional(bool)
filter = optional(string)
use_project_markers = optional(bool)
}))
})
| `{}` | no | +| [role](#input\_role) | Atlantis SA roles | `list(string)` |
[
"roles/editor"
]
| no | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | | [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no | diff --git a/main.tf b/main.tf index 506470a..b828e82 100644 --- a/main.tf +++ b/main.tf @@ -26,7 +26,7 @@ module "terraform_gke_helm_release" { } values = concat([templatefile("${path.module}/template/values.yaml.tftpl", { repoConfig = indent(2, module.atlantis_repo_config.repos_config_yaml) })], var.values) - roles = ["roles/editor"] + roles = var.role app = { name = var.app.name diff --git a/variables.tf b/variables.tf index 5c50ffe..5d24b26 100644 --- a/variables.tf +++ b/variables.tf @@ -191,3 +191,9 @@ variable "project_id" { description = "GCP project ID" type = string } + +variable "role" { + description = "Atlantis SA roles" + type = list(string) + default = ["roles/editor"] +}