Create AWS Site with TGW

Objective

This guide provides instructions on how to create an F5® Distributed Cloud Services Amazon Web Services (AWS) Transit Gateway (TGW) site using F5® Distributed Cloud Console (Console). For more information on sites, see F5 Distributed Cloud Site.

Using the instructions provided in this guide, you can create an AWS TGW site object in Console and deploy the virtual private cloud (VPC) with TGW site using the object.


Design

The AWS TGW Site is a way to orchestrate/automate the deployment and management of AWS TGW related resources and other resources needed to deploy an F5® Distributed Cloud Services AWS site on a new or existing VPC, which is called a Services VPC.

AWS TGW - Site Deployment & TGW Creation

An AWS TGW site does the following:

  • Automates the creation of the TGW resource, the TGW route table, and the VPN connection between the TGW and Distributed Cloud Services site.

  • Attaches the VPN connection to the TGW.

  • Adds the default routes to the main route table of the attached VPCs.

There are two TGW route tables which are created:

  1. VPC route table.

  2. Services route table.

The VPC route table is where all the VPC attachments will be attached, and the route will be propagated from the site via BGP over VPN attachment. The site advertised default route will be installed in the VPC route table so that it can attract all the traffic coming from the VPC attachments attached to the VPC route table.

The Services route table is where the VPN connection to the site is attached; the routes of VPC attached to the TGW will be propagated into the services route table. The same VPC CIDR routes will be learned by the site via the BGP connection to the TGW.

The following shows North-South traffic from the Spoke VPC, as indicated in Figure: AWS TGW - Services VPC + TGW + Single VPC Attachment.

  • Egress FROM Spoke VPC (HR): Traffic originating from source 192.168.100.0/22 lands in VPC route table. Traffic destined to ANY will match the 0.0.0.0/0 route pointing to an Equal Cost Multi-Path (ECMP) toward interfaces vpn-att-4 and vpn-att-5 (which are the Distributed Cloud Services nodes installed in the service VPC), and is eventually sent out toward the TGW (after F5® Distributed Cloud Mesh features and policies are applied).

  • Ingress TO Spoke VPC (HR): Traffic originating from source (anywhere) landing in the services route table will match on destination 192.168.100.0/22. This has a matching interface of vpc-att-3. Traffic is then forwarded to the spoke VPC.

Figure: AWS TGW - Services VPC + TGW + Single VPC Attachment
Figure: AWS TGW - Services VPC + TGW + Single VPC Attachment

AWS TGW - VPC Attachments

You can create a VPC attachment of spoke VPC to TGW not only while creating the initial AWS TGW Site but also after the site is deployed. You can go to the VPC attachments section and add vpc-id, and then you can assign a key-value label for each vpc-id. These labels can be used while creating network policy to allow traffic between the VPCs and to the Internet.

Once VPC attachments are added to the AWS TGW Site and apply action is completed, all these VPCs will be attached to the TGW. These VPC attachments will be associated with the VPC route table so that all traffic coming from the VPC will be routed to the site because of the default route pointing to the VPN attachment. Same VPC attachments will be added to the services route table in a way that VPC CIDR routes are propagated to the Customer Edge (CE).

Site deployment workflow will create a default route pointing to the transit gateway in the main route table of all VPCs attached to the TGW.

Figure: AWS TGW with Additional VPC Attachments
Figure: AWS TGW with Additional VPC Attachments

East-West Traffic:

  1. From the main route table of the VPC, the traffic will be directed toward the transit gateway because of the default route.

  2. In the transit gateway’s VPC route table, a route lookup is done and moves to the site, which is the next hop (NH).

  3. In the site’s route table, it will have all the VPC routes learned from TGW. The NH is set as TGW.

  4. Next, the lookup is done in the services route table and goes to the destination VPC using the attachment.

North-South Traffic:

