Skip to content

Commit

Permalink
Pass in AWS provider to region modules
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Sep 27, 2024
1 parent 869e340 commit 94a462d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
18 changes: 18 additions & 0 deletions stun_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ provider "aws" {
region = "us-east-1"
}

provider "aws" {
alias = "eu-central-1"
region = "eu-central-1"
}

provider "aws" {
alias = "ap-southeast-1"
region = "ap-southeast-1"
}

module "us_east_1" {
source = "./region"

Expand All @@ -30,6 +40,10 @@ module "us_east_1" {
module "eu_central_1" {
source = "./region"

providers = {
aws = aws.eu-central-1
}

region = "eu-central-1"
domain_name = var.domain_name
image_tag = var.image_tag
Expand All @@ -45,6 +59,10 @@ module "eu_central_1" {
module "ap_southeast_1" {
source = "./region"

providers = {
aws = aws.ap-southeast-1
}

region = "ap-southeast-1"
domain_name = var.domain_name
image_tag = var.image_tag
Expand Down
4 changes: 0 additions & 4 deletions stun_server/region/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ locals {
infrastructure_region_outputs = data.tfe_outputs.infrastructure.values[data.aws_region.current.name]
}

provider "aws" {
region = var.region
}

data "tfe_outputs" "infrastructure" {
organization = "home_assistant"
workspace = "infrastructure"
Expand Down

0 comments on commit 94a462d

Please sign in to comment.