Skip to main content

Palo Alto Networks VM-series firewall deployment

To manage via ssh/https please connect to the second interface (the nic1) of a VM-series firewall. The primary interface is by default not used for management.

When troubleshooting you can use this module also with a good ol' Linux image. Instead of booting PAN-OS, you can just re-create the same instance with Linux. It boots faster, it's probably more familiar, but there is a caveat when connecting from outside the GCP VPC Network:

  • One cannot connect to nic1 of Linux, because GCP DHCP doesn't ever furnish it with a default route. Connect to the primary interface (the nic0) for both data traffic and management traffic.

GitHub Logo Terraform Logo

Reference

Requirements

NameVersion
terraform>= 1.3, < 2.0
google~> 4.54
null~> 3.1

Providers

NameVersion
google~> 4.54
null~> 3.1

Modules

No modules.

Resources

NameType
google_compute_address.privateresource
google_compute_address.publicresource
google_compute_instance.thisresource
google_compute_instance_group.thisresource
null_resource.dependency_getterresource
google_compute_image.vmseriesdata source
google_compute_subnetwork.thisdata source

Inputs

NameDescriptionTypeDefaultRequired
bootstrap_optionsVM-Series bootstrap options to pass using instance metadata.

Proper syntax is a map, where keys are the bootstrap parameters.
Example:
bootstrap_options = {
type = dhcp-client
panorama-server = 1.2.3.4
}

A list of available parameters: type, ip-address, default-gateway, netmask, ipv6-address, ipv6-default-gateway, hostname, panorama-server, panorama-server-2, tplname, dgname, dns-primary, dns-secondary, vm-auth-key, op-command-modes, op-cmd-dpdk-pkt-io, plugin-op-commands, dhcp-send-hostname, dhcp-send-client-id, dhcp-accept-server-hostname, dhcp-accept-server-domain, vm-series-auto-registration-pin-id, vm-series-auto-registration-pin-value, auth-key, authcodes, vmseries-bootstrap-gce-storagebucket, mgmt-interface-swap.

For more details on the options please refer to VM-Series documentation.
map(string){}no
create_instance_groupCreate an instance group, that can be used in a load balancer setup.boolfalseno
custom_imageThe full URI to GCE image resource, the output of gcloud compute images list --uri. Overrides official image specified using vmseries_image.stringnullno
deletion_protectionEnable deletion protection on the instance.boolfalseno
dependenciesn/alist(string)[]no
disk_typeBoot disk type. See provider documentation for available values.string"pd-standard"no
labelsGCP instance lables.map(any){}no
machine_typeFirewall instance machine type, which depends on the license used. See the Terraform manualstring"n2-standard-4"no
metadataOther, not VM-Series specific, metadata to set for an instance.map(string){}no
metadata_startup_scriptSee the Terraform manualstringnullno
min_cpu_platformMinimum CPU platform for the compute instance. Up to date version can be found here.string"Intel Cascade Lake"no
nameName of the VM-Series instance.stringn/ayes
named_portsThe list of named ports to create in the instance group:
named_ports = [
{
name = "http"
port = "80"
},
{
name = "app42"
port = "4242"
},
]
The name identifies the backend port to receive the traffic from the global load balancers.
Practically, tcp port 80 named "http" works even when not defined here, but it's not a documented provider's behavior.
list[]no
network_interfacesList of the network interface specifications.
Available options:
- subnetwork - (Required|string) Self-link of a subnetwork to create interface in.
- private_ip_name - (Optional|string) Name for a private address to reserve.
- private_ip - (Optional|string) Private address to reserve.
- create_public_ip - (Optional|boolean) Whether to reserve public IP for the interface. Ignored if public_ip is provided. Defaults to 'false'.
- public_ip_name - (Optional|string) Name for a public address to reserve.
- public_ip - (Optional|string) Existing public IP to use.
- public_ptr_domain_name - (Optional|string) Existing public PTR name to use.
- alias_ip_ranges - (Optional|list) List of objects that define additional IP ranges for an interface, as specified here
list(any)n/ayes
projectn/astringnullno
resource_policiesn/alist(string)[]no
scopesn/alist(string)
[
"https://www.googleapis.com/auth/compute.readonly",
"https://www.googleapis.com/auth/cloud.useraccounts.readonly",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring.write"
]
no
service_accountIAM Service Account for running firewall instance (just the email)stringnullno
ssh_keysPublic keys to allow SSH access for, separated by newlines.stringnullno
tagsGCP instance tags.list(string)[]no
vmseries_imageThe image name from which to boot an instance, including the license type and the version.
To get a list of available official images, please run the following command:
gcloud compute images list --filter="name ~ vmseries" --project paloaltonetworksgcp-public --no-standard-images
string"vmseries-flex-bundle1-1008h8"no
zoneZone to deploy instance in.stringn/ayes

Outputs

NameDescription
instancen/a
instance_groupn/a
instance_group_self_linkn/a
private_ipsn/a
public_ipsn/a
self_linkn/a