### Install Netskope Terraform Provider Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/README.md Add this configuration to your Terraform setup and run 'terraform init' to install the provider. ```hcl terraform { required_providers { ns = { source = "netskope/ns" version = "0.3.131" } } } provider "ns" { # Configuration options } ``` ```hcl terraform { required_providers { ns = { source = "netskope/ns" version = "0.3.1" } } } provider "ns" { # Configuration options } ``` -------------------------------- ### ns_npa_rules_list Data Source Example Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_rules_list.md Example usage of the ns_npa_rules_list data source in Terraform. This demonstrates how to fetch NPA rules with filtering, limiting, and sorting. ```APIDOC ## ns_npa_rules_list Data Source ### Description This data source retrieves a list of Network Policy Agent (NPA) rules. It allows for filtering, pagination, and sorting of the results. ### Parameters #### Optional Parameters - **filter** (String) - Optional - A query string used to filter the NPA rules. This parameter supports various query operators for precise filtering. - **limit** (Number) - Optional - The maximum number of policies to retrieve. If not specified, all policies will be retrieved. Defaults to retrieving all policies. - **offset** (Number) - Optional - The offset of the first policy in the list to retrieve. This is used for pagination. - **sortby** (String) - Optional - Specifies the field by which to sort the retrieved policies. Defaults to sorting by policy ID. - **sortorder** (String) - Optional - Determines the order of sorting, either ascending ('asc') or descending ('desc'). Defaults to ascending order. ### Response #### Read-Only Attributes - **data** (Attributes List) - A list of NPA rule objects, each containing detailed information about a rule. (See nested schema below for details). ### Nested Schema for `data` Read-Only: - **enabled** (String) - Indicates if the rule is enabled. - **group_id** (String) - The ID of the group the rule belongs to. - **modify_by** (String) - The user or system that last modified the rule. - **modify_time** (String) - The timestamp when the rule was last modified. - **modify_type** (String) - The type of modification performed on the rule. - **policy_type** (String) - The type of policy the rule is associated with. - **rule_data** (Attributes) - Contains the detailed configuration data for the rule. (See nested schema below for details). - **rule_id** (String) - The unique identifier for the rule. - **rule_name** (String) - The name of the rule. ### Nested Schema for `data.rule_data` Read-Only: - **access_method** (List of String) - The access methods allowed by this rule. - **b_negate_net_location** (Boolean) - Flag to negate network location criteria. - **b_negate_src_countries** (Boolean) - Flag to negate source country criteria. - **classification** (String) - The classification type for the rule. - **device_classification_id** (List of Number) - IDs for device classifications. - **dlp_actions** (Attributes List) - A list of DLP actions configured for the rule. (See nested schema below for details). - **external_dlp** (Boolean) - Indicates if external DLP is enabled for this rule. - **json_version** (Number) - The version of the JSON schema used for the rule data. - **match_criteria_action** (Attributes) - Defines the action to take when match criteria are met. (See nested schema below for details). - **net_location_obj** (List of String) - Network location objects associated with the rule. - **organization_units** (List of String) - Organization units associated with the rule. - **policy_type** (String) - The type of policy. - **private_app_tag_ids** (List of String) - IDs of private application tags. - **private_app_tags** (List of String) - Private application tags. - **private_apps** (List of String) - List of private applications. - **private_apps_with_activities** (Attributes List) - Private applications with associated activities. (See nested schema below for details). - **show_dlp_profile_action_table** (Boolean) - Flag to show the DLP profile action table. - **src_countries** (List of String) - Source countries specified in the rule. - **tss_actions** (Attributes List) - A list of TSS actions configured for the rule. (See nested schema below for details). - **tss_profile** (List of String) - TSS profiles associated with the rule. - **user_groups** (List of String) - User groups associated with the rule. - **user_type** (String) - The type of user the rule applies to. - **users** (List of String) - Specific users the rule applies to. - **version** (Number) - The version of the rule. ### Nested Schema for `data.rule_data.dlp_actions` Read-Only: - **actions** (List of String) - The specific DLP actions to perform. - **dlp_profile** (String) - The name of the DLP profile to use. ### Nested Schema for `data.rule_data.match_criteria_action` Read-Only: - **action_name** (String) - The name of the match criteria action. ### Nested Schema for `data.rule_data.private_apps_with_activities` Read-Only: - **activities** (Attributes List) - A list of activities associated with the private application. (See nested schema below for details). - **app_id** (List of String) - The ID(s) of the private application. - **app_name** (String) - The name of the private application. ### Nested Schema for `data.rule_data.private_apps_with_activities.activities` Read-Only: - **activity** (String) - The name of the activity. - **list_of_constraints** (List of String) - Constraints associated with the activity. ### Nested Schema for `data.rule_data.tss_actions` Read-Only: - **actions** (Attributes List) - A list of TSS actions. (See nested schema below for details). - **tss_profile** (List of String) - The name of the TSS profile. ### Nested Schema for `data.rule_data.tss_actions.actions` Read-Only: - **action_name** (String) - The name of the TSS action. - **remediation_profile** (String) - The remediation profile associated with the action. - **severity** (String) - The severity level of the action. - **template** (String) - The template used for the action. ### Example Usage ```terraform data "ns_npa_rules_list" "my_nparuleslist" { filter = "...my_filter..." limit = 0 offset = 5 sortby = "...my_sortby..." sortorder = "...my_sortorder..." } ``` ``` -------------------------------- ### ns_npa_publishers_alerts_configuration Data Source Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_publishers_alerts_configuration.md Example usage for the ns_npa_publishers_alerts_configuration data source. ```APIDOC ## ns_npa_publishers_alerts_configuration (Data Source) ### Description The NPA Publisher is a software package that enables private application connectivity between your data center and the Netskope cloud. It is a crucial component of Netskope’s Private Access (NPA) solution, which provides zero-trust network access (ZTNA) to private applications and data in hybrid IT environments. This resource supports the ability to retrieve publisher alert configurations. ### Example Usage ```terraform data "ns_npa_publishers_alerts_configuration" "my_npapublishersalertsconfiguration" { } ``` ### Schema #### Read-Only - `admin_users` (List of String) - `event_types` (List of String) - `selected_users` (String) ``` -------------------------------- ### Example Usage of ns_npa_publisher_apps_list Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_publisher_apps_list.md Use this data source to fetch the list of applications linked to a given NPA Publisher ID. Ensure the publisher_id is correctly specified. ```terraform data "ns_npa_publisher_apps_list" "my_npapublisherappslist" { publisher_id = 1 } ``` -------------------------------- ### Example Usage of ns_npa_private_app Data Source Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_private_app.md Use this data source to retrieve information about a private application by its ID. Ensure the `private_app_id` is correctly specified. ```terraform data "ns_npa_private_app" "my_npaprivateapp" { private_app_id = 0 } ``` -------------------------------- ### ns_npa_private_app Data Source Usage Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_private_app.md Example of how to use the ns_npa_private_app data source to retrieve information about a private application. ```APIDOC ## ns_npa_private_app (Data Source) NPAPrivateApp DataSource ### Description This data source is used to retrieve information about a private application configured within the Netskope Private App service. ### Parameters #### Required - `private_app_id` (Number) - Required - The unique identifier for the private application. ### Read-Only Attributes - `allow_unauthenticated_cors` (Boolean) - Indicates if unauthenticated CORS requests are allowed. - `allow_uri_bypass` (Boolean) - Indicates if URI bypass is allowed. - `app_option` (Attributes) - Configuration options for the application. - `bypass_uris` (List of String) - List of URIs that are bypassed. - `clientless_access` (Boolean) - Indicates if clientless access is enabled. - `is_user_portal_app` (Boolean) - Indicates if the app is a user portal app. - `modified_by` (String) - The user who last modified the private app. - `modify_time` (String) - The timestamp when the private app was last modified. - `policies` (List of String) - List of associated policy identifiers. - `private_app_hostname` (String) - The hostname of the private application. - `private_app_name` (String) - The name of the private application. - `private_app_protocol` (String) - The protocol used by the private application. - `protocols` (Attributes List) - List of protocols configured for the private app. - `public_host` (String) - The public-facing hostname for the private app. - `reachability` (Attributes) - Information about the reachability of the private app. - `real_host` (String) - The actual host of the private application. - `service_publisher_assignments` (Attributes List) - Assignments of service publishers to the private app. - `steering_configs` (List of String) - List of steering configurations. - `supplement_dns_for_osx` (Boolean) - Indicates if DNS should be supplemented for macOS. - `tags` (Attributes List) - List of tags associated with the private app. - `trust_self_signed_certs` (Boolean) - Indicates if self-signed certificates should be trusted. - `uribypass_header_value` (String) - The header value for URI bypass. - `use_publisher_dns` (Boolean) - Indicates if publisher DNS should be used. ### Nested Schemas #### `app_option` (Schema details not provided in source) #### `protocols` - `created_at` (String) - Timestamp when the protocol entry was created. - `id` (Number) - The unique identifier for the protocol entry. - `port` (String) - The port number for the protocol. - `protocol` (String) - The protocol name (e.g., TCP, UDP). - `service_id` (Number) - The identifier of the associated service. - `updated_at` (String) - Timestamp when the protocol entry was last updated. #### `reachability` - `error_code` (Number) - The error code if reachability check failed. - `error_string` (String) - A description of the error if reachability check failed. - `reachable` (Boolean) - Indicates whether the private app is reachable. #### `service_publisher_assignments` - `primary` (String) - Indicates if this is the primary publisher assignment. - `publisher_id` (Number) - The unique identifier for the publisher. - `publisher_name` (String) - The name of the publisher. - `reachability` (Attributes) - Reachability details for this specific publisher assignment. - `service_id` (Number) - The identifier of the associated service. ##### `service_publisher_assignments.reachability` - `error_code` (Number) - The error code if reachability check failed. - `error_string` (String) - A description of the error if reachability check failed. - `reachable` (Boolean) - Indicates whether the private app is reachable via this publisher. #### `tags` - `tag_id` (String) - The unique identifier for the tag. - `tag_name` (String) - The name of the tag. ### Example Usage ```terraform data "ns_npa_private_app" "my_npaprivateapp" { private_app_id = 0 } ``` ``` -------------------------------- ### Example Usage of ns_npa_policy_groups Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_policy_groups.md Use this data source to query NPA policy groups by their ID. Ensure the `group_id` is correctly specified. ```terraform data "ns_npa_policy_groups" "my_npapolicygroups" { group_id = "...my_group_id..." } ``` -------------------------------- ### Example Usage of NPA Publishers List Data Source Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_publishers_list.md This snippet demonstrates how to use the ns_npa_publishers_list data source to retrieve a list of all Publisher objects. No specific configuration is required for this data source. ```terraform data "ns_npa_publishers_list" "my_npapublisherslist" { } ``` -------------------------------- ### Run Terraform Provider with Debugging Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/USAGE.md Execute the Terraform provider in debug mode. This is useful for troubleshooting. After running, copy the TF_REATTACH_PROVIDERS environment variable to your example directory and initialize Terraform. ```sh go run main.go --debug # Copy the TF_REATTACH_PROVIDERS env var # In a new terminal cd examples/your-example TF_REATTACH_PROVIDERS=... terraform init TF_REATTACH_PROVIDERS=... terraform apply ``` -------------------------------- ### Example Usage of ns_npa_rules_list Data Source Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_rules_list.md Demonstrates how to use the ns_npa_rules_list data source to retrieve NPA rules. You can specify filter, limit, offset, sortby, and sortorder to customize the results. ```terraform data "ns_npa_rules_list" "my_nparuleslist" { filter = "...my_filter..." limit = 0 offset = 5 sortby = "...my_sortby..." sortorder = "...my_sortorder..." } ``` -------------------------------- ### Example Usage of ns_npa_private_policy_in_use Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_private_policy_in_use.md Use this data source to query for NPA private policies currently in use. Provide a list of policy IDs to filter the results. ```terraform data "ns_npa_private_policy_in_use" "my_npaprivatepolicyinuse" { ids = [ "..." ] } ``` -------------------------------- ### ns_npa_rules Data Source Example Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_rules.md Example usage of the ns_npa_rules data source to retrieve NPA rules. Specify the rule ID and optionally fields to filter the returned values. ```terraform data "ns_npa_rules" "my_nparules" { fields = "...my_fields..." rule_id = "...my_rule_id..." } ``` -------------------------------- ### Configure NPA Publisher Alerts Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_publishers_alerts_configuration.md Use this resource to define alert configurations for NPA Publishers. Specify the email addresses of admin users to notify and the event types that should trigger alerts. This helps in monitoring the health and status of your NPA Publisher setup. ```terraform resource "ns_npa_publishers_alerts_configuration" "my_npapublishersalertsconfiguration" { admin_users = [ "admin1@abc.com" ] event_types = [ "UPGRADE_SUCCEEDED" ] selected_users = "abc@xyz.com,def@xyz.com" } ``` -------------------------------- ### Example Usage of ns_npa_policy_groups_list Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_policy_groups_list.md Use the ns_npa_policy_groups_list data source to retrieve NPA policy groups. You can specify fields, filters, limits, offsets, and sorting order. ```terraform data "ns_npa_policy_groups_list" "my_npapolicygroupslist" { fields = "...my_fields..." filter = "...my_filter..." limit = 7 offset = 6 sortby = "...my_sortby..." sortorder = "...my_sortorder..." } ``` -------------------------------- ### ns_npa_private_apps_list Data Source Usage Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_private_apps_list.md Example of how to use the ns_npa_private_apps_list data source in Terraform to fetch private application details. ```APIDOC ## ns_npa_private_apps_list (Data Source) ### Description Retrieves a list of private applications configured within the Netskope Private Access (NPA) service. ### Parameters #### Query Parameters - **limit** (Number) - Optional - Limits the number of results returned. - **offset** (Number) - Optional - Specifies the starting point for the results. - **query** (String) - Optional - Filters the results based on a query string. ### Response #### Success Response (200) - **private_apps** (Attributes List) - A list of private applications. Each attribute contains: - **allow_unauthenticated_cors** (Boolean) - **allow_uri_bypass** (Boolean) - **app_option** (Attributes) - **bypass_uris** (List of String) - **clientless_access** (Boolean) - **is_user_portal_app** (Boolean) - **modified_by** (String) - **modify_time** (String) - **policies** (List of String) - **private_app_hostname** (String) - **private_app_id** (Number) - **private_app_name** (String) - **private_app_protocol** (String) - **protocols** (Attributes List) - **public_host** (String) - **reachability** (Attributes) - **real_host** (String) - **service_publisher_assignments** (Attributes List) - **steering_configs** (List of String) - **supplement_dns_for_osx** (Boolean) - **tags** (Attributes List) - **trust_self_signed_certs** (Boolean) - **uribypass_header_value** (String) - **use_publisher_dns** (Boolean) #### Nested Schema for `private_apps.protocols`: - **created_at** (String) - **id** (Number) - **port** (String) - **protocol** (String) - **service_id** (Number) - **updated_at** (String) #### Nested Schema for `private_apps.reachability`: - **error_code** (Number) - **error_string** (String) - **reachable** (Boolean) #### Nested Schema for `private_apps.service_publisher_assignments`: - **primary** (String) - **publisher_id** (Number) - **publisher_name** (String) - **reachability** (Attributes) - **service_id** (Number) #### Nested Schema for `private_apps.service_publisher_assignments.reachability`: - **error_code** (Number) - **error_string** (String) - **reachable** (Boolean) #### Nested Schema for `private_apps.tags`: - **tag_id** (String) - **tag_name** (String) ### Example Usage ```terraform data "ns_npa_private_apps_list" "my_npaprivateappslist" { limit = 1 offset = 2 query = "...my_query..." } ``` ``` -------------------------------- ### ns_npa_policy_groups Data Source Usage Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_policy_groups.md Example of how to use the ns_npa_policy_groups data source to fetch NPA policy group details by providing the group ID. ```APIDOC ## ns_npa_policy_groups (Data Source) NPAPolicyGroups DataSource ### Description Retrieves information about a specific NPA policy group. ### Parameters #### Query Parameters - **group_id** (String) - Required - The ID of the NPA policy group to retrieve. ### Response #### Success Response (200) - **group_id** (String) - The ID of the NPA policy group. - **group_name** (String) - The name of the NPA policy group. - **group_type** (String) - The type of the NPA policy group. - **group_pinned_id** (String) - The pinned ID of the NPA policy group. - **can_be_edited_deleted** (String) - Indicates if the group can be edited or deleted. - **modify_time** (String) - The last modification time of the group. - **modify_type** (String) - The type of the last modification. - **status** (String) - The status of the NPA policy group. ### Request Example ```terraform data "ns_npa_policy_groups" "my_npapolicygroups" { group_id = "...my_group_id..." } ``` ### Response Example ```json { "group_id": "example_group_id", "group_name": "example_group_name", "group_type": "example_group_type", "group_pinned_id": "example_pinned_id", "can_be_edited_deleted": "true", "modify_time": "2023-10-27T10:00:00Z", "modify_type": "update", "status": "active" } ``` ``` -------------------------------- ### Create an NPA Publisher Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_publisher.md This snippet shows how to create a new NPA Publisher resource. Configure `publisher_name`, `lbrokerconnect`, and `publisher_upgrade_profiles_id` as needed. ```terraform resource "ns_npa_publisher" "my_npapublisher" { lbrokerconnect = false publisher_name = "npa_publisher_1" publisher_upgrade_profiles_id = 1 } ``` -------------------------------- ### ns_npa_rules Data Source Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_rules.md Example usage of the ns_npa_rules data source to fetch NPA rule information. It allows filtering by `fields` and specifying the `rule_id`. ```APIDOC ## ns_npa_rules (Data Source) ### Description NPARules DataSource allows you to retrieve information about Network Policy Access (NPA) rules. You can specify a `rule_id` to get details for a particular rule and optionally filter the returned fields using the `fields` argument. ### Parameters #### Required - `rule_id` (String) - The unique identifier of the NPA rule. #### Optional - `fields` (String) - A comma-separated string of fields to return. If not specified, all fields are returned. ### Read-Only Attributes - `enabled` (String) - Indicates if the rule is enabled. - `group_id` (String) - The ID of the group the rule belongs to. - `modify_by` (String) - The user who last modified the rule. - `modify_time` (String) - The timestamp when the rule was last modified. - `modify_type` (String) - The type of modification performed. - `policy_type` (String) - The type of policy the rule is associated with. - `rule_data` (Attributes) - Contains detailed data about the rule, including classification, criteria, and actions. (See [Nested Schema](#nestedatt--rule_data) below for details). - `rule_name` (String) - The name of the rule. - `status` (String) - The current status of the rule. ### Nested Schema for `rule_data` #### Read-Only Attributes within `rule_data` - `access_method` (List of String) - The access methods allowed by the rule. - `b_negate_net_location` (Boolean) - Flag to negate network location criteria. - `b_negate_src_countries` (Boolean) - Flag to negate source country criteria. - `classification` (String) - The classification of the rule. - `device_classification_id` (List of Number) - IDs for device classification. - `dlp_actions` (Attributes List) - A list of DLP actions configured for the rule. (See [Nested Schema](#nestedatt--rule_data--dlp_actions) below). - `external_dlp` (Boolean) - Indicates if external DLP is enabled. - `json_version` (Number) - The version of the JSON schema. - `match_criteria_action` (Attributes) - Defines the action to take when match criteria are met. (See [Nested Schema](#nestedatt--rule_data--match_criteria_action) below). - `net_location_obj` (List of String) - Network location objects associated with the rule. - `organization_units` (List of String) - Organization units associated with the rule. - `policy_type` (String) - The type of policy. - `private_app_tag_ids` (List of String) - IDs of private app tags. - `private_app_tags` (List of String) - Names of private app tags. - `private_apps` (List of String) - List of private applications. - `private_apps_with_activities` (Attributes List) - Private applications with associated activities. (See [Nested Schema](#nestedatt--rule_data--private_apps_with_activities) below). - `show_dlp_profile_action_table` (Boolean) - Whether to show the DLP profile action table. - `src_countries` (List of String) - Source countries specified in the rule. - `tss_actions` (Attributes List) - A list of Threat Security Service (TSS) actions. (See [Nested Schema](#nestedatt--rule_data--tss_actions) below). - `tss_profile` (List of String) - TSS profiles associated with the rule. - `user_groups` (List of String) - User groups associated with the rule. - `user_type` (String) - The type of user. - `users` (List of String) - Specific users associated with the rule. - `version` (Number) - The version of the rule. ### Nested Schema for `rule_data.dlp_actions` #### Read-Only Attributes within `rule_data.dlp_actions` - `actions` (List of String) - The specific DLP actions to perform. - `dlp_profile` (String) - The name of the DLP profile to use. ### Nested Schema for `rule_data.match_criteria_action` #### Read-Only Attributes within `rule_data.match_criteria_action` - `action_name` (String) - The name of the action to be taken. ### Nested Schema for `rule_data.private_apps_with_activities` #### Read-Only Attributes within `rule_data.private_apps_with_activities` - `activities` (Attributes List) - A list of activities associated with the private app. (See [Nested Schema](#nestedatt--rule_data--private_apps_with_activities--activities) below). - `app_id` (List of String) - The IDs of the private applications. - `app_name` (String) - The name of the private application. ### Nested Schema for `rule_data.private_apps_with_activities.activities` #### Read-Only Attributes within `rule_data.private_apps_with_activities.activities` - `activity` (String) - The name of the activity. - `list_of_constraints` (List of String) - Constraints associated with the activity. ### Nested Schema for `rule_data.tss_actions` #### Read-Only Attributes within `rule_data.tss_actions` - `actions` (Attributes List) - A list of TSS actions. (See [Nested Schema](#nestedatt--rule_data--tss_actions--actions) below). - `tss_profile` (List of String) - The TSS profiles to apply. ### Nested Schema for `rule_data.tss_actions.actions` #### Read-Only Attributes within `rule_data.tss_actions.actions` - `action_name` (String) - The name of the TSS action. - `remediation_profile` (String) - The remediation profile to use. - `severity` (String) - The severity level of the action. - `template` (String) - The template associated with the action. ### Example Usage ```terraform data "ns_npa_rules" "my_nparules" { fields = "...my_fields..." rule_id = "...my_rule_id..." } ``` ``` -------------------------------- ### Import an NPA Publisher Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_publisher.md This snippet demonstrates how to import an existing NPA Publisher resource into your Terraform state. Replace `1` with the actual publisher ID. ```shell terraform import ns_npa_publisher.my_ns_npa_publisher 1 ``` -------------------------------- ### Get NPA Private Apps List Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_private_apps_list.md Use this data source to retrieve a list of private applications. You can filter the results using limit, offset, and query parameters. ```terraform data "ns_npa_private_apps_list" "my_npaprivateappslist" { limit = 1 offset = 2 query = "...my_query..." } ``` -------------------------------- ### Create NPA Publisher Upgrade Profile Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_publisher_upgrade_profile.md Use this resource to create a new NPA Publisher upgrade profile. Configure the Docker tag, enable status, update frequency, name, release type, and timezone. ```terraform resource "ns_npa_publisher_upgrade_profile" "my_npapublisherupgradeprofile" { docker_tag = 8690 enabled = true frequency = "0 0 1 * TUE" name = "My Upgrade Profile" release_type = "Latest" timezone = "US/Eastern" } ``` -------------------------------- ### Create ns_npa_private_app Resource Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_private_app.md This resource allows you to configure a private application for NPA. Ensure all required fields like app_name, private_app_hostname, and real_host are provided. ```terraform resource "ns_npa_private_app" "my_npaprivateapp" { allow_unauthenticated_cors = false allow_uri_bypass = false app_name = "...my_app_name..." app_option = { # ... } bypass_uris = [ "..." ] clientless_access = false is_user_portal_app = true private_app_hostname = "...my_private_app_hostname..." protocols = [ { port = "...my_port..." protocol = "udp" } ] publishers = [ { publisher_id = "...my_publisher_id..." publisher_name = "...my_publisher_name..." } ] real_host = "...my_real_host..." tags = [ { tag_name = "...my_tag_name..." } ] trust_self_signed_certs = false uribypass_header_value = "...my_uribypass_header_value..." use_publisher_dns = true } ``` -------------------------------- ### Create NPA Publisher Token Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_publisher_token.md Use this resource to create a registration token for an NPA Publisher. The `publisher_id` is required. ```terraform resource "ns_npa_publisher_token" "my_npapublishertoken" { publisher_id = 1 } ``` -------------------------------- ### Import ns_npa_private_app Resource Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_private_app.md This command demonstrates how to import an existing ns_npa_private_app resource into your Terraform state. Replace '0' with the actual ID of the private app. ```shell terraform import ns_npa_private_app.my_ns_npa_private_app 0 ``` -------------------------------- ### Retrieve NPA Publisher Release List Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_publishers_releases_list.md Use this data source to fetch a list of available NPA publisher releases. No configuration is required. ```terraform data "ns_npa_publishers_releases_list" "my_npapublishersreleaseslist" { } ``` -------------------------------- ### Configure Local Provider Overrides in .terraformrc Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/README.md Set up the '.terraformrc' file with a 'dev_overrides' section to use local provider builds. Ensure the path to your compiled provider binary is correctly specified. ```hcl provider_installation { dev_overrides { "registry.terraform.io/netskope/ns" = "" } # For all other providers, install them directly from their origin provider # registries as normal. If you omit this, Terraform will _only_ use # the dev_overrides block, and so no other providers will be available. direct {} } ``` -------------------------------- ### ns_npa_publishers_bulk_upgrade_request Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_publishers_bulk_upgrade_request.md This resource supports the triggering of upgrades on publishers. ```APIDOC ## ns_npa_publishers_bulk_upgrade_request (Resource) ### Description This resource supports the triggering of upgrades on publishers. ### Schema #### Optional - `publishers` (Attributes) - Requires replacement if changed. - `publisher_id` (List of String) - Required. Requires replacement if changed. - `apply` (Attributes) - Optional. Requires replacement if changed. - `upgrade_request` (Boolean) - Required. Requires replacement if changed. #### Read-Only - `data` (Attributes) - `publishers` (Attributes List) - `apps_count` (Number) - `assessment` (Attributes) - `ca_certs_status` (Attributes) - `hashes` (List of String) - `last_modified` (Number) - `eee_support` (Boolean) - `hdd_free` (String) - `hdd_total` (String) - `ip_address` (String) - `latency` (Number) - `version` (String) - `common_name` (String) - `connected_apps` (List of String) - `lbrokerconnect` (Boolean) - `publisher_id` (Number) - `publisher_name` (String) - `publisher_upgrade_profiles_id` (Number) - `registered` (Boolean) - `status` (String) - Must be one of ["connected", "not registered"] - `stitcher_id` (Number) - `stitcher_pop` (String) - `upgrade_failed_reason` (Attributes) - `detail` (String) - `error_code` (Number) - `timestamp` (Number) - `version` (String) - `upgrade_request` (Boolean) - `upgrade_status` (Attributes) - `upstat` (String) - `capabilities` (Attributes) - `auto_upgrade` (Boolean) - `dtls` (Boolean) - `eee` (Boolean) - `nwa_ba` (Boolean) - `pull_nsconfig` (Attributes) - `orgkey_exist` (Boolean) - `orguri_exist` (Boolean) ### Example Usage ```terraform resource "ns_npa_publishers_bulk_upgrade_request" "my_npapublishersbulkupgraderequest" { publishers = { apply = { upgrade_request = true } publisher_id = [ "1" ] } } ``` ``` -------------------------------- ### Create NPA Publishers Bulk Upgrade Request Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_publishers_bulk_upgrade_request.md This resource is used to trigger upgrades on NPA publishers. It requires specifying the publisher IDs and setting the `upgrade_request` flag to true within the `apply` block. ```terraform resource "ns_npa_publishers_bulk_upgrade_request" "my_npapublishersbulkupgraderequest" { publishers = { apply = { upgrade_request = true } publisher_id = [ "1" ] } } ``` -------------------------------- ### Import NPA Rules using Terraform Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_rules.md Use this Terraform import command to manage existing NPA rules within your infrastructure. Ensure the resource name `my_ns_npa_rules` matches your Terraform configuration. ```shell terraform import ns_npa_rules.my_ns_npa_rules "" ``` -------------------------------- ### ns_npa_publisher_apps_list Data Source Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_publisher_apps_list.md Use the ns_npa_publisher_apps_list data source to fetch a list of applications linked to a publisher. You need to provide the publisher_id to identify the publisher. ```APIDOC ## ns_npa_publisher_apps_list Data Source ### Description This data source retrieves a list of applications associated with a specific NPA publisher. ### Usage ```terraform data "ns_npa_publisher_apps_list" "my_npapublisherappslist" { publisher_id = 1 } ``` ### Parameters #### Required - `publisher_id` (Number) - The ID of the publisher for which to list applications. ### Read-Only Attributes - `data` (Attributes List) - A list of applications associated with the publisher. Each item in the list has the following attributes: - `allow_unauthenticated_cors` (Boolean) - `app_option` (Attributes) - `clientless_access` (Boolean) - `external_id` (Number) - `host` (String) - `id` (Number) - `is_user_portal_app` (Boolean) - `private_app_name` (String) - `private_app_protocol` (String) - `protocols` (Attributes List) - `public_host` (String) - `reachability` (Attributes) - `real_host` (String) - `service_publisher_assignments` (Attributes List) - `suppliment_dns_for_osx` (Boolean) - `trust_self_signed_certs` (Boolean) - `use_publisher_dns` (Boolean) #### Nested Schema for `data.protocols` Read-Only: - `created_at` (String) - `id` (Number) - `port` (String) - `service_id` (Number) - `transport` (String) - `updated_at` (String) #### Nested Schema for `data.reachability` Read-Only: - `error_code` (Number) - `error_string` (String) - `reachable` (Boolean) #### Nested Schema for `data.service_publisher_assignments` Read-Only: - `primary` (Boolean) - `publisher_external_id` (Number) - `publisher_name` (String) - `reachability` (Attributes) - `service_external_id` (Number) #### Nested Schema for `data.service_publisher_assignments.reachability` Read-Only: - `error_code` (Number) - `error_string` (String) - `reachable` (Boolean) ``` -------------------------------- ### Create an NPAPolicyGroups Resource Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_policy_groups.md Use this resource to create and configure an NPA policy group. Ensure all required attributes like `group_name`, `group_order`, `modify_by`, `modify_type`, and `silent` are provided. ```terraform resource "ns_npa_policy_groups" "my_npapolicygroups" { group_name = "...my_group_name..." group_order = { group_order = { group_id = "1" order = "before" } } modify_by = "...my_modify_by..." modify_type = "...my_modify_type..." silent = "1" } ``` -------------------------------- ### NPA Publisher Upgrade Profiles List Data Source Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_publisher_upgrade_profiles_list.md Use this data source to query and retrieve a list of all NPA publisher upgrade profiles. No configuration is required. ```terraform data "ns_npa_publisher_upgrade_profiles_list" "my_npapublisherupgradeprofileslist" { } ``` -------------------------------- ### ns_npa_publisher_upgrade_profile Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/data-sources/npa_publisher_upgrade_profile.md The NPA Publisher is a software package that enables private application connectivity between your data center and the Netskope cloud. It is a crucial component of Netskope’s Private Access (NPA) solution, which provides zero-trust network access (ZTNA) to private applications and data in hybrid IT environments. This data object queries and returns an upgrade profile by supplying 'external_id' of your profile. ```APIDOC ## ns_npa_publisher_upgrade_profile (Data Source) ### Description The NPA Publisher is a software package that enables private application connectivity between your data center and the Netskope cloud. It is a crucial component of Netskope’s Private Access (NPA) solution, which provides zero-trust network access (ZTNA) to private applications and data in hybrid IT environments. This data object queries and returns an upgrade profile by supplying 'external_id' of your profile. ### Parameters #### Required - **publisher_upgrade_profile_id** (Number) - publisher upgrade profile external_id ### Read-Only Attributes - **created_at** (String) - **docker_tag** (String) - **enabled** (Boolean) - **frequency** (String) - **name** (String) - **next_update_time** (Number) - **num_associated_publisher** (Number) - **release_type** (String) - **timezone** (String) - **updated_at** (String) - **upgrading_stage** (Number) - **will_start** (Boolean) ### Example Usage ```terraform data "ns_npa_publisher_upgrade_profile" "my_npapublisherupgradeprofile" { publisher_upgrade_profile_id = 1 } ``` ``` -------------------------------- ### Create ns_npa_rules Resource Source: https://github.com/netskopeoss/terraform-provider-ns/blob/main/docs/resources/npa_rules.md Use this resource to define and manage Network Policy Rules (NPA Rules). Configure various parameters like description, enablement, group association, and detailed rule data including access methods, DLP actions, and TSS actions. ```terraform resource "ns_npa_rules" "my_nparules" { description = "any" enabled = "1" group_id = "1" group_name = "My policy group" rule_data = { access_method = [ "Client" ] b_negate_net_location = false b_negate_src_countries = false classification = "...my_classification..." device_classification_id = [ 9 ] dlp_actions = [ { actions = [ "bypass" ] dlp_profile = "Payment Card" } ] external_dlp = true json_version = 3 match_criteria_action = { action_name = "allow" } net_location_obj = [ "..." ] organization_units = [ "..." ] policy_type = "private-app" private_app_tag_ids = [ "..." ] private_app_tags = [ "..." ] private_apps = [ "..." ] private_apps_with_activities = [ { activities = [ { activity = "any" list_of_constraints = [ "..." ] } ] app_id = [ "..." ] app_name = "[172.31.12.135]" } ] show_dlp_profile_action_table = true src_countries = [ "..." ] tss_actions = [ { actions = [ { action_name = "allow" remediation_profile = "...my_remediation_profile..." severity = "low" template = "...my_template..." } ] tss_profile = [ "..." ] } ] tss_profile = [ "..." ] user_groups = [ "..." ] user_type = "user" users = [ "..." ] version = 1 } rule_name = "vantest" rule_order = { order = "before" position = 5 rule_id = "...my_rule_id..." rule_name = "api-policy-managed" } silent = "1" } ```