VM-Series Auto Scale Templates for AWS Version 2.1

Learn how VM-Series Auto Scaling templates help with centralized security and connectivity for AWS deployments.
The VM-Series Auto Scaling templates enable you to deploy a single auto scaling group (ASG) of VM-Series firewalls to secure inbound traffic from the internet to your application workloads on AWS. You can deploy the VM-Series firewall ASG and the application workloads within a single VPC as shown below.
You can also deploy the firewall ASG in a centralized VPC and your application workloads in separate VPCs within the same region, forming a hub and spoke architecture, as shown below.
With the hub and spoke architecture you can streamline the delivery of centralized security and connectivity for AWS deployments with many applications, VPCs, or accounts. This architecture can increase agility. Your network security administrators manage the firewall VPC, and DevOps administrators or application developers can manage the application VPCs.
Ensure that the application VPCs connected to the firewall VPC, do not have an Internet Gateway (IGW), and use a continuous monitoring and security compliance service such as RedLock.
You can use a single AWS account or multiple AWS accounts to monitor and secure traffic between VPCs and the internet. Centralizing firewalls in a single VPC can reduce costs for deployments with multiple VPCs and/or multiple accounts.
To provide flexibility with securing your application workloads, version 2.1 allows you to deploy an application load balancer or a network load balancer for both the external load balancer that fronts your VM-Series firewall ASG, and the internal load balancer (ILB) that fronts your application workloads.
When an application load balancer fronts the application workloads, you can connect the firewall VPC to the application VPC using VPC peering. When an NLB fronts the application workloads you can use VPC Peering or an AWS Private Link to connect the firewall and application VPCs, as summarized below:
Firewall VPC LB(External)Application VPC LB (Internal)Connection Method
ALBNLBAWS Private Link
NLBNLBAWS Private Link
If you deploy in a single VPC you can use all the load balancing combinations in the previous table.
You can deploy the templates in both and greenfield (new VPC and applications) and brownfield (existing VPC and applications) use cases.

What Components Do the VM-Series Auto Scaling Template for AWS (v2.1) Leverage?

The VM-Series Auto Scaling template for AWS includes the following building blocks.

VM-Series Firewall Templates

The firewall templates deploy an internet-facing external load balancer and VM-Series firewalls within an auto scaling group that spans a minimum of two Availability Zones (AZs). The external load balancer distributes incoming VPC traffic across the pool of VM-Series firewalls. It can be an application load balancer (ALB) or a network load balancer (NLB). The VM-Series firewalls automatically publish custom PAN-OS metrics that enable auto scaling.
firewall-new-vpc-v2.1.templateDeploys a firewall stack with two to four availability zones in a new VPC.
Deploys a firewall stack with two to four availability zones in an existing VPC.
To deploy in an existing VPC you must enter:
  • VPC ID
  • Internet Gateway ID. This is an existing gateway.
  • Subnet CIDR lists for the Management, Untrust, Trust, NAT Gateway and Lambda subnets. The template uses the CIDRs to create these subnets.
If you choose to create a new ELB, the template connects the firewall ASG to the ELB backend pool. If you use an existing ELB, you must manually connect the firewall ASG to the existing load balancer backend.

Application Templates

The application template deploys an internal load balancer (ILB) and one auto scaling group with a web server in each availability zone (AZ).
panw-aws-same-vpc-v2.1.templateDeploy application in same VPC as the firewall VPC. You can choose a network or application load balancer.
Deploy application in a new VPC, using ALB as the internal load balancer, and using VPC Peering between the firewall VPC and application VPC. Supports both same account and cross-account deployments.
You must supply the following parameters:
  • Hub account ID
  • Hub VPC ID for VPC peering
  • Hub VPC trust subnet CIDRs. The template uses these for route table construction after VPC peering is established, one CIDR per availability zone.
  • StsAssumeRoleARN (output from the Hub template for SQS access)
Deploy application in a new VPC, using NLB as the internal load balancer, and using NLB Endpoint Services/Interfaces to communicate between the firewall VPC and application VPC.
You must supply these parameters.
  • Hub account ID
  • StsAssumeRoleARN (output from the Hub template for SQS access)
Deploy ALB in an existing Application VPC. You must supply the VPC ID for your application, and an existing Subnet ID.
This template deploys the load balancer in the application VPC and establishes the lambda resources. You must detach your target workload from any existing load balancer, and connect it to the new load balancer.
Deploy NLB in an existing Application VPC. Deploy application in a new VPC, using NLB as the internal load balancer, and using NLB Endpoint Services/Interfaces to communicate between the firewall VPC and application VPC.

Lambda Functions

