-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: saves credentials/configs to an s3 file for the particular cluster example: s3://bucket-name/test-refactor-2.example.com/configurations/credentials.json * terraform-docs: automated action --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6cac262
commit d963e87
Showing
9 changed files
with
40 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
locals { | ||
combined_outputs = { | ||
opsgenie_credentials = module.opsgenie_teams.opsgenie_prometheus_api_keys | ||
certmanager_credentials = { for user, keys in aws_iam_access_key.certmanager : aws_route53_zone.clusters[user].name => keys } | ||
externaldns_credentials = { for user, keys in aws_iam_access_key.externaldns : aws_route53_zone.clusters[user].name => keys } | ||
loki_credentials = { for user, keys in aws_iam_access_key.loki_s3 : aws_route53_zone.clusters[user].name => keys } | ||
vault_credentials = { for user, keys in aws_iam_access_key.vault_s3 : aws_route53_zone.clusters[user].name => keys } | ||
} | ||
|
||
|
||
cluster_names = toset([for k in keys(local.combined_outputs.certmanager_credentials) : k]) | ||
|
||
updated_combined_outputs = { | ||
for name in local.cluster_names : | ||
name => { | ||
certmanager_credentials = local.combined_outputs.certmanager_credentials[name] | ||
externaldns_credentials = local.combined_outputs.externaldns_credentials[name] | ||
loki_credentials = local.combined_outputs.loki_credentials[name] | ||
opsgenie_credentials = lookup(local.combined_outputs.opsgenie_credentials, split(".", name)[0], null) | ||
vault_credentials = local.combined_outputs.vault_credentials[name] | ||
} | ||
} | ||
} | ||
|
||
resource "aws_s3_bucket_object" "combined_outputs" { | ||
for_each = local.updated_combined_outputs | ||
provider = aws.primaryregion | ||
bucket = module.common_s3.primary_s3_bucket_id | ||
key = "${each.key}/configurations/credentials.json" | ||
content = jsonencode(each.value) | ||
content_type = "application/json" | ||
} |