diff --git a/alz/azuredevops/pipelines/terraform/templates/cd-template.yaml b/alz/azuredevops/pipelines/terraform/templates/cd-template.yaml index b483a8b..6654ee8 100644 --- a/alz/azuredevops/pipelines/terraform/templates/cd-template.yaml +++ b/alz/azuredevops/pipelines/terraform/templates/cd-template.yaml @@ -58,7 +58,11 @@ stages: targetPath: '$(Build.ArtifactsStagingDirectory)' artifact: 'module' publishLocation: 'pipeline' - - pwsh: terraform show tfplan + - pwsh: | + terraform ` + -chdir="$${{ parameters.root_module_folder_relative_path }}" ` + show ` + tfplan displayName: Show the Plan for Review - stage: apply displayName: Apply diff --git a/alz/github/actions/terraform/templates/workflows/cd-template.yaml b/alz/github/actions/terraform/templates/workflows/cd-template.yaml index f6176fb..e4b97e8 100644 --- a/alz/github/actions/terraform/templates/workflows/cd-template.yaml +++ b/alz/github/actions/terraform/templates/workflows/cd-template.yaml @@ -52,7 +52,7 @@ jobs: run: | # shellcheck disable=SC2086 terraform \ - -chdir="$${inputs.root_module_folder_relative_path}}" \ + plan \ -out=tfplan \ -input=false \ @@ -73,7 +73,10 @@ jobs: path: ./staging/ - name: Show the Plan for Review - run: terraform show tfplan + run: terraform \ + -chdir="$${inputs.root_module_folder_relative_path}}" \ + show \ + tfplan apply: needs: plan