Skip to content

Commit

Permalink
initial MVP- Palo Alto Firewall Module
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdhulipala committed Apr 26, 2024
1 parent 2f5faa9 commit 023c45f
Show file tree
Hide file tree
Showing 50 changed files with 2,137 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Network Edge Palo Alto Firewall Cluster Example

This example demonstrates creation of Network Edge Palo Alto Firewall Cluster. It will:

- Create a ACL template
- Create a management ACL template
- Create an SSH key
- Provision Palo Alto Firewall Cluster

## Usage

To provision this example, you should clone the github repository and run terraform from within this directory:

```bash
git clone https://github.com/equinix/terraform-equinix-network-edge.git
cd terraform-equinix-network-edge/examples/pa-vm-firewall-cluster
terraform init
terraform apply
```

Note that this example may create resources which cost money. Run 'terraform destroy' when you don't need these
resources.

<!-- TEMPLATE: The following block has been generated by terraform-docs util: https://github.com/terraform-docs/terraform-docs -->
<!-- BEGIN_TF_DOCS -->

## Requirements

| Name | Version |
|---------------------------------------------------------------------------|-----------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.4 |
| <a name="requirement_equinix"></a> [equinix](#requirement\_equinix) | ~> 1.34.0 |

## Providers

| Name | Version |
|---------------------------------------------------------------|-----------|
| <a name="provider_equinix"></a> [equinix](#provider\_equinix) | ~> 1.34.0 |

## Resources

| Name | Type |
|------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| [equinix_network_acl_template.pa-vm-pri](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_acl_template) | resource |
| [equinix_network_ssh_key.johndoe](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_ssh_key) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|-------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|:--------:|
| <a name="input_equinix_client_id"></a> [equinix\_client\_id](#input\_equinix\_client\_id) | API Consumer Key available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX\_API\_CLIENTID shell environment variable. | `string` | n/a | yes |
| <a name="input_equinix_client_secret"></a> [equinix\_client\_secret](#input\_equinix\_client\_secret) | API Consumer secret available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX\_API\_CLIENTSECRET shell environment variable. | `string` | n/a | yes |
| <a name="input_metro_code_primary"></a> [metro\_code\_primary](#input\_metro\_code\_primary) | Device location metro code | `string` | n/a | yes |
| <a name="input_ssh_rsa_public_key"></a> [ssh\_rsa\_public\_key](#input\_ssh\_rsa\_public\_key) | SSH RSA public key | `string` | n/a | yes |

## Outputs

| Name | Description |
|----------------------------------------------------------------------------------|------------------------|
| <a name="output_device_details"></a> [device\_details](#output\_device\_details) | Virtual device details |

<!-- END_TF_DOCS -->
62 changes: 62 additions & 0 deletions examples/Palo-Alto-Network-Firewall/pa-vm-firewall-cluster/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

module "pa-vm-cluster" {
source = "../../../modules/Palo-Alto-Network-Firewall"
# version = "1.0.0"
name = "tf-pa-vm-cluster"
metro_code = var.metro_code_primary
platform = "medium"
account_number = "664566"
software_package = "VM300"
project_id = "e6be59d9-62c0-4140-aad6-150f0700203c"
term_length = 1
notifications = ["[email protected]"]
hostname = "pavm-pri"
additional_bandwidth = 100
connectivity = "INTERNET-ACCESS"
acl_template_id = equinix_network_acl_template.pa-vm-cluster-wan-acl.id
mgmt_acl_template_uuid = equinix_network_acl_template.pa-vm-cluster-mgmt-acl.id
ssh_key = {
userName = "johndoe-primary"
keyName = equinix_network_ssh_key.johndoe-pri.name
}
cluster = {
enabled = true
name = "test-pa-vm-cluster"
node0_vendor_configuration_hostname = "node0"
node1_vendor_configuration_hostname = "node1"
}
license_token = "I3372903"
}

resource "equinix_network_ssh_key" "johndoe-pri" {
name = "johndoe-pri-0414-6"
public_key = var.ssh_rsa_public_key
project_id = "e6be59d9-62c0-4140-aad6-150f0700203c"
}

resource "equinix_network_acl_template" "pa-vm-cluster-mgmt-acl" {
name = "tf-pa-vm-cluster-mgmt"
description = "Primary Palo Alto Networks VM ACL template"
project_id = "e6be59d9-62c0-4140-aad6-150f0700203c"
inbound_rule {
subnet = "12.16.103.0/24"
protocol = "TCP"
src_port = "any"
dst_port = "22"
}
}

resource "equinix_network_acl_template" "pa-vm-cluster-wan-acl" {
name = "tf-pa-vm-cluster-wan"
description = "Secondary Palo Alto Networks VM ACL template"
inbound_rule {
subnet = "172.16.25.0/24"
protocol = "TCP"
src_port = "any"
dst_port = "22"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "device_details" {
description = "Virtual device details"
value = module.pa-vm-cluster
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
variable "equinix_client_id" {
type = string
description = "API Consumer Key available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX_API_CLIENTID shell environment variable."
}

variable "equinix_client_secret" {
type = string
description = "API Consumer secret available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX_API_CLIENTSECRET shell environment variable."
}

variable "metro_code_primary" {
description = "Device location metro code"
type = string
}

variable "ssh_rsa_public_key" {
description = "SSH RSA public key"
type = string
}

variable "license_token" {
description = "License Token"
type = string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 0.13"
required_providers {
equinix = {
source = "equinix/equinix"
version = "~> 1.34.0"
}
}
}
Loading

0 comments on commit 023c45f

Please sign in to comment.