AWS Lambda provides robust, event-driven automation without the need for complex orchestration software. AWS Lambda monitors a Simple Queue Service (SQS) to learn about load balancers (ALBs or NLBs) that publish to the queue. When the Lambda function detects a new load balancer, it creates a new NAT policy rule and applies it to the VM-Series firewalls within the ASG. The firewalls have a NAT policy rule for each application, and the firewalls use the NAT policy rule (that maps the port to the load balancer IP address) to forward traffic to the load balancer in front of the application web servers.
The Lambda functions also delete all the configuration items that Lambda added to the device group and template stack in Panorama. This includes the NAT rule, Address Object, and Static Routes that were pushed to the VM-Series firewall. The Lambda function handles delicensing as well.
To learn more about the Lambda functions, refer to the Palo Alto Networks AWS AutoScale Documentation.


You must have Panorama management server in Panorama mode to configure Auto Scaling v2.1.
The Panorama management server provides centralized monitoring and management of multiple Palo Alto Networks next-generation firewalls from a single location. Panorama allows you to oversee all applications, users, and content traversing your network, and use this knowledge to create application enablement policies that protect and control the network. If you are not familiar with Panorama please see the Panorama Administrator’s Guide.
Managed firewalls are bootstrapped with an init-config.txt file. A sample file is included in the GitHub repository so that you can copy the configuration from the template stack and device group when you create them in your existing Panorama.
The untrust and trust zones created in Panorama must be all lower case.
In Panorama you must configure your network interfaces using DHCP.
  • Only eth1/1 should automatically create default route trust and untrust zones.
  • The Security Policy zones are named untrust and trust.
    All zone names must be lower case
  • The templates configure an Administrator account named pandemo and the password demopassword.
  • Create a virtual router with the naming convention VR-<TemplateStackName>. On the virtual router ECMP tab, enable ECMP.
  • To set the DNS server address on Panorama, select DeviceSetupServices. Set the Primary DNS Server to, the Secondary DNS Server to, and the FQDN Refresh Time (sec) to 60. Panorama requires the AWS DNS server IP address to resolve the FQDN of the internal load balancer on AWS. The FQDN refresh time is the interval at which Panorama commits newly detected internal load balancers.
After the application template has launched, Lambda populates the following in Panorama:
  • NAT policy
  • Address object for LB in Application Template
  • Static routes in the virtual router
  • Tcp81 service object
The v2.1 firewall template includes an AWS NAT gateway that the firewalls use to initiate outbound requests for retrieving updates, connecting to Panorama, and publishing metrics to AWS CloudWatch. The NAT Gateways also have Elastic IP addresses attached to them for each zone.
You need the following Panorama resources to work with the Auto Scale templates for AWS.
Panorama API KeyYou need a Panorama API key to authenticate the API. Lambda uses your API key to autoconfigure template and device group options. To generate the API key, see Get Your API Key.
Panorama License Deactivation KeyThe template requires a license deactivation API key and the “Verify Update Server Identity” to be enabled to deactivate the license keys from Panorama. The license deactivation key should be obtained from Palo Alto Customer Support Portal as described in Install a License Deactivation API Key.
Panorama VM-Auth-Key
You need a vm-auth-key to enable bootstrapped firewalls to connect to Panorama and receive their bootstrap configuration. See Generate the VM Auth Key on Panorama.
Panorama Management Interface Access
  • Port 443 (HTTPS)—Upon initial deployment of the firewall template, leave HTTPS open so Lambda can connect to Panorama. Wait to receive the following confirmation of connection in Panorama:
    When you secure port 443 you specify an IP range from which you will allow connections, as well as the EIPs assigned to the NAT gateways. To find NAT gateway EIPs in AWS, go to VPCNAT Gateways. There are two NAT gateways and the EIPs associated with them. Note the EIP information for the security group for HTTPS.
  • Port 3978—Port 3978 must be able to receive traffic from any IP address.

Bootstrap Files

The GitHub auto scaling repository includes an init-cfg.txt file so that the VM-Series firewall has the basic configuration to:
  • Perform interface swap so the VM-Series firewall untrust traffic uses AWS ENI for eth0.
  • Communicate to Panorama for device group and template configuration.
The auto scaling GitHub repository has the basic configuration to get started. This auto scaling solution requires swapping the dataplane and management interfaces to enable the load balancer to forward web traffic to the VM-Series firewall auto scaling tier. For details on management interface mapping with the Amazon ELB as shown in Managment Interface Mapping for Use with Amazon ELB.

Plan to Deploy VM-Series Auto Scaling Templates for AWS (v2.1)

Before starting the deployment, review the following resources.

Related Documentation