The following is the ingress/egress traffic flow from VPC to the Internet:

  1. From the main route table of the VPC, the traffic will be directed toward the transit gateway because of the default route.

  2. In the transit gateway’s VPC route table, a route lookup is done and then moves to the site, which is the next hop.

  3. In the site route table, the default route points to the forward proxy, which connects the inside network to outside network. SNAT is performed on the outside interface and traffic is sent to the Internet.

Network Policies

The site can be your ingress/egress and East/West security policy enforcement point, as all the traffic coming from attached VPCs will flow through the site. If the traffic does not match the type defined in your network policy, then the default action will be to deny it.

Network Policies Between Attached VPCs (East-West Traffic)

It is a common use case for enterprises to have workloads of one department or environment spread across multiple VPCs, and one must be able to create a single network policy which could be applied for multiple VPCs attached.

For such scenarios, you can assign the same labels to group the VPCs attached to the TGW. The exact same labels can be used as the label selector while selecting an endpoint during network policy. You can then define ingress and egress policies with respect to that endpoint. This network policy will be applied for all traffic going towards or coming from the VPCs which match the label selector labels.

Network Policies for Ingress/Egress Traffic

Even for ingress/egress traffic, you can continue using a label selector to select the VPCs for which you are defining the network policy. You can define the egress policy by adding the egress rules from the point of VPC to deny/allow a specific traffic pattern. You can also add ingress rules to deny/allow traffic coming toward the endpoint based on the intent.

Forward Proxy Policy for Attached VPCs

Using a forward proxy policy, you can specify allowed/denied TLS domains or HTTP URLs. The traffic from workloads on private subnets toward the Internet via the AWS TGW site is allowed or denied accordingly.

AWS Direct Connect Orchestration

Cloud to On-Premises Traffic

Direct Connect enables you to privately connect your on-premise data centers to a VPC. Distributed Cloud Services automatically discovers the on-premise data center routes advertised by on-premise routers connected to AWS routers via Direct Connect. These routes will be learned on the inside network of the Site. There are two supported modes of Direct Connect private Virtual Interface (VIF).

Note: The major prerequisite is that the Direct Connect connection (dedicated or hosted) is managed by the user. This includes complete cross connects, the creation of a private VIF, and the creation of link aggregation groups (LAGs), if needed, between the customer on-premise location and Direct Connect COLO.

Standard VIF: In this mode, site orchestration creates the Direct Connect gateway (DCGW) and Virtual Private Gateway (VGW). Ensure that you connect one or multiple VIFs to the DCGW.

Hosted VIF: In this mode, site orchestration accepts the configured list of VIFs delegated from the Direct Connect connection owner account to the hosted VIF acceptor account. You can set a list of VIF IDs to be accepted. The site orchestration then creates the DCGW, VGW, and connects the VIFs to the DCGW.

In the diagram below, either VPC-A or VPC-B can communicate with the on-premises network using the global physical network for AWS Direct Connect. For example, if VPC-A wants to communicate with the on-premises network, the AWS TGW will push the request to the Services VPC, and then to the AWS VGW. The AWS VGW will send the request to the DCGW using the VIF. Then through the AWS Direct Connect, and then finally to the on-premises network.

If there needs to be inter-VPC communication, for example between VPC-A and VPC-B, then the AWS TGW will send the VPC-A request to the F5 Distributed Cloud Services Mesh CE, and then back out to the AWS TGW before finally landing at the VPC-B destination.

Figure
Figure: Cloud to On-Premises Traffic Diagram

East-West Traffic

East-West communication (for example, between a VPC1 in region 1 and a VPC2 in region 2): These are Spoke VPCs and this VPC to VPC communication will only work if there is a DC Cluster Group between Site 1 and Site 2. These connections are made using Direct Connect to the F5 Distributed Cloud Services backbone. If Layer 3 network connectivity is required, then you need to have a global network.

