Skip to content

Commit 578357d

Browse files
committed
feat: add interpreter to null_resource definitions
1 parent 02b5c73 commit 578357d

File tree

17 files changed

+38
-24
lines changed

17 files changed

+38
-24
lines changed

terraform/aws/aws-apigateway/module/lambda.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ resource "null_resource" "lambda-package-build" {
33
always_run = timestamp()
44
}
55
provisioner "local-exec" {
6-
command = <<EOF
6+
command = <<EOF
77
cd ${path.module} && python -m venv target && . ./target/bin/activate && \
88
pip install boto3 && cd target/lib/python3*/site-packages && \
99
zip -r ../../../../lambda.zip . && cd ../../../.. && \
1010
zip lambda.zip *.py && rm -rf target && mkdir target && mv lambda.zip target
1111
EOF
12+
interpreter = ["bash", "-c"]
1213
}
1314
}
1415

terraform/aws/aws-eks/module/eks.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ resource "null_resource" "cluster-config" {
226226
always_run = timestamp()
227227
}
228228
provisioner "local-exec" {
229-
command = "${path.module}/configure-cluster.sh '${var.partition}' '${local.account_id}' '${aws_eks_cluster.cluster.name}' '${var.region}' '${jsonencode(var.namespaces)}' '${var.install_nginx}' '${nonsensitive(var.dd_api_key)}' '${nonsensitive(var.dd_app_key)}'"
229+
command = "${path.module}/configure-cluster.sh '${var.partition}' '${local.account_id}' '${aws_eks_cluster.cluster.name}' '${var.region}' '${jsonencode(var.namespaces)}' '${var.install_nginx}' '${nonsensitive(var.dd_api_key)}' '${nonsensitive(var.dd_app_key)}'"
230+
interpreter = ["bash", "-c"]
230231
}
231232

