diff --git a/assets/terraform/examples/provider/provider.tf b/assets/terraform/examples/provider/provider.tf deleted file mode 100644 index 22323c93..00000000 --- a/assets/terraform/examples/provider/provider.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Username and password based authentication -provider "panos" { - hostname = "hostname" - username = "username" - password = "password" -} - -# API key based authentication -provider "panos" { - hostname = "hostname" - api_key = "api_key" -} \ No newline at end of file diff --git a/assets/terraform/examples/resources/panos_config_log_settings/import.sh b/assets/terraform/examples/resources/panos_config_log_settings/import.sh new file mode 100644 index 00000000..b6fa2bbe --- /dev/null +++ b/assets/terraform/examples/resources/panos_config_log_settings/import.sh @@ -0,0 +1,12 @@ +# A config log setting can be imported by providing the following base64 encoded object as the ID +# { +# location = { +# template = { +# name = "example-template" +# panorama_device = "localhost.localdomain" +# } +# } +# +# name = "example-config-settings" +# } +terraform import panos_config_log_settings.example $(echo '{"location":{"template":{"name":"example-template","panorama_device":"localhost.localdomain"}},"name":"example-config-settings"}' | base64) diff --git a/assets/terraform/examples/resources/panos_config_log_settings/resource.tf b/assets/terraform/examples/resources/panos_config_log_settings/resource.tf new file mode 100644 index 00000000..0732297c --- /dev/null +++ b/assets/terraform/examples/resources/panos_config_log_settings/resource.tf @@ -0,0 +1,32 @@ +resource "panos_template" "example" { + location = { panorama = {} } + name = "example-template" +} + +resource "panos_syslog_profile" "example" { + location = { + template = { + name = panos_template.example.name + } + } + + name = "example-profile-1" + servers = [{ + name = "syslog-server1" + server = "10.0.0.1" + }] +} + +resource "panos_config_log_settings" "example" { + location = { + template = { + name = panos_template.example.name + } + } + + name = "example-config-settings" + description = "config log settings example" + filter = "(dgname eq default)" + send_to_panorama = true + syslog_profiles = [panos_syslog_profile.example.name] +} diff --git a/specs/device/log-settings/config.yaml b/specs/device/log-settings/config.yaml new file mode 100644 index 00000000..7d48f975 --- /dev/null +++ b/specs/device/log-settings/config.yaml @@ -0,0 +1,295 @@ +name: config-log-settings +terraform_provider_config: + description: Config Log Settings + skip_resource: false + skip_datasource: false + resource_type: entry + resource_variants: + - singular + suffix: config_log_settings + plural_suffix: '' + plural_name: '' + plural_description: '' +go_sdk_config: + skip: false + package: + - device + - logsettings + - config +panos_xpath: + path: + - log-settings + - config + - match-list + vars: [] +locations: +- name: panorama + xpath: + path: + - config + - panorama + vars: [] + description: Located in a panorama. + validators: [] + required: false + read_only: false +- name: template + xpath: + path: + - config + - devices + - $panorama_device + - template + - $template + - config + - shared + vars: + - name: panorama_device + description: Specific Panorama device + required: false + default: localhost.localdomain + validators: [] + type: entry + - name: template + description: Specific Panorama template + required: true + validators: [] + type: entry + description: A shared resource located within a specific template + devices: + - panorama + validators: [] + required: false + read_only: false +- name: template-vsys + xpath: + path: + - config + - devices + - $panorama_device + - template + - $template + - config + - devices + - $ngfw_device + - vsys + - $vsys + vars: + - name: panorama_device + description: Specific Panorama device + required: false + default: localhost.localdomain + validators: [] + type: entry + - name: template + description: Specific Panorama template + required: true + validators: [] + type: entry + - name: ngfw_device + description: The NGFW device + required: false + default: localhost.localdomain + validators: [] + type: entry + - name: vsys + description: The vsys. + required: false + default: vsys1 + validators: + - type: not-values + spec: + values: + - value: shared + error: The vsys cannot be "shared". + type: entry + description: Located in a specific template, device and vsys. + devices: + - panorama + - ngfw + validators: [] + required: false + read_only: false +- name: template-stack + xpath: + path: + - config + - devices + - $panorama_device + - template-stack + - $template_stack + - config + - shared + vars: + - name: panorama_device + description: Specific Panorama device + required: false + default: localhost.localdomain + validators: [] + type: entry + - name: template_stack + description: The template stack + required: true + validators: [] + type: entry + description: Located in a specific template + devices: + - panorama + validators: [] + required: false + read_only: false +- name: template-stack-vsys + xpath: + path: + - config + - devices + - $panorama_device + - template-stack + - $template_stack + - config + - devices + - $ngfw_device + - vsys + - $vsys + vars: + - name: panorama_device + description: Specific Panorama device + required: false + default: localhost.localdomain + validators: [] + type: entry + - name: template_stack + description: The template stack + required: true + validators: [] + type: entry + - name: ngfw_device + description: The NGFW device + required: false + default: localhost.localdomain + validators: [] + type: entry + - name: vsys + description: The vsys. + required: false + default: vsys1 + validators: + - type: not-values + spec: + values: + - value: shared + error: The vsys cannot be "shared". + type: entry + description: Located in a specific template, device and vsys. + devices: + - panorama + - ngfw + validators: [] + required: false + read_only: false +entries: +- name: name + description: '' + validators: [] +imports: [] +spec: + params: + - name: description + type: string + profiles: + - xpath: + - description + validators: + - type: length + spec: + min: 0 + max: 1023 + spec: {} + description: '' + required: false + - name: filter + type: string + profiles: + - xpath: + - filter + validators: + - type: length + spec: + max: 1023 + spec: {} + description: '' + required: false + - name: send-email + type: list + profiles: + - xpath: + - send-email + type: member + validators: [] + spec: + type: string + items: + type: string + description: '' + required: false + codegen_overrides: + terraform: + name: email-profiles + - name: send-http + type: list + profiles: + - xpath: + - send-http + type: member + validators: [] + spec: + type: string + items: + type: string + description: '' + required: false + codegen_overrides: + terraform: + name: http-profiles + - name: send-snmptrap + type: list + profiles: + - xpath: + - send-snmptrap + type: member + validators: [] + spec: + type: string + items: + type: string + description: '' + required: false + codegen_overrides: + terraform: + name: snmp-profiles + - name: send-syslog + type: list + profiles: + - xpath: + - send-syslog + type: member + validators: [] + spec: + type: string + items: + type: string + description: '' + required: false + codegen_overrides: + terraform: + name: syslog-profiles + - name: send-to-panorama + type: bool + profiles: + - xpath: + - send-to-panorama + validators: [] + spec: {} + description: '' + required: false + variants: []