Deploy Threat Defense Virtual in an Existing VPC on AWS

Language: English | 日本語

Introduction

This document describes the procedure of deploying Cisco Secure Firewall Threat Defense Virtual and other network components on AWS using a terraform script. This procedure creates all the required resources inside an existing VPC on your AWS account. If you want to deploy the Threat Defense Virtual on AWS in a new VPC, see Deploy Threat Defense Virtual in a New VPC on AWS.

End-to-End Process

The following flowchart illustrates the workflow for deploying Threat Defense Virtual in an existing VPC on AWS.

The cleanup stage in this historical workflow graphic means destroying the remote resources managed by this deployment. Deleting local Terraform files does not remove AWS resources.

Sample Topology

The following topology illustrates the single-device proof-of-concept deployment.

Prerequisites

  • Install Terraform. The linked archive is a proof-of-concept example, not a versioned compatibility matrix. Select compatible Terraform and AWS/TLS/local provider versions, record them with version constraints and the dependency lock file, and validate the configuration before planning. Choose a supported FTDv image/instance combination for the target region and accept the corresponding AWS Marketplace subscription. The package's FTD_version validation list is not a lifecycle or support recommendation.
  • Use a dedicated deployment directory and state/workspace. Verify the AWS account, region, permissions and intended resource ownership. The example creates subnets, routes, security groups, EC2 interfaces, Elastic IPs and an SSH key pair; a VPC/EC2 permission example alone is not a complete least-privilege policy. Refer to Amazon VPC policy examples and AWS IAM best practices.
  • The supplied security group permits all protocols from 0.0.0.0/0 and is attached to multiple interfaces. Replace it with rules and, where needed, separate groups permitting only approved management sources and required data traffic before applying the plan. Do not expose the proof-of-concept defaults as a production policy.

Procedure

Prepare the package

  1. Download the verified existing_vpc.zip at repository commit c3de8cc2f2420c7282fde03203a9fdb87f0a3643. This revision fixes the reference target; local preparation below is still required.
  2. Extract the archive and open the existing_vpc directory. Use the actual .tf, .tfvars and .tftpl files; example README values can differ from them. Remove the unused data "template_file" "startup_file" block from 02_SingleInstance_Terraform.tf: it refers to startup_file.txt, which is absent from this archive; the EC2 resource already uses templatefile(...startup_file.tftpl...).
  3. Configure AWS authentication through a method supported by the selected AWS provider, preferably temporary role credentials. To use its credential chain, remove access_key = var.aws_access_key and secret_key = var.aws_secret_key from the provider block, remove those two unused variable declarations from var.tf, and remove their assignments from terraform.tfvars. Do not put long-lived keys in the configuration. See Managing access keys for IAM users if keys are required by your environment.
  4. In terraform.tfvars, set the target region with straight quotes and no period inside the value, for example region = "us-east-1".
  5. Set admin_password to a unique password meeting the selected FTD release's requirements. Do not leave the supplied empty string or rely on the sample default. Replace startup_file.tftpl with the following template: the final member has no trailing comma, and jsonencode safely quotes the substituted password. ManageLocally selects local FDM management.
#Sensor
{
  "AdminPassword": ${jsonencode(admin_password)},
  "Hostname": "FTD-01",
  "ManageLocally": "Yes"
}
  1. Choose FTD_version, region, instance size and Marketplace AMI consistently. Confirm the AMI lookup returns exactly the intended image and that the instance supports the four attached interfaces. Restrict the supplied security groups as described above.
  2. Keep existing_vpc = true. Set vpc_name to the existing VPC's unique Name tag. The template looks up that tag; changing vpc_cidr does not resize or select the existing VPC. Confirm the actual VPC ID and its associated CIDR blocks in the plan.
  3. Set create_igw = true only if the VPC needs a new internet gateway; set it to false to look up the already attached gateway. Do not create a second gateway for a VPC that already has one.
  4. Enter four new, non-overlapping subnet CIDRs in mgmt_subnet, outside_subnet, inside_subnet and diag_subnet. Each must be contained in an associated VPC CIDR and must not overlap existing or proposed subnets. Select unused host addresses for ftd01_mgmt_ip, ftd01_outside_ip and ftd01_inside_ip; AWS reserves the first four and last IPv4 addresses in a subnet. In this package ftd01_diag_ip is declared but is not used by the diagnostic network-interface resource, so AWS assigns that address. All four subnets use ${region}a; confirm account-specific zone and instance-type availability. The aws_az variable is not used.

Plan, apply and verify

  1. Initialize the selected providers with terraform init, then run terraform validate and resolve any errors. Check the provider lock file and the exact account/workspace before continuing.
  2. Save a plan with terraform plan -out=deploy.tfplan. Review it with terraform show deploy.tfplan, including every create/change/destroy action and all security-group rules.
  3. Only after the plan is approved for the intended environment, apply that saved plan with terraform apply deploy.tfplan. A saved-plan apply does not prompt for a second approval.
  4. After initialization completes, the outputs ip and SSHCommand identify the management Elastic IP and SSH command. The generated private key is cisco-ftdv-key. Protect that file and confirm network reachability and authorized source rules. With ManageLocally = "Yes", use the supported FDM HTTPS setup procedure at the management address; this example does not register the device to FMC. An EC2 running state alone does not mean FTD initialization or inspection is ready.
  5. In the AWS console for the selected region, inspect the intended VPC, four subnets, routes, interfaces and EC2 instance. This package tags the instance Cisco FTDv; console navigation can differ from the historical Service > VPC / EC2 labels. Verify management access and the required traffic/policy behavior separately.
📘

NOTE:

Retain the configuration, provider lock file, .terraform directory and terraform.tfstate or configured remote state until cleanup is complete. State and saved plans can contain passwords and private keys; restrict access and protect backups. See Terraform sensitive-data guidance.

Clean-Up

Remove the proof-of-concept resources when no longer needed to avoid continuing charges. From the same configuration and intended AWS account/workspace/state, create a destruction plan with terraform plan -destroy -out=destroy.tfplan. Review it with terraform show destroy.tfplan; apply it only when every proposed deletion is intended, using terraform apply destroy.tfplan.

The interactive alternative, terraform destroy, also requires review of its proposed deletions before entering yes. Terraform destroys resources managed in the selected state; a previously manual resource can be affected if it was imported or otherwise brought under management. It does not mean deleting the entire AWS account. The existing VPC and reused gateway are data sources in the existing-VPC workflow, not resources created by that deployment.

Verify that the deployment's intended resources and any billable leftovers have been removed, while retained/shared resources remain. Delete local deployment files only after the remote cleanup and state-retention requirements are satisfied. See terraform destroy and Import existing resources.


What’s Next

Check out our Secure Firewall Github page: https://github.com/CiscoDevNet/secure-firewall
Or our YouTube channel: https://www.youtube.com/cisco-netsec

Did this page help you?
Title of the document The current suggested release is 7.6.6 Release 10.1 is live!