From 770d6f1e3615daacd2f9996bd86937819b0fb1b5 Mon Sep 17 00:00:00 2001 From: lpm0073 Date: Sat, 14 Jan 2023 15:15:12 -0600 Subject: [PATCH] allow mock_outputs during destroy --- .../ec2_bastion/terragrunt.hcl | 2 +- .../kubernetes/terragrunt.hcl | 2 +- .../kubernetes_cert_manager/terragrunt.hcl | 4 ++-- .../kubernetes_dashboard/terragrunt.hcl | 2 +- .../kubernetes_ingress_clb/terragrunt.hcl | 2 +- .../kubernetes_karpenter/terragrunt.hcl | 4 ++-- .../kubernetes_kubeapps/terragrunt.hcl | 2 +- .../kubernetes_metricsserver/terragrunt.hcl | 2 +- .../kubernetes_vpa/terragrunt.hcl | 4 ++-- .../mongodb/terragrunt.hcl | 8 +++++--- .../mongodb_volume/terragrunt.hcl | 2 +- .../mysql/terragrunt.hcl | 4 ++-- 12 files changed, 20 insertions(+), 18 deletions(-) diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/ec2_bastion/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/ec2_bastion/terragrunt.hcl index 953cd562..537c01db 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/ec2_bastion/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/ec2_bastion/terragrunt.hcl @@ -47,7 +47,7 @@ dependency "kubernetes" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { cluster_arn = "fake-cluster-arn" cluster_certificate_authority_data = "fake-cert" diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes/terragrunt.hcl index 77f6f779..c1da196f 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes/terragrunt.hcl @@ -41,7 +41,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" public_subnets = ["fake-public-subnet-01", "fake-public-subnet-02"] diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_cert_manager/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_cert_manager/terragrunt.hcl index 2029130f..37781d3b 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_cert_manager/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_cert_manager/terragrunt.hcl @@ -31,7 +31,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" public_subnets = ["fake-public-subnet-01", "fake-public-subnet-02"] @@ -45,7 +45,7 @@ dependency "kubernetes_ingress_clb" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { cluster_arn = "flake-cluster-arn" } diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_dashboard/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_dashboard/terragrunt.hcl index d56c38d1..bc22bb1e 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_dashboard/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_dashboard/terragrunt.hcl @@ -37,7 +37,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" public_subnets = ["fake-public-subnet-01", "fake-public-subnet-02"] diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_ingress_clb/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_ingress_clb/terragrunt.hcl index e1eab3b8..f5ff40ed 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_ingress_clb/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_ingress_clb/terragrunt.hcl @@ -30,7 +30,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" public_subnets = ["fake-public-subnet-01", "fake-public-subnet-02"] diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_karpenter/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_karpenter/terragrunt.hcl index 8e063f9b..d9a2f8bf 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_karpenter/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_karpenter/terragrunt.hcl @@ -35,7 +35,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" public_subnets = ["fake-public-subnet-01", "fake-public-subnet-02"] @@ -50,7 +50,7 @@ dependency "kubernetes" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate", "plan"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "plan", "destroy"] mock_outputs = { karpenter_node_group_iam_role_name = "fake-karpenter-node-group-iam-role-name" karpenter_node_group_iam_role_arn = "fake-karpenter-node-group-iam-role-arn" diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_kubeapps/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_kubeapps/terragrunt.hcl index 40e58bdb..ff24c4f2 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_kubeapps/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_kubeapps/terragrunt.hcl @@ -36,7 +36,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" public_subnets = ["fake-public-subnet-01", "fake-public-subnet-02"] diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_metricsserver/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_metricsserver/terragrunt.hcl index 89f49d5c..4c2d4551 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_metricsserver/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_metricsserver/terragrunt.hcl @@ -33,7 +33,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" public_subnets = ["fake-public-subnet-01", "fake-public-subnet-02"] diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_vpa/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_vpa/terragrunt.hcl index 61c713f3..6e9708c2 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_vpa/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/kubernetes_vpa/terragrunt.hcl @@ -34,7 +34,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" public_subnets = ["fake-public-subnet-01", "fake-public-subnet-02"] @@ -49,7 +49,7 @@ dependency "kubernetes" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate", "plan"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "plan", "destroy"] mock_outputs = { karpenter_node_group_iam_role_name = "fake-karpenter-node-group-iam-role-name" karpenter_node_group_iam_role_arn = "fake-karpenter-node-group-iam-role-arn" diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mongodb/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mongodb/terragrunt.hcl index b4461b21..815402c8 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mongodb/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mongodb/terragrunt.hcl @@ -35,7 +35,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" database_subnets = ["fake-subnetid-01", "fake-subnetid-02"] @@ -48,7 +48,7 @@ dependency "kubernetes" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { cluster_arn = "fake-cluster-arn" cluster_certificate_authority_data = "fake-cert" @@ -74,6 +74,8 @@ dependency "bastion" { config_path = "../ec2_bastion" skip_outputs = true + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] + mock_outputs = {} } dependency "mongodb_volume" { @@ -81,7 +83,7 @@ dependency "mongodb_volume" { config_path = "../mongodb_volume" # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { mongodb_volume_id = "fake-volume-id" mongodb_volume_arn = "fake-volume-arn" diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mongodb_volume/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mongodb_volume/terragrunt.hcl index b7dd6cfb..a1f6766b 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mongodb_volume/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mongodb_volume/terragrunt.hcl @@ -32,7 +32,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" database_subnets = ["fake-subnetid-01", "fake-subnetid-02"] diff --git a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mysql/terragrunt.hcl b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mysql/terragrunt.hcl index fe8998e2..53e12380 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mysql/terragrunt.hcl +++ b/{{cookiecutter.github_repo_name}}/terraform/stacks/{{cookiecutter.global_platform_shared_resource_identifier}}/mysql/terragrunt.hcl @@ -32,7 +32,7 @@ dependency "vpc" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { vpc_id = "fake-vpc-id" database_subnets = ["fake-subnetid-01", "fake-subnetid-02"] @@ -45,7 +45,7 @@ dependency "kubernetes" { # Configure mock outputs for the `validate` and `init` commands that are returned when there are no outputs available (e.g the # module hasn't been applied yet. - mock_outputs_allowed_terraform_commands = ["init", "validate"] + mock_outputs_allowed_terraform_commands = ["init", "validate", "destroy"] mock_outputs = { cluster_arn = "fake-cluster-arn" cluster_certificate_authority_data = "fake-cert"