232233
depends_on = [

terraform/aws/aws-rosa/module/rosa.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ resource "null_resource" "clean_default_machines" {
194194
always_run = timestamp()
195195
}
196196
provisioner "local-exec" {
197-
command = "${path.module}/delete-machine-pools.sh '${rhcs_cluster_rosa_hcp.rosa_hcp_cluster.id}' 'workers-'"
197+
command = "${path.module}/delete-machine-pools.sh '${rhcs_cluster_rosa_hcp.rosa_hcp_cluster.id}' 'workers-'"
198+
interpreter = ["bash", "-c"]
198199
}
199200

200201
depends_on = [

terraform/aws/aws-sns-sqs-lambda/module/lambda.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ resource "null_resource" "lambda-package-build" {
33
always_run = timestamp()
44
}
55
provisioner "local-exec" {
6-
command = <<EOF
6+
command = <<EOF
77
cd ${path.module} && python -m venv target && . ./target/bin/activate && \
88
pip install boto3 Pillow && cd target/lib/python3*/site-packages && \
99
zip -r ../../../../lambda.zip . && cd ../../../.. && \
1010
zip lambda.zip *.py && rm -rf target && mkdir target && mv lambda.zip target
1111
EOF
12+
interpreter = ["bash", "-c"]
1213
}
1314
}
1415

terraform/azure/aks/module/config.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ resource "null_resource" "cluster-config" {
33
always_run = timestamp()
44
}
55
provisioner "local-exec" {
6-
command = "${path.module}/configure-cluster.sh '${azurerm_kubernetes_cluster.aks.resource_group_name}' '${local.subscription_name}' '${local.tenant_id}' '${azurerm_kubernetes_cluster.aks.name}' '${var.region}' '${azurerm_container_registry.aks.name}' '${local.nginx-ip}' '${jsonencode(var.namespaces)}'"
6+
command = "${path.module}/configure-cluster.sh '${azurerm_kubernetes_cluster.aks.resource_group_name}' '${local.subscription_name}' '${local.tenant_id}' '${azurerm_kubernetes_cluster.aks.name}' '${var.region}' '${azurerm_container_registry.aks.name}' '${local.nginx-ip}' '${jsonencode(var.namespaces)}'"
7+
interpreter = ["bash", "-c"]
78
}
89

910
depends_on = [

terraform/azure/aks/module/configure-cluster.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ function ensure-cluster-config() {
3939
disable_default_storageclass
4040
# import_existing_object_to_helm oauths cluster cluster-config cluster-config
4141

42-
# has to be with --force - otherwise imported resources to Helm - are not updated with Helm
42+
# has to be with --force-replace - otherwise imported resources to Helm - are not updated with Helm
4343
# https://github.com/helm/helm/issues/11040#issuecomment-1154702487
4444
helm upgrade --install cluster-config -n cluster-config --create-namespace "${DIRNAME}/cluster-config-chart" \
45-
--force \
45+
--force-replace \
4646
--set clusterName="${CLUSTER_NAME}" \
4747
--set region="${REGION}"
4848
}

terraform/azure/aro/module/aro.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ resource "azurerm_redhat_openshift_cluster" "aro" {
7777
}
7878

7979
service_principal {
80-
client_id = azuread_application.aro.client_id
81-
client_secret = azuread_service_principal_password.aro.value
80+
client_id = azuread_application.aro.client_id
81+
# or azuread_service_principal_password.aro.value, but it is not used because
82+
client_secret = azuread_application_password.aro-rbac.value
8283
}
8384

8485
depends_on = [
@@ -105,7 +106,8 @@ resource "null_resource" "cluster-config" {
105106
always_run = timestamp()
106107
}
107108
provisioner "local-exec" {
108-
command = "${path.module}/configure-cluster.sh '${azurerm_redhat_openshift_cluster.aro.resource_group_name}' '${azurerm_redhat_openshift_cluster.aro.name}' '${azurerm_redhat_openshift_cluster.aro.api_server_profile[0].url}' '${var.region}' '${jsonencode(var.oidc)}' '${jsonencode(var.namespaces)}' '${local.log_analytics_workspace_id}' '${local.log_analytics_workspace_primary_shared_key}' '${local.tenant_id}' '${local.azure_monitor_ingestion_url}' '${local.metrics_publisher_client_id}' '${local.metrics_publisher_client_secret}' '${local.azure_monitor_dcr_id}' '${local.subscription_id}' '${local.backup_client_id}' '${local.backup_client_secret}' '${azurerm_storage_account.backup.name}' '${azurerm_storage_container.backup.name}' '${var.pagerduty_integration_key}'"
109+
command = "${path.module}/configure-cluster.sh '${azurerm_redhat_openshift_cluster.aro.resource_group_name}' '${azurerm_redhat_openshift_cluster.aro.name}' '${azurerm_redhat_openshift_cluster.aro.api_server_profile[0].url}' '${var.region}' '${jsonencode(var.oidc)}' '${jsonencode(var.namespaces)}' '${local.log_analytics_workspace_id}' '${local.log_analytics_workspace_primary_shared_key}' '${local.tenant_id}' '${local.azure_monitor_ingestion_url}' '${local.metrics_publisher_client_id}' '${local.metrics_publisher_client_secret}' '${local.azure_monitor_dcr_id}' '${local.subscription_id}' '${local.backup_client_id}' '${local.backup_client_secret}' '${azurerm_storage_account.backup.name}' '${azurerm_storage_container.backup.name}' '${var.pagerduty_integration_key}'"
110+
interpreter = ["bash", "-c"]
109111
}
110112
}
111113

terraform/azure/aro/module/configure-cluster.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ function ensure-cluster-config() {
5858
disable_default_storageclass
5959
import_existing_object_to_helm oauths cluster cluster-config cluster-config
6060

61-
# has to be with --force - otherwise imported resources to Helm - are not updated with Helm
61+
# has to be with --force-replace - otherwise imported resources to Helm - are not updated with Helm
6262
# https://github.com/helm/helm/issues/11040#issuecomment-1154702487
6363
helm upgrade --install cluster-config -n cluster-config --create-namespace "${DIRNAME}/cluster-config-chart" \
64-
--force \
64+
--force-replace \
6565
--set clusterName="${CLUSTER_NAME}" \
6666
--set region="${REGION}" \
6767
--set tenant_id="${TENANT_ID}" \

terraform/azure/aro/module/iam.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ resource "azuread_service_principal" "aro" {
1616
owners = [data.azuread_client_config.current.object_id]
1717
}
1818

19-
resource "azuread_service_principal_password" "aro" {
20-
service_principal_id = azuread_service_principal.aro.id
21-
}
19+
# resource "azuread_service_principal_password" "aro" {
20+
# service_principal_id = azuread_service_principal.aro.id
21+
# }
2222

2323
data "azuread_service_principal" "redhatopenshift" {
2424
// This is the Azure Red Hat OpenShift RP service principal id, do NOT delete it

terraform/gcp/ghost/module/posts-management/cloudfunction.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ resource "null_resource" "function-code" {
2929
always_run = timestamp()
3030
}
3131
provisioner "local-exec" {
32-
command = <<-EOT
32+
command = <<-EOT
3333
mkdir -p target && zip target/function-source.zip index.js package.json
3434
EOT
35+
interpreter = ["bash", "-c"]
3536
}
3637
}
3738

0 commit comments

Comments
 (0)