Skip to content

Commit 229b12b

Browse files
committed
fix: use of environment in local-exec provisioner
1 parent cf6e485 commit 229b12b

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres
77
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

99

10+
## [0.3.2] - 2024-10-30
11+
12+
### Changed
13+
14+
- Fix accidental mysql credential exposure.
15+
1016
## [0.3.1] - 2023-04-14
1117

1218
### Changed

main.tf

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ resource "null_resource" "execute_cloud_sql_proxy" {
33
for u in var.database_and_user_list : u.user => u
44
} : {})
55
provisioner "local-exec" {
6-
command = templatefile(
7-
"${path.module}/scripts/execute_cloud_sql_proxy.sh",
8-
{
9-
CLOUDSDK_CORE_PROJECT = var.project_id
10-
CLOUDSQL_PROXY_HOST = var.cloudsql_proxy_host
11-
CLOUDSQL_PROXY_PORT = var.cloudsql_proxy_port
12-
GCLOUD_PROJECT_REGION = var.region
13-
CLOUDSQL_INSTANCE_NAME = var.cloudsql_instance_name
14-
}
15-
)
6+
command = "${path.module}/scripts/execute_cloud_sql_proxy.sh"
7+
environment = {
8+
CLOUDSDK_CORE_PROJECT = var.project_id
9+
CLOUDSQL_PROXY_HOST = var.cloudsql_proxy_host
10+
CLOUDSQL_PROXY_PORT = var.cloudsql_proxy_port
11+
GCLOUD_PROJECT_REGION = var.region
12+
CLOUDSQL_INSTANCE_NAME = var.cloudsql_instance_name
13+
}
1614
interpreter = [
1715
"/bin/sh", "-c"
1816
]

0 commit comments

Comments
 (0)