From 07847b9aa3ccc27e11dee81b322ab4b3a906af9a Mon Sep 17 00:00:00 2001 From: mohnishbasha Date: Thu, 22 Jun 2023 12:02:27 -0500 Subject: [PATCH 1/2] provision acceptor vpc in a different region --- examples/complete/main.tf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 3fb6120..d183f07 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -2,6 +2,11 @@ provider "aws" { region = var.region } +provider "aws" { + alias = "us-east-1" + region = "us-east-2" +} + module "requestor_vpc" { source = "cloudposse/vpc/aws" version = "2.1.0" @@ -51,6 +56,11 @@ module "requestor_subnets_additional" { } module "acceptor_vpc" { + + providers = { + aws = aws.us-east-1 + } + source = "cloudposse/vpc/aws" version = "2.1.0" attributes = ["acceptor"] @@ -60,6 +70,11 @@ module "acceptor_vpc" { } module "acceptor_subnets" { + + providers = { + aws = aws.us-east-1 + } + source = "cloudposse/dynamic-subnets/aws" version = "2.1.0" availability_zones = var.availability_zones From 7dd9dba2ab6d901fc1fd10fe1b95f5726334ad3f Mon Sep 17 00:00:00 2001 From: mohnishbasha Date: Thu, 22 Jun 2023 12:14:54 -0500 Subject: [PATCH 2/2] provision acceptor vpc in a different region than requestor vpc --- examples/complete/fixtures.us-east-2.tfvars | 4 ++++ examples/complete/main.tf | 4 ++-- examples/complete/variables.tf | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/examples/complete/fixtures.us-east-2.tfvars b/examples/complete/fixtures.us-east-2.tfvars index 86a6547..c973ef7 100644 --- a/examples/complete/fixtures.us-east-2.tfvars +++ b/examples/complete/fixtures.us-east-2.tfvars @@ -1,7 +1,11 @@ region = "us-east-2" +acceptor_region = "us-east-1" + availability_zones = ["us-east-2a", "us-east-2b"] +accceptor_availability_zones = ["us-east-1a", "us-east-1b"] + namespace = "eg" stage = "test" diff --git a/examples/complete/main.tf b/examples/complete/main.tf index d183f07..cd46b8b 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -4,7 +4,7 @@ provider "aws" { provider "aws" { alias = "us-east-1" - region = "us-east-2" + region = var.acceptor_region } module "requestor_vpc" { @@ -77,7 +77,7 @@ module "acceptor_subnets" { source = "cloudposse/dynamic-subnets/aws" version = "2.1.0" - availability_zones = var.availability_zones + availability_zones = var.accceptor_availability_zones attributes = ["acceptor"] vpc_id = module.acceptor_vpc.vpc_id igw_id = [module.acceptor_vpc.igw_id] diff --git a/examples/complete/variables.tf b/examples/complete/variables.tf index e6c5646..fc40f7a 100644 --- a/examples/complete/variables.tf +++ b/examples/complete/variables.tf @@ -3,11 +3,21 @@ variable "region" { description = "AWS Region" } +variable "acceptor_region" { + type = string + description = "AWS Region" +} + variable "availability_zones" { type = list(string) description = "List of availability zones" } +variable "accceptor_availability_zones" { + type = list(string) + description = "List of availability zones" +} + variable "requestor_vpc_cidr" { type = string description = "Requestor VPC CIDR"