Giter Site home page Giter Site logo

aws-gcp-site-to-site-vpn's Introduction

Site-to-Site VPN Between GCP & AWS

This is a demo of how to deploy a Site-to-Site VPN between GCP and AWS.

Setup

Before running the demo, ensure that you have the following installed and configured:

- Terraform installed [Download Terraform](https://www.terraform.io/downloads.html)
- AWS CLI Installed [Install AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv1.html)
- Google Cloud CLI Installed [Installing Google Cloud SDK](https://cloud.google.com/sdk/install)

IMPORTANT It's best practice to try this out on a non-production workload first to ensure you understand how the resources will interact with your setup. Also note that deploying this configuration will incur costs on both the AWS & GCP side.

Step 1 - Ensure that the AWS & GCP CLIs are configured

Ensure that both the AWS & GCP CLI tools are configured.

# Google Cloud CLI is configured?
$ gcloud config configurations list
NAME     IS_ACTIVE  ACCOUNT                   PROJECT    COMPUTE_DEFAULT_ZONE  COMPUTE_DEFAULT_REGION
default  True       <your-email-address>      <project>  europe-west2-c        europe-west2

# AWS CLI is configured?
$ aws sts get-caller-identity
{
    "UserId": "AIDAU4KESKG7JHGUIEZBW",
    "Account": "<account-id>",
    "Arn": "arn:aws:iam::<account-id>:user/<username>"
}

Step 2 - Configure Terraform Input Variables

Open the vpn/inputs.auto.tfvars file and update the values to for the GCP and AWS VPCs.

#
# GCP Variables
#
gcp_credentials_file_path = "/home/ubuntu/.config/gcloud/legacy_credentials/<your-email@domain.com>/adc.json"

gcp_project_id = "<project_id>"

gcp_region = "europe-west2"

gcp_network_name = "default"

#
# AWS Variables
#
aws_credentials_file_path = "/home/ubuntu/.aws/credentials"

aws_region = "eu-west-1"

aws_vpc_id = "<vpc_id>"

Step 3 - Initialize Terraform and Inspect the Plan

With the variables configured, we can initialize Terraform and generate a plan:

$ cd vpn

# Initialize Terraform Providers
$ terraform init

# Generate the Plan
$ terraform plan -var-file inputs.tfvars -out vpn-connection.tfplan

# View the Plan
$ terraform show vpn-connection.tfplan

IMPORTANT Check the output of the plan to make sure it won't interfere with your existing setup.

Step 4 - Apply the Terraform Plan

Once you're ready to deploy this configuration you can apply:

$ cd vpn

$ terraform apply vpn-connection.tfplan

[Optional] Step 5 - Tear Down & Cleanup

If you're just testing this in a non-production environment, you can save costs by deleting the resources when you're finished.

$ cd vpn

$ terraform destroy

aws-gcp-site-to-site-vpn's People

Contributors

fortejas avatar

Stargazers

 avatar

Watchers

 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.