Traffic example:

  1. Originator sends a request from VPC1, which lands on TGW1 object.

  2. TGW1 forwards to F5 Distributed Cloud Services TGW Site1.

  3. The TGW Site1 forwards to VGW1.

  4. VGW1 sends the packets to the DCGW1.

  5. The DCGW1 routes the packets (with Standard VIF or Hosted VIF) onto the Direct Connect link.

  6. Packets on the Direct Connect link are received using VIFs at DCGW2.

  7. DCGW2 sends to VGW2.

  8. VGW2 to sends to TGW Site2 which, in turn, routes to its own TGW2 object.

  9. The TGW2 sends packets to its VPC2.


Prerequisites

The following prerequisites apply:

  • A Distributed Cloud Services Account. If you do not have an account, see Create an Account.

  • An AWS Account. See Required Access Policies for permissions needed to deploy an AWS TGW site.

  • Resources required per node: Minimum 4 vCPUs and 14 GB RAM.

  • There should be no pre-existing Site Local Outside, Site Local Inside, and Workload subnet association when attaching an existing VPC.

  • If Internet Gateway (IGW) is attached with the VPC, at least one of the routes should point to IGW in any route table of the VPC.

  • UDP port 6080 needs to be opened between all the nodes of the site.


Deploy Using Console

The following video shows the AWS TGW site object creation and deployment workflow using Console:

You can create and manage an AWS TGW site in Console by first creating the site object using the guided wizard and then deploying it using the automated method.

Create AWS TGW Site Object

The wizard to create the AWS TGW site object guides you through the steps for required configuration.

Step 1: Start AWS TGW site object creation.
  • Log into Console.

  • Click Multi-Cloud Network Connect.

Figure: Console Homepage
Figure: Console Homepage
  • Click Manage > Site Management > AWS TGW Sites.

  • Click Add AWS TGW Site.

Figure: Create AWS TGW Object
Figure: Create AWS TGW Object
  • In the Metadata section, enter a name for your TGW site object.
Step 2: Configure the TGW and VPC settings.
  • In the AWS Resources section, perform the following:

    • Click Configure.

    • From the Credential Reference menu, select an existing AWS credentials object or click Add Item to load the new credential creation wizard. Refer to the Cloud Credentials guide for more information. Ensure that the AWS credentials are applied with required access policies in accordance with the Policy Requirements document.

    • From the AWS Region menu, select the region based on your AWS account.

Step 2.1: Configure services VPC.
  • From the Select Services VPC menu, select an option and configure per the following guidelines:

    • For the New VPC Parameters option, select an option from the AWS VPC Name menu. The Autogenerate VPC Name option is selected by default. If you select the Choose VPC Name option, enter a VPC name in the Choose VPC Name field.

    • Enter the Classless Inter-Domain Routing (CIDR) block in the Primary IPv4 CIDR block field.

Figure: New Services VPC Configuration
Figure: New Services VPC Configuration
  • For the Existing VPC option, enter an existing VPC name in the Existing VPC field. If you use this option, you are required to enable the enable_dns_hostnames field in the existing VPC configuration.
Step 2.2: Configure the TGW settings.
  • In the Transit Gateway section, select an option from the Select Transit Gateway menu, and configure per the following guidelines:

    • For the New TGW Parameters option, select an option for the Select BGP ASN field. If you select Automatic, Distributed Cloud Services assign the ASNs for the TGW and site. For the User will assign ASN for TGW and F5XC Site option, enter the ASNs for Enter TGW ASN and Enter F5XC Site ASN fields. The supported ASN range is from 64513 to 65534.

    • For the Existing TGW option, enter the TGW ID in the Existing TGW ID field. Enter the ASNs for Enter TGW ASN and Enter F5XC Site ASN fields.

Figure: TGW Configuration
Figure: TGW Configuration
Step 2.3: Configure site node parameters.
  • In the Site Node Parameters section, configure per the following guidelines:

    • Select an option from the AWS Instance Type for Node menu.

    • Enter your public key in the Public SSH key field for SSH access to your node later.

    • In the Ingress/Egress Gateway (two Interface) Nodes in AZ field, click Add Item.

    • Select an option from the AWS AZ Name menu that matches the configured AWS Region.

    • From the Workload Subnet menu, select New Subnet or Existing Subnet ID.

