<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CheckPoint Terraform Provider; Lack of &amp;quot;glue&amp;quot; in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/CheckPoint-Terraform-Provider-Lack-of-quot-glue-quot/m-p/132509#M6364</link>
    <description>&lt;P&gt;When using Terraform one depends on the provider to give feedback on created resources.&lt;/P&gt;&lt;P&gt;For instance, if I create a policy package with "&lt;SPAN&gt;checkpoint_management_package" I cannot get any ID on neither the policy package itself, nor the&amp;nbsp;checkpoint_management_access_layer. Without that information I cannot create the rules for this layer in that terraform if I have multiple policy packages in the domain/smartcenter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is no way to add a layer to any policy either, which is the preferred way; create an empty policy package, then add the access layer as a separate operation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Every resource has to have some UID, unique name or other way of referencing it dynamically.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This lack of glue makes it impossible to create a single terraform.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;resource "checkpoint_management_package" "cloudPolicy" {
  name = "cloudPolicy"
  comments = "Automated by Terraform"
  threat_prevention = false
  access = false
}

resource "checkpoint_management_access_layer" "cloudLayer" {
  name = "cloudLayer"
  package = checkpoint_management_package.uid
  ...
}

resource "checkpoint_management_access_rule" "cloudRule1" {
  layer = checkpoint_management_access_layer.cloudLayer.uid
  position = {top = "top"}
  name = "test1"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without the UID I cannot glue together the TF above.&lt;/P&gt;&lt;P&gt;I suggest you take a look at a relatively mature provider, like azurerm, for inspiration. I can write large terraforms without relying on depends_on, which is bad practice, and there are multiple options for creating resources.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Oct 2021 21:28:58 GMT</pubDate>
    <dc:creator>Harald_Hansen</dc:creator>
    <dc:date>2021-10-24T21:28:58Z</dc:date>
    <item>
      <title>CheckPoint Terraform Provider; Lack of "glue"</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/CheckPoint-Terraform-Provider-Lack-of-quot-glue-quot/m-p/132509#M6364</link>
      <description>&lt;P&gt;When using Terraform one depends on the provider to give feedback on created resources.&lt;/P&gt;&lt;P&gt;For instance, if I create a policy package with "&lt;SPAN&gt;checkpoint_management_package" I cannot get any ID on neither the policy package itself, nor the&amp;nbsp;checkpoint_management_access_layer. Without that information I cannot create the rules for this layer in that terraform if I have multiple policy packages in the domain/smartcenter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is no way to add a layer to any policy either, which is the preferred way; create an empty policy package, then add the access layer as a separate operation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Every resource has to have some UID, unique name or other way of referencing it dynamically.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This lack of glue makes it impossible to create a single terraform.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;resource "checkpoint_management_package" "cloudPolicy" {
  name = "cloudPolicy"
  comments = "Automated by Terraform"
  threat_prevention = false
  access = false
}

resource "checkpoint_management_access_layer" "cloudLayer" {
  name = "cloudLayer"
  package = checkpoint_management_package.uid
  ...
}

resource "checkpoint_management_access_rule" "cloudRule1" {
  layer = checkpoint_management_access_layer.cloudLayer.uid
  position = {top = "top"}
  name = "test1"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without the UID I cannot glue together the TF above.&lt;/P&gt;&lt;P&gt;I suggest you take a look at a relatively mature provider, like azurerm, for inspiration. I can write large terraforms without relying on depends_on, which is bad practice, and there are multiple options for creating resources.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 21:28:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/CheckPoint-Terraform-Provider-Lack-of-quot-glue-quot/m-p/132509#M6364</guid>
      <dc:creator>Harald_Hansen</dc:creator>
      <dc:date>2021-10-24T21:28:58Z</dc:date>
    </item>
  </channel>
</rss>

