Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions checkpoint/resource_checkpoint_management_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ func createManagementPackage(d *schema.ResourceData, m interface{}) error {
if v, ok := d.GetOkExists("desktop_security"); ok {
_package["desktop-security"] = v.(bool)
}
if v, ok := d.GetOk("installation_targets"); ok {
_package["installation-targets"] = v.(*schema.Set).List()
if rawConfig := d.GetRawConfig(); !rawConfig.IsNull() && !rawConfig.GetAttr("installation_targets").IsNull() {
_package["installation-targets"] = d.Get("installation_targets").(*schema.Set).List()
}
if v, ok := d.GetOkExists("qos"); ok {
_package["qos"] = v.(bool)
Expand Down Expand Up @@ -213,12 +213,7 @@ func readManagementPackage(d *schema.ResourceData, m interface{}) error {
}
}
}
_, installationTargetsInConf := d.GetOk("installation_targets")
if len(installationTargetsIds) == 1 && installationTargetsIds[0] == "all" && !installationTargetsInConf {
_ = d.Set("installation_targets", []interface{}{})
} else {
_ = d.Set("installation_targets", installationTargetsIds)
}
_ = d.Set("installation_targets", installationTargetsIds)

} else {
_ = d.Set("installation_targets", nil)
Expand Down Expand Up @@ -302,9 +297,9 @@ func updateManagementPackage(d *schema.ResourceData, m interface{}) error {
_package["desktop-security"] = d.Get("desktop_security")
}

if ok := d.HasChange("installation_targets"); ok {
if v, ok := d.GetOk("installation_targets"); ok {
_package["installation-targets"] = v.(*schema.Set).List()
if d.HasChange("installation_targets") {
if rawConfig := d.GetRawConfig(); !rawConfig.IsNull() && !rawConfig.GetAttr("installation_targets").IsNull() {
_package["installation-targets"] = d.Get("installation_targets").(*schema.Set).List()
} else {
oldInstallationTargets, _ := d.GetChange("installation_targets")
_package["installation-targets"] = map[string]interface{}{"remove": oldInstallationTargets.(*schema.Set).List()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Use this data source to get information on an existing Check Point Set App Contr

```hcl
resource "checkpoint_management_set_app_control_advanced_settings" "example" {
url_filtering_settings = {
url_filtering_settings {
categorize_cached_and_translated_pages = "true"
categorize_https_websites = "false"
enforce_safe_search ="true"
}
custom_categorization_settings = {
custom_categorization_settings {
social_network_widgets_mode = "hold"
url_filtering_mode = "background"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ Use this data source to get information on an existing Check Point Access Rule.
resource "checkpoint_management_access_rule" "access_rule" {
name = "My Rule"
layer = "Network"
position = { top = "top" }
position { top = "top" }
source = ["Any"]
destination = ["Any"]
service = ["Any"]
content = ["Any"]
time = ["Any"]
install_on = ["Policy Targets"]
track = {
track {
type = "Log"
accounting = false
alert = "none"
enable_firewall_session = false
per_connection = true
per_session = false
}
custom_fields = {}
custom_fields {}
vpn = "Any"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "checkpoint_management_access_layer" "access_layer" {
resource "checkpoint_management_access_section" "access_section" {
name = "myaccesssection"
layer = "${checkpoint_management_access_layer.access_layer.name}"
position = {top = "top"}
position {top = "top"}
}

data "checkpoint_management_data_access_section" "data_access_section" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Use this data source to get information on an existing Check Point data center c
```hcl
data "checkpoint_management_data_center_content" "test" {
name = "Network"
filter = {
filter {
text = "TEXT_TO_FIND"
uri = "DATA_CENTER_URI"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use this data source to get information on an existing Check Point Https Rule.
```hcl
resource "checkpoint_management_https_rule" "https_rule" {
name = "HTTPS Rule"
position = {top = "top"}
position {top = "top"}
layer = "Default Layer"
blade = ["IPS"]
destination = ["Internet"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Use this data source to get information on an existing Check Point Https Section
resource "checkpoint_management_https_section" "https_section" {
name = "HTTPS section"
layer = "Default Layer"
position = {top = "top"}
position {top = "top"}
}

data "checkpoint_management_data_https_section" "data_https_section" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ resource "checkpoint_management_host" "myhost" {
resource "checkpoint_management_opsec_application" "opsec_application" {
name = "OPSEC application"
host = "${checkpoint_management_host.myhost.name}"
cpmi = {
cpmi {
enabled = true
administrator_profile = "read only all"
use_administrator_credentials = false
}
lea = {
lea {
enabled = true
access_permissions = "show all"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "checkpoint_management_service_other" "service_other" {
match_for_any = true
sync_connections_on_cluster = true
ip_protocol = 51
aggressive_aging = {
aggressive_aging {
use_default_timeout = true
enable = true
default_timeout = 600
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "checkpoint_management_set_https_advanced_settings" "example" {
certificate_pinned_apps_action = "bypass"
log_sessions = true
retrieve_intermediate_ca_certificates = true
server_certificate_validation_actions = {
server_certificate_validation_actions {
block_expired = true
block_revoked = false
block_untrusted = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "checkpoint_management_mobile_access_profile_rule" "example" {
name = "Rule 1"
mobile_profile = "Default_Profile"
user_groups = ["my_group",]
position = {top = "top"}
position {top = "top"}
}

data "checkpoint_management_mobile_access_profile_rule" "data" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use this data source to get information on an existing Check Point Mobile Access
```hcl
resource "checkpoint_management_mobile_access_profile_section" "example" {
name = "New Section 1"
position = {top = "top"}
position {top = "top"}
}
data "checkpoint_management_mobile_access_profile_section" "data" {
uid = "${checkpoint_management_mobile_access_profile_section.example.id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "checkpoint_management_mobile_access_rule" "example" {
name = "Rule 1"
applications = ["N", "e", "w", " ", "A", "p", "p", "l", "i", "c", "a", "t", "i", "o", "n",]
user_groups = ["my_group",]
position = {top = "top"}
position {top = "top"}
}
data "checkpoint_management_mobile_access_rule" "data" {
uid = "${checkpoint_management_mobile_access_rule.example.id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use this data source to get information on an existing Check Point Mobile Access
```hcl
resource "checkpoint_management_mobile_access_section" "example" {
name = "New Section 1"
position = {top = "top"}
position {top = "top"}
}
data "checkpoint_management_mobile_access_section" "data" {
name = "${checkpoint_management_mobile_access_section.example.name}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This resource allows you to execute Check Point NAT Rule.
resource "checkpoint_management_nat_rule" "test" {
name = "natrule"
package = "Standard"
position = {top = "top"}
position {top = "top"}
}

data "checkpoint_management_nat_rule" "test" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This resource allows you to execute Check Point NAT section.
resource "checkpoint_management_nat_section" "test" {
name = "nat section"
package = "Standard"
position = {top = "top"}
position {top = "top"}
}

data "checkpoint_management_nat_section" "nat_section" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use this data source to get information on an existing Check Point Network Probe
```hcl
resource "checkpoint_management_network_probe" "example" {
name = "network1"
icmp_options = {
icmp_options {
source = "host1"
destination = "host2"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "checkpoint_management_resource_smtp" "smtp" {
name = "newSmtpResource"
mail_delivery_server = "deliverServer"
exception_track = "exception log"
match = {
match {
sender = "expr1"
recipient = "expr2"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Use this data source to get information on an existing Check Point Resource Uri.
resource "checkpoint_management_resource_uri" "uri" {
name = "newUriResource"
use_this_resource_to = "optimize_url_logging"
connection_methods = {
connection_methods {
transparent = "false"
tunneling = "true"
proxy = false
Expand Down Expand Up @@ -47,7 +47,7 @@ resource "checkpoint_management_resource_uri" "uri" {
strip_script_tags = true

}
soap = {
soap {
inspection = "allow_all_soap_requests"
file_id = "scheme1"
track_connections = "mail_alert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ Use this data source to get information on an existing Check Point Service Gtp.
version = "v2"
reverse_service = true
trace_management = true
imsi_prefix = {
imsi_prefix {
enable = true
prefix = "123"
}
interface_profile = {
interface_profile {
profile = "Custom"
custom_message_types = "32-35"
}
selection_mode {
enable = true
mode = 1
}
ms_isdn= {
ms_isdn {
enable = true
ms_isdn = "312"
}
Expand All @@ -49,7 +49,7 @@ Use this data source to get information on an existing Check Point Service Gtp.
types = "11-50"
}
}
ldap_group = {
ldap_group {
enable = true
group = "ldap_group_1"
according_to = "MS-ISDN"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This resource allows you to execute Check Point Show Updatable Objects Repositor

```hcl
data "checkpoint_management_show_updatable_objects_repository_content" "query" {
filter = {
filter {
text = "API Gateway"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ This resource allows you to execute Check Point Threat Exception.
resource "checkpoint_management_threat_rule" "threat_rule" {
name = "threat rule"
layer = "Standard Threat Prevention"
position = {top = "top"}
position {top = "top"}
}

resource "checkpoint_management_threat_exception" "threat_exception" {
name = "threat exception"
layer = "Standard Threat Prevention"
position = {top = "top"}
position {top = "top"}
rule_name = "${checkpoint_management_threat_rule.threat_rule.name}"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This resource allows you to execute Check Point Threat Rule.
resource "checkpoint_management_threat_rule" "test" {
name = "threat rule"
layer = "Standard Threat Prevention"
position = {top = "top"}
position {top = "top"}
}

data "checkpoint_management_threat_rule" "test" {
Expand Down
Loading