From e417962a1c3a5759ab07d3d678f64c8600698172 Mon Sep 17 00:00:00 2001 From: Ronaldo Macapobre Date: Wed, 24 Jul 2024 00:02:04 +0000 Subject: [PATCH] Use env variables from root --- .../cloud/environments/sandbox/variables.tf | 6 ++--- .../cloud/environments/sandbox/webapp.tf | 27 +++++++++++-------- .../cloud/modules/container/variables.tf | 5 +--- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/infrastructure/cloud/environments/sandbox/variables.tf b/infrastructure/cloud/environments/sandbox/variables.tf index 19abccf5..1d36c686 100644 --- a/infrastructure/cloud/environments/sandbox/variables.tf +++ b/infrastructure/cloud/environments/sandbox/variables.tf @@ -1,6 +1,6 @@ -variable test_s3_bucket_name { - type = string +variable "test_s3_bucket_name" { + type = string description = "The name of the S3 bucket to create for testing" -} \ No newline at end of file +} diff --git a/infrastructure/cloud/environments/sandbox/webapp.tf b/infrastructure/cloud/environments/sandbox/webapp.tf index 8b533410..f3533ac4 100644 --- a/infrastructure/cloud/environments/sandbox/webapp.tf +++ b/infrastructure/cloud/environments/sandbox/webapp.tf @@ -1,23 +1,28 @@ locals { - environment = "snd" + environment = "snd" application_name = "jasper-aws" } module "security" { - source = "../../modules/security" - environment = local.environment - application_name = local.application_name - kms_key_name = "jasper-kms-key" + source = "../../modules/security" + environment = local.environment + application_name = local.application_name + kms_key_name = "jasper-kms-key" } module "storage" { - source = "../../modules/storage" + source = "../../modules/storage" + environment = local.environment + application_name = local.application_name + kms_key_name = module.security.kms_key_alias + test_s3_bucket_name = var.test_s3_bucket_name + depends_on = [module.security] +} + +module "container" { + source = "../../modules/container" environment = local.environment - application_name = local.application_name - kms_key_name = module.security.kms_key_alias - test_s3_bucket_name = var.test_s3_bucket_name - depends_on = [ module.security ] -} \ No newline at end of file +} diff --git a/infrastructure/cloud/modules/container/variables.tf b/infrastructure/cloud/modules/container/variables.tf index 0299e29a..541fb495 100644 --- a/infrastructure/cloud/modules/container/variables.tf +++ b/infrastructure/cloud/modules/container/variables.tf @@ -1,13 +1,10 @@ - - variable "environment" { type = string description = "The environment to deploy the application to" - default = "dev" } variable "ecr_repository_name" { type = string description = "Name of AWS ECR Repository" - default = "aws-ecr-repository" + default = "aws_ecr_repository" }