Note: Workload subnet is the network where your application workloads are hosted. For successful routing towards applications running in workload subnet, an inside static route to the workload subnet CIDR needs to be added on the respective site object.

  • Enter either a subnet address in the IPv4 Subnet field or a subnet ID in Existing Subnet ID field.

  • From the Subnet for Outside Interface menu, select New Subnet or Existing Subnet ID.

  • Enter either a subnet address in the IPv4 Subnet field or a subnet ID in the Existing Subnet ID field.

  • From the Subnet for Inside Interface menu, select Autogenerate Subnet or Specifiy Subnet.

  • Enter a new subnet address in the IPv4 Subnet field or a subnet ID in the Existing Subnet ID field.

  • Click Apply.

Note: The AWS Certified Hardware option is set to aws-byol-multi-nic-voltmesh by default. You can add more than one node using the Add item option.

Step 2.4: Configure worker nodes.

From the Desired Worker Nodes for the site menu, select an option to add more nodes based on site or availability zone (AZ). The default option sets the amount to 0.

Step 2.5: Configure advertise VIP.

From the Advertise VIPs to Internet on Site menu, select whether to enable advertisement of site IP to the Internet.

Step 3: Optionally, configure VPC attachments.
  • In the Associate Spoke VPCs section, click Configure.

  • Click Add Item.

  • Enter the VPC ID in the VPC ID field. Select labels from the Labels For VPC ID menu.

Note: If you are deploying a new AWS VPC site into an existing VPC, the deployment will fail if the AWS subnet has the hostname type set to the resource name. In AWS Management Console, ensure that the hostname is in ip-* format.

  • Click Apply to apply the VPC settings.

  • Click Apply again to apply the VPC settings to the AWS TGW object.

Note: You can add multiple VPC attachments using the Add Item button. You can add VPC attachments during AWS TGW site creation, or you can edit an existing TGW site configuration to add VPC attachments.

Step 4: Optionally, perform TGW network configuration.
  • In the Network Configuration section, click Configure.

  • From the Select Global Networks to Connect menu, select an option. To connect your inside network to a global network, select Connect Global Networks and then perform the following:

    • Click Add Item.

    • From the Select Network Connection Type menu, select an option for connecting the network (inside or outside) and method to connect.

    • From the Global Virtual Network menu, select the virtual network.

    • Click Apply.

  • From the Manage Static Routes for Inside Network menu, select Manage Static Routes and perform configuration per the following guidelines for the List of Static Routes field:

    • Click Add Item.

    • Select Simple Static Route and enter a static route in the Simple Static Route field. Or, select Custom Static Route and then click Configure and perform the following steps:

      • In the Subnets section, click Add Item and then select IPv4 Subnet or IPv6 Subnet from the Version menu. Enter a prefix and prefix length for your subnet. Click Apply.

      • Select a next-hop type from the Type menu. Select IPv4 Address or IPv6 Address from the Version menu in the Address section, and enter an IP address accordingly.

      • From the Network Interface menu, select a network interface or click Add Item to create and apply a new network interface.

      • In the Static Route Labels section, select supported labels using Add Label. You can select more than one from this list.

      • In the Attributes section, select supported attributes from the Attributes menu. You can select more than one from this list.

      • Click Apply to add the custom route.

      • Click Apply.

  • Select Manage Static routes from the Manage Static Routes for Outside Network menu, and click Add Item for the List of Static Routes field. Follow the same procedure as that of managing the static routes for inside network.

  • Click Apply.

Note: You can use the Add Item button to add multiple inside and outside networks.

  • From the Select DC Cluster Group menu, select an option to set your site in a DC cluster group:

    • Not a Member of DC Cluster Group: Default option.

    • Member of DC Cluster Group via Outside Network: Select the DC cluster group from the Member of DC Cluster Group via Outside Network menu to connect your site using an outside network.

    • Member of DC Cluster Group via Inside Network: Select the DC cluster group from the Member of DC Cluster Group via Inside Network menu to connect your site using an inside network.

