Coder Social home page Coder Social logo

acp-tf-peering's Introduction

Usage


Peering with same source and destination accounts

In the providers block, you may use any of the prescribed providers from the parent module which is calling this module. In this example, I have used the same provider which was from the acp_test_resources repo.

module "peering_example" {
  source = "git::https://github.com/UKHomeOffice/acp-tf-peering?ref=v1.0.2"

  providers = {
    aws.source = aws.eu-west-2
    aws.dest   = aws.eu-west-2
  }

  auto_accept = true

  vpc_source = {
    vpc_id     = "vpc-******"
    account_id = "******"
    name       = "******"
    vpc_cidr   = "******"
  }

  vpc_dest = {
    vpc_id     = "vpc-******"
    account_id = "******"
    name       = "******"
    vpc_cidr   = "******"
  }
}

Peering between source and destination in different accounts

When you need to peer between VPCs in different accounts, you can use the providers block to select different providers as stated in the parent modules variables that is calling this module.

module "peer_acp_ci_to_acp_ops" {
  source = "git::https://github.com/UKHomeOffice/acp-tf-peering.git?ref=v1.0.2"

  providers = {
    aws.source = aws.acp-ci
    aws.dest   = aws.acp-ops
  }

  vpc_source = {
    name       = "acp-ci"
    account_id = data.terraform_remote_state.acp-ci.outputs.account_id
    vpc_cidr   = data.terraform_remote_state.acp-ci.outputs.vpc_cidr
    vpc_id     = data.terraform_remote_state.acp-ci.outputs.vpc_id
  }

  vpc_dest = {
    name       = "acp-ops"
    account_id = var.acp_ops["account_id"]
    vpc_cidr   = var.acp_ops["vpc_cidr"]
    vpc_id     = var.acp_ops["vpc_id"]
  }

  source_tables = concat(values(data.terraform_remote_state.acp-ci.outputs.zone_gws), [data.terraform_remote_state.acp-ci.outputs.default_gw])

  dest_tables = split(",", var.acp_ops["route_table_ids"])

}

Requirements

Name Version
terraform >= 1.0
aws ~> 3.70

Providers

Name Version
aws.dest 3.71.0
aws.source 3.71.0

Modules

No modules.

Resources

Name Type
aws_route.dest_routes resource
aws_route.source_routes resource
aws_vpc_peering_connection.request resource
aws_vpc_peering_connection_accepter.accept resource

Inputs

Name Description Type Default Required
auto_accept Indicated we should attempt to accept on the peering side bool false no
dest_tables A list of routing tables id for the destination VPC list(string) [] no
peer_region The peering region if we are going across region string "" no
source_tables A list of routing tables id for the source VPC list(string) [] no
vpc_dest A destination map containing the keys, vpc_id, account_id and name map(string) n/a yes
vpc_source A source map containing the keys, vpc_id, account_id and name map(string) n/a yes

Outputs

Name Description
peering_id The peering connection id for the connection
vpc_dest The destination vpc id of the peering connection
vpc_source The source vpc id of the peering connection

acp-tf-peering's People

Contributors

gambol99 avatar nefischer avatar robjohnsonho avatar aibitayo55555 avatar

Watchers

Douglas Gardner avatar James Cloos avatar Iqbal Shaikh avatar Daniel A.C. Martin avatar Vijay Jadhav avatar  avatar Ben Eustace avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.