From 5d00e8574bf2bf1c3913202f9ed77077f35226d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfredo=20Espa=C3=B1a?= Date: Thu, 13 May 2021 16:49:17 -0600 Subject: [PATCH] Adding terraform plan with parameters support --- terraform-client/pom.xml | 2 +- .../main/java/org/azbuilder/terraform/TerraformClient.java | 7 +++++-- terraform-spring-boot-autoconfigure/pom.xml | 2 +- terraform-spring-boot-samples/pom.xml | 2 +- terraform-spring-boot-starter/pom.xml | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/terraform-client/pom.xml b/terraform-client/pom.xml index df97a84..a3529da 100644 --- a/terraform-client/pom.xml +++ b/terraform-client/pom.xml @@ -19,7 +19,7 @@ UTF-8 - 0.0.3 + 0.0.4 false 4.9.1 2.8.0 diff --git a/terraform-client/src/main/java/org/azbuilder/terraform/TerraformClient.java b/terraform-client/src/main/java/org/azbuilder/terraform/TerraformClient.java index 51cdc72..6186072 100644 --- a/terraform-client/src/main/java/org/azbuilder/terraform/TerraformClient.java +++ b/terraform-client/src/main/java/org/azbuilder/terraform/TerraformClient.java @@ -155,12 +155,15 @@ private ProcessLauncher getTerraformLauncher(TerraformCommand command) throws IO } switch (command) { + case plan: + for (Map.Entry entry : this.getTerraformParameters().entrySet()) { + launcher.appendCommands("--var", entry.getKey().concat("=").concat(entry.getValue())); + } + break; case apply: - for (Map.Entry entry : this.getTerraformParameters().entrySet()) { launcher.appendCommands("--var", entry.getKey().concat("=").concat(entry.getValue())); } - launcher.appendCommands("-auto-approve"); break; case destroy: diff --git a/terraform-spring-boot-autoconfigure/pom.xml b/terraform-spring-boot-autoconfigure/pom.xml index d555deb..d4866a9 100644 --- a/terraform-spring-boot-autoconfigure/pom.xml +++ b/terraform-spring-boot-autoconfigure/pom.xml @@ -18,7 +18,7 @@ UTF-8 - 0.0.3 + 0.0.4 false diff --git a/terraform-spring-boot-samples/pom.xml b/terraform-spring-boot-samples/pom.xml index 2da268d..68113f4 100644 --- a/terraform-spring-boot-samples/pom.xml +++ b/terraform-spring-boot-samples/pom.xml @@ -18,7 +18,7 @@ UTF-8 - 0.0.3 + 0.0.4 true diff --git a/terraform-spring-boot-starter/pom.xml b/terraform-spring-boot-starter/pom.xml index 085fe42..7283e9c 100644 --- a/terraform-spring-boot-starter/pom.xml +++ b/terraform-spring-boot-starter/pom.xml @@ -13,7 +13,7 @@ UTF-8 - 0.0.3 + 0.0.4 false