Note: For more information, see the Configure DC Cluster Group guide.

From the Site Mesh Group Connection Type menu, select an option to connect a site mesh group.

  • Click Apply to apply the TGW network configuration.
Step 5: Optionally, perform TGW security configuration.
  • In the Security Configuration section, click Configure.

  • From the Manage Forward Proxy menu, select a forwarding policy:

    • Disable Forward Proxy: This is the default option and will not forward traffic.

    • Enable Forward Proxy with Allow All Policy: This option forwards all traffic.

    • Enable Forward Proxy and Manage Policies: This option forwards traffic based on the policy you select or specify. In the Forward Proxy Policies menu, select an existing proxy or select Add Item to create a new policy.

  • From the Manage Firewall Policy menu, select Active Firewall Policies.

  • Select an existing firewall policy or select Add Item. After creating the policy, click Continue to apply.

  • From the Manage East-West Service Policy menu, select an existing policy:

    • Disable East-West Service Policy: This is the default option and will not use a proxy for East-West traffic.

    • Enable East-West Service Policy: This option uses a proxy for East-West traffic. Click Add Item to create a policy.

    • Enable East-West traffic Proxy with Allow All Policy: This option sends all East-West traffic through a proxy for monitoring.

  • Click Apply.

Step 6: Optionally, configure geographical site information.
  • In the Software Configuration section, enable the Show Advanced Fields option.

  • Enter the geographical address and/or latitude and longitude for the site location.

Step 7: Optionally, configure more advanced settings.
  • In the Advanced Configuration section, enable the Show Advanced Fields option.

  • From the Logs Streaming menu, select Enable Logs Streaming and then select a log receiver or create a new log receiver.

  • From the Select F5XC Software Version menu, select an option.

  • From the Select Operating System Version menu, select an option.

  • Optionally, add a site to site tunnel IP and additional AWS tags.

  • To enable Direct Connect with default settings:

    • From the Direct Connect Choice menu, select Enable Direct Connect.

    • To view and change the default settings:

      • Click View Configuration.

      • From the AWS Direct Connect VIF Configuration drop-down menu, select an option for the Virtual Interface (VIF). Hosted VIF mode: With this mode, F5 will provision an AWS Direct Connect Gateway and a Virtual Private Gateway. The hosted VIP you provide will be automatically associated and will set up BGP peering. Standard VIF mode: With this mode, F5 will provision an AWS Direct Connect Gateway and a Virtual Private Gateway, a user associate VIP, and will set up BGP peering.

      • For the Hosted VIF mode option: Click Add Item. Enter a list of VIF IDs.

      • Click Apply.

    • Click Apply.

  • To block specific services from your site:

    • From the Services to be blocked on site menu, select Custom Blocked Services Configuration. Click Add Item. Select the service to block and then select the network. After you finish, click Apply.
  • To enable the offline survivability feature for your site:

    • From the Offline Survivability Mode menu, select Enable Offline Survivability Mode. This action will restart all pods for your site.
  • From the Select Performance Mode menu, select an option:

    • L7 Enhanced: This option optimizes the site for Layer 7 traffic processing.

    • L3 Mode Enhanced Performance: This option optimizes the site for Layer 3 traffic processing.

Step 8: Complete AWS TGW site object creation.
  • Click Save and Exit to complete creating the AWS TGW site object.
Figure: Complete Creating Object
Figure: Complete Creating Object

The Status field for the AWS TGW object displays Generated.


Deploy Site

Creating the AWS TGW site object in Console generates the Terraform parameters.

Note: Site upgrades may take up to 10 minutes per site node. Once site upgrade has completed, you must apply the Terraform parameters to site via Action menu on cloud site management page.

  • Navigate to the AWS TGW site object by clicking Manage > Site Management > AWS TGW Sites.

  • Find your AWS TGW site object and click Apply under the Actions column. The Status field for your AWS TGW site object changes to Apply Planning.

