Skip to content

Commit 6a16810

Browse files
committed
fix(infra): use GCP KMS credentials base64 encoded
1 parent 83b607a commit 6a16810

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mithril-infra/mithril.aggregator.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
2-
mithril_aggregator_relay_mithril_listen_port = 6060
2+
mithril_aggregator_relay_mithril_listen_port = 6060
3+
mithril_aggregator_ancillary_signer_gcp_kms_credentials = base64decode(var.mithril_aggregator_ancillary_signer_gcp_kms_credentials)
34
}
45

56
resource "null_resource" "mithril_aggregator" {
@@ -101,7 +102,7 @@ if [ "${var.mithril_aggregator_ancillary_signer_type}" = "secret-key" ]; then
101102
fi
102103
if [ "${var.mithril_aggregator_ancillary_signer_type}" = "gcp-kms" ]; then
103104
export ANCILLARY_FILES_SIGNER_CONFIG=$(jq -nc --arg resource_name ${var.mithril_aggregator_ancillary_signer_gcp_kms_resource_name} '{\"type\": \"secret-key\", \"resource_name\": $resource_name, \"credentials_json_env_var\": \"GOOGLE_APPLICATION_CREDENTIALS_GCP_KMS_JSON\"}')
104-
export GOOGLE_APPLICATION_CREDENTIALS_GCP_KMS_JSON='${var.mithril_aggregator_ancillary_signer_gcp_kms_credentials}'
105+
export GOOGLE_APPLICATION_CREDENTIALS_GCP_KMS_JSON='${local.mithril_aggregator_ancillary_signer_gcp_kms_credentials}'
105106
fi
106107
EOT
107108
,

mithril-infra/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ variable "mithril_aggregator_ancillary_signer_gcp_kms_resource_name" {
328328

329329
variable "mithril_aggregator_ancillary_signer_gcp_kms_credentials" {
330330
type = string
331-
description = "The JSON credentials to access GCP KMS (used with mithril_aggregator_ancillary_signer_type='gcp-kms')"
331+
description = "The JSON credentials to access GCP KMS base64 encoded (used with mithril_aggregator_ancillary_signer_type='gcp-kms')"
332332
default = ""
333333
}
334334

0 commit comments

Comments
 (0)