-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module/template, module/template_stack, module/zone): 2 new modu…
…les, 1 fix in module zone (#27)
- Loading branch information
1 parent
abdfdb7
commit 96fd53d
Showing
15 changed files
with
332 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.4.0, < 2.0.0 | | ||
| <a name="requirement_panos"></a> [panos](#requirement\_panos) | ~> 1.11.1 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_panos"></a> [panos](#provider\_panos) | ~> 1.11.1 | | ||
|
||
## Modules | ||
|
||
No modules. | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [panos_panorama_template.this](https://registry.terraform.io/providers/PaloAltoNetworks/panos/latest/docs/resources/panorama_template) | resource | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_mode"></a> [mode](#input\_mode) | The mode to use for the modules. Valid values are `panorama` and `ngfw`. | `string` | n/a | yes | | ||
| <a name="input_mode_map"></a> [mode\_map](#input\_mode\_map) | The mode to use for the modules. Valid values are `panorama` and `ngfw`. | <pre>object({<br> panorama = number<br> ngfw = number<br> })</pre> | <pre>{<br> "ngfw": 1,<br> "panorama": 0<br>}</pre> | no | | ||
| <a name="input_templates"></a> [templates](#input\_templates) | Map of the templates, where key is the template's name:<br>- `description` - (Optional) The template's description.<br><br>Example:<pre>{<br> "test-template" = {<br> description = "My test template"<br> }<br>}</pre> | <pre>map(object({<br> description = optional(string)<br> }))</pre> | `{}` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_panos_panorama_template"></a> [panos\_panorama\_template](#output\_panos\_panorama\_template) | n/a | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
resource "panos_panorama_template" "this" { | ||
for_each = var.mode_map[var.mode] == 0 ? var.templates : {} | ||
|
||
name = each.key | ||
description = each.value.description | ||
|
||
lifecycle { | ||
create_before_destroy = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "panos_panorama_template" { | ||
value = panos_panorama_template.this | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
variable "mode" { | ||
description = "The mode to use for the modules. Valid values are `panorama` and `ngfw`." | ||
type = string | ||
validation { | ||
condition = contains(["panorama", "ngfw"], var.mode) | ||
error_message = "The mode must be either `panorama` or `ngfw`." | ||
} | ||
} | ||
|
||
variable "mode_map" { | ||
description = "The mode to use for the modules. Valid values are `panorama` and `ngfw`." | ||
default = { | ||
panorama = 0 | ||
ngfw = 1 | ||
# cloud_manager = 2 # Not yet supported | ||
} | ||
type = object({ | ||
panorama = number | ||
ngfw = number | ||
}) | ||
} | ||
|
||
variable "templates" { | ||
description = <<-EOF | ||
Map of the templates, where key is the template's name: | ||
- `description` - (Optional) The template's description. | ||
Example: | ||
``` | ||
{ | ||
"test-template" = { | ||
description = "My test template" | ||
} | ||
} | ||
``` | ||
EOF | ||
default = {} | ||
type = map(object({ | ||
description = optional(string) | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_version = ">= 1.4.0, < 2.0.0" | ||
required_providers { | ||
panos = { | ||
source = "PaloAltoNetworks/panos" | ||
version = "~> 1.11.1" | ||
} | ||
} | ||
} |
Oops, something went wrong.