From 9d3b92a39236ae3516def0a0119df7cfbbe43369 Mon Sep 17 00:00:00 2001 From: Pat Heard Date: Thu, 25 Jan 2024 09:00:24 -0500 Subject: [PATCH] chore: create production `import.tf` file (#584) Update the `lambdas` module to include an `import.tf` that is only generated for prod releases. --- env/cloud/lambdas/terragrunt.hcl | 170 ++++++++++++++++++++++++++++++- 1 file changed, 169 insertions(+), 1 deletion(-) diff --git a/env/cloud/lambdas/terragrunt.hcl b/env/cloud/lambdas/terragrunt.hcl index a8ac70d30..b2033001a 100644 --- a/env/cloud/lambdas/terragrunt.hcl +++ b/env/cloud/lambdas/terragrunt.hcl @@ -12,7 +12,8 @@ dependencies { } locals { - env = get_env("APP_ENV", "local") + env = get_env("APP_ENV", "local") + account_id = get_env("AWS_ACCOUNT_ID", "000000000000") } dependency "app" { @@ -153,3 +154,170 @@ inputs = { # Overwritten in GitHub Actions by TFVARS gc_template_id = "8d597a1b-a1d6-4e3c-8421-042a2b4158b7" # GC Notify template ID used for local setup } + +generate "import_existing_resources" { + disable = local.env != "production" + path = "import.tf" + if_exists = "overwrite" + contents = <