Note: Optionally, you can perform Terraform plan activity before deployment. Find your AWS TGW site object and click ... > Plan to start the action of Terraform plan. This creates the execution plan for Terraform.

  • Wait for the apply process to complete and the status to change to Applied.

Note: You can check the status for the apply action. Click ... > Terraform Parameters for your AWS TGW site object and then click the Apply Status tab.

  • Navigate to Sites > Sites List.

  • Verify status is Online. It takes a few minutes for the site to deploy and status to change to Online.

Note: When you update worker nodes for a site object, the Terraform Apply button is enabled. Click Apply. You can log into your node’s command-line interface (CLI) via SSH with username centos and your private key.


Delete AWS TGW Site

Perform the following steps to delete the AWS TGW site:

  • Navigate to the AWS TGW site object by clicking Manage > Site Management > AWS TGW Sites.

  • Find your AWS TGW site object and click ... > Delete.

  • Click Delete in the confirmation window.

Note: Deleting the AWS TGW site object deletes the sites and nodes from the VPC and deletes the VPC. If the delete operation does not remove the object and returns any errors, check the errors from the status, fix the errors, and then re-attempt the delete operation. If the problem persists, contact technical support. You can check the status using the ... > Terraform Parameters > Apply status option.


Deploy Site Using Terraform

This chapter provides instructions on how to create a single-node or multi-node site on Amazon Elastic Compute Cloud (EC2) using a custom Amazon Machine Image (AMI) with Terraform.

Perform the following procedure to deploy a site using Terraform:

Step 1: Confirm Terraform is installed.

In a terminal, enter terraform version. If you need to install, follow the instructions at the official guide.

Step 2: Create API credentials file.

Log into Console and create an API 12 certificate file and then download it. Use the instructions at Credentials for more help.

Step 3: Create a new directory on your system to place files for deployment.

Create a new directory on your system to place files for deployment.

Step 4: Download the deployment file.
  • Download the main.tf file from the official repository and place it in the newly created directory.

  • Open the file and configure any necessary fields.

  • Save the changes.

Step 5: Create file for variables.

In the same directory, create another file for variables and name it terraform.vars.

Step 6: Create and assign values for variables.
  • In the terraform.vars, create and assign the following variables:

    • For your site name, type a name within double quotes: site_name = "<site-name>"

    • For the region, type the name within double quotes: aws_region = "<region>"

    • For the region subtype, type the name within double quotes: aws_az = "<region-subtype>"

Step 7: Create and export variables for credentials and secret keys.
  • In the terminal, create and export the following variables:

    • Create this variable and assign it your API credentials password: export VES_P12_PASSWORD=<credential password>

    • Create this variable and assign it the path to the API credential file previously created and downloaded from Console: export VOLT_API_P12_FILE=<path to your local p12 file>

    • Create this variable and assign it the URL for your tenant. For example: export VOLT_API_URL=https://example.console.ves.volterra.io/api

    • Create this variable and assign it your AWS secret key: export aws_access_key=<access key>

    • Create this variable and assign it your AWS secret key that has been encoded with Base64: export b64_aws_secret_key=<base64 encoded value>

Note: You can also create and save these variables in the terraform.vars file. However, this may pose a security risk. Use caution when working with your credentials and secret keys.

Step 8: Initiate Terraform process.

Enter terraform init.

Step 9: Apply Terraform process.
  • Enter terraform apply.

  • If prompted for the secret key and secret key encoded in Base64, enter both.

  • Enter yes to confirm. This may take a few minutes to complete. After the process is complete, the output will state Apply complete!.

  • In Console, navigate to the list of sites and confirm the site was applied.


Destroy Site

Perform the following procedure to destroy the site using Terraform:

  • Enter terraform destroy.

  • If prompted for the secret key and secret key encoded in Base64, enter both.

  • Enter yes to confirm. This may take a few minutes to complete. After the process is complete, the output will state Destroy complete!.

  • In Console, navigate to the list of sites and confirm the site was destroyed.


Concepts


API References