Skip to content

Apply Terraform

Step 2 — Apply Terraform (base infrastructure)

Section titled “Step 2 — Apply Terraform (base infrastructure)”
Terminal window
terraform init
terraform plan
terraform apply

Expect roughly 20 resources ( AWS
Amazon Web Services — the cloud platform used throughout this walkthrough.
VPC/network/compute/endpoints + GCP
Google Cloud Platform — the cloud provider connected to AWS via Interconnect multicloud in this walkthrough.
network/compute + DX Gateway
Direct Connect Gateway — an AWS resource that connects a Virtual Private Gateway (or Transit Gateway) to a Direct Connect or Interconnect link. Created by Terraform in this demo.
).

Save the outputs — you will reference them in later steps:

Terminal window
terraform output
OutputUsed in
aws_dx_gateway_idAWS console Step 3 — select Direct Connect Gateway
aws_allowed_prefix_for_gcpInformational — AWS CIDR advertised to GCP
gcp_advertised_routes_for_transport

gcloud Step 4 — —advertised-routes

gcp_vpc_network_name

gcloud Steps 4–5 — —network

gcp_transport_namegcloud Steps 4–5 — transport name

aws_instance_private_ip / gce_instance_private_ip

Step 7 — ping targets
OutputDescription
aws_dx_gateway_idDX Gateway for Interconnect creation
aws_allowed_prefix_for_gcpAWS CIDR sent toward GCP
gcp_advertised_routes_for_transport

GCP CIDR for —advertised-routes

gcp_vpc_network_nameGCP network name for gcloud
gcp_transport_nameTransport resource name
aws_instance_idEC2 ID for SSM
aws_instance_private_ipEC2 private IP (ping target from GCP)

gce_instance_name / gce_instance_zone

GCE SSH via IAP
gce_instance_private_ipGCE private IP (ping target from AWS)
gce_ssh_private_keyGenerated SSH private key for GCE (sensitive)
gce_ssh_public_keyMatching public key on the VM