From 4485ecf670e372e0f988969fe953eeedd61ffe90 Mon Sep 17 00:00:00 2001 From: Krisjanis Lejejs Date: Wed, 25 Sep 2024 16:02:52 +0300 Subject: [PATCH] Add infrastructure deployments for EU and AP (#89) * Fix infrastructure deployments for different regions * Add versions.tf * Add infrastructure deployments for eu and ap --- infrastructure/main.tf | 14 ++++++++++++++ infrastructure/outputs.tf | 20 ++++++++++++++++++++ infrastructure/region/module.tf | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 infrastructure/region/module.tf diff --git a/infrastructure/main.tf b/infrastructure/main.tf index 46782cb..4c207e9 100644 --- a/infrastructure/main.tf +++ b/infrastructure/main.tf @@ -18,3 +18,17 @@ module "us_east_1" { ecs_policy = aws_iam_instance_profile.ecs_instance_profile.arn network_cidr = var.network_cidr["us-east-1"] } + +module "eu_central_1" { + source = "./region" + region = "eu-central-1" + ecs_policy = aws_iam_instance_profile.ecs_instance_profile.arn + network_cidr = var.network_cidr["eu-central-1"] +} + +module "ap_southeast_1" { + source = "./region" + region = "ap-southeast-1" + ecs_policy = aws_iam_instance_profile.ecs_instance_profile.arn + network_cidr = var.network_cidr["ap-southeast-1"] +} diff --git a/infrastructure/outputs.tf b/infrastructure/outputs.tf index e907ee1..be95563 100644 --- a/infrastructure/outputs.tf +++ b/infrastructure/outputs.tf @@ -12,3 +12,23 @@ output "us-east-1" { "network_id" : module.us_east_1.network_id, } } + +output "eu-central-1" { + description = "Outputs for the eu-central-1 region" + value = { + "public_subnets" : module.eu_central_1.public_subnets, + "private_subnets" : module.eu_central_1.private_subnets, + "ecs_cluster" : module.eu_central_1.ecs_cluster, + "network_id" : module.eu_central_1.network_id, + } +} + +output "ap-southeast-1" { + description = "Outputs for the ap-southeast-1 region" + value = { + "public_subnets" : module.ap_southeast_1.public_subnets, + "private_subnets" : module.ap_southeast_1.private_subnets, + "ecs_cluster" : module.ap_southeast_1.ecs_cluster, + "network_id" : module.ap_southeast_1.network_id, + } +} diff --git a/infrastructure/region/module.tf b/infrastructure/region/module.tf new file mode 100644 index 0000000..dc58d9a --- /dev/null +++ b/infrastructure/region/module.tf @@ -0,0 +1,3 @@ +provider "aws" { + region = var.region +}