Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapper for terragrunt #49

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/iam-account/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ output "sak_access_key" {
output "sak_secret_key" {
description = "Private part of service account static access key"
value = var.enable_static_access_key ? yandex_iam_service_account_static_access_key.main[0].secret_key : null
sensitive = true
#sensitive = true
}

output "sak_encrypted_secret_key" {
Expand Down
20 changes: 20 additions & 0 deletions wrappers/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module "wrapper" {
source = "../modules/iam-account"

for_each = var.items

name = try(each.value.name, var.defaults.name, null)
folder_id = try(each.value.folder_id, var.defaults.folder_id, null)
description = try(each.value.description, var.defaults.description, "")
cloud_id = try(each.value.cloud_id, var.defaults.cloud_id, null)
folder_roles = try(each.value.folder_roles, var.defaults.folder_roles, [])
cloud_roles = try(each.value.cloud_roles, var.defaults.cloud_roles, [])
enable_static_access_key = try(each.value.enable_static_access_key, var.defaults.enable_static_access_key, false)
static_access_key_pgp_key = try(each.value.static_access_key_pgp_key, var.defaults.static_access_key_pgp_key, null)
enable_api_key = try(each.value.enable_api_key, var.defaults.enable_api_key, false)
api_key_pgp_key = try(each.value.api_key_pgp_key, var.defaults.api_key_pgp_key, null)
enable_account_key = try(each.value.enable_account_key, var.defaults.enable_account_key, false)
account_key_algorithm = try(each.value.account_key_algorithm, var.defaults.account_key_algorithm, "RSA_4096")
account_key_format = try(each.value.account_key_format, var.defaults.account_key_format, "PEM_FILE")
account_key_pgp_key = try(each.value.account_key_pgp_key, var.defaults.account_key_pgp_key, null)
}
5 changes: 5 additions & 0 deletions wrappers/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
output "wrapper" {
description = "Map of outputs of a wrapper."
value = module.wrapper
sensitive = false
}
11 changes: 11 additions & 0 deletions wrappers/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "defaults" {
description = "Map of default values which will be used for each item."
type = any
default = {}
}

variable "items" {
description = "Maps of items to create a wrapper from. Values are passed through to the module."
type = any
default = {}
}
9 changes: 9 additions & 0 deletions wrappers/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_providers {
yandex = {
source = "yandex-cloud/yandex"
version = ">= 0.72.0"
}
}
required_version = ">= 1.3"
}
Loading