<?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 Re: Terraform - Unable to create Security Policy in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519479#M3221</link>
    <description>&lt;P&gt;Depending on how many rules are in your policy, it could take a while, yes.&amp;nbsp; After creating all the security rules, it has to adjust the placement of each rule to ensure that they are placed where they need to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see what's going on, you can always tell Terraform to show you debug output using the &lt;CODE&gt;TF_LOG&lt;/CODE&gt; environment variable so you can see what the provider is sending and receiving with regards to PAN-OS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;TF_LOG=debug terraform apply 2&amp;gt;&amp;amp;1 | tee out.log&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can view the "out.log" file afterwards to see the API calls and what's happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll also need to configure the provider to output both "send" and "receive" within your provider configuration block:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;provider "panos" {
    # ...other config options here
    logging = [
        "send",
        "receive",
        "action",
        "query",
        "op",
    ]
}&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 27 Oct 2022 23:23:54 GMT</pubDate>
    <dc:creator>gfreeman</dc:creator>
    <dc:date>2022-10-27T23:23:54Z</dc:date>
    <item>
      <title>Terraform - Unable to create Security Policy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519459#M3220</link>
      <description>&lt;P&gt;I'm using Terraform to deploy configurations on a VM-50 series virtual Palo Alto Firewall appliance.&amp;nbsp; I have a problem when it comes to deploying a security policy using panos_security_policy.&amp;nbsp; Essentially, the policies never create and the Terraform command status stays on 'Still Creating...'.&amp;nbsp; Is there a known issue with using Terraform to create security policies?&amp;nbsp; If not, how do I troubleshoot this?&amp;nbsp; Thanks in advance.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;Please note you are posting a public message where community members and experts can provide assistance. Sharing private information such as serial numbers or company information is not recommended.</description>
      <pubDate>Thu, 27 Oct 2022 21:29:06 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519459#M3220</guid>
      <dc:creator>Ajene</dc:creator>
      <dc:date>2022-10-27T21:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Terraform - Unable to create Security Policy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519479#M3221</link>
      <description>&lt;P&gt;Depending on how many rules are in your policy, it could take a while, yes.&amp;nbsp; After creating all the security rules, it has to adjust the placement of each rule to ensure that they are placed where they need to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see what's going on, you can always tell Terraform to show you debug output using the &lt;CODE&gt;TF_LOG&lt;/CODE&gt; environment variable so you can see what the provider is sending and receiving with regards to PAN-OS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;TF_LOG=debug terraform apply 2&amp;gt;&amp;amp;1 | tee out.log&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can view the "out.log" file afterwards to see the API calls and what's happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll also need to configure the provider to output both "send" and "receive" within your provider configuration block:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;provider "panos" {
    # ...other config options here
    logging = [
        "send",
        "receive",
        "action",
        "query",
        "op",
    ]
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 Oct 2022 23:23:54 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519479#M3221</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2022-10-27T23:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Terraform - Unable to create Security Policy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519481#M3222</link>
      <description>&lt;P&gt;Thanks for the reply, I'll try out the logging.&amp;nbsp; Although the screenshot I shared has 8 minutes.&amp;nbsp; I've let it run for over 2 hours!&amp;nbsp; It just seems stuck.&amp;nbsp; And, I'm only attempting to create a simple rule.&amp;nbsp; For example:&lt;/P&gt;&lt;LI-CODE lang="css"&gt;resource "panos_security_policy" "server" {
    rule {
        name = "server"
        audit_comment = "Terraform"
        source_zones = ["any"]
        source_addresses = ["any"]
        source_users = ["any"]
        hip_profiles = ["any"]
        destination_zones = ["any"]
        destination_addresses = ["any"]
        applications = ["any"]
        services = ["application-default"]
        categories = ["any"]
        action = "allow"
    }
    lifecycle {
        create_before_destroy = true
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;While I'll try the logging, I'm not sure how I'll be able to use that information to actually fix the issue.&amp;nbsp; Everything else I've tried to create works fine.&amp;nbsp; It seems fundamental to how Terraform is interacting with the PA api.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 00:17:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519481#M3222</guid>
      <dc:creator>Ajene</dc:creator>
      <dc:date>2022-10-28T00:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Terraform - Unable to create Security Policy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519482#M3223</link>
      <description>&lt;P&gt;That &lt;CODE&gt;hip_profiles&lt;/CODE&gt; param might be causing issues, depending on which version of PAN-OS you're running.&amp;nbsp; It was removed in PAN-OS v10.1.5.&amp;nbsp; I'd recommend leaving it unspecified and trying &lt;CODE&gt;terraform apply&lt;/CODE&gt; again.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 00:29:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519482#M3223</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2022-10-28T00:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Terraform - Unable to create Security Policy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519487#M3224</link>
      <description>&lt;P&gt;After enabling the logging, I was able to see that the issue was indeed the fact that I had an argument that was throwing an error.&amp;nbsp; Once I removed it, the security policy created successfully, rapidly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The argument that cause me an issue is:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;hip_profiles = ["any"]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Which is strange because it is used in the example block on the Terraform Registry site for the Palo Alto provider.&amp;nbsp; Either way, thank you so much for your help.&amp;nbsp; Your advice was spot on.&amp;nbsp; I learned a lot!!&amp;nbsp; Thanks again!!!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 00:47:53 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/519487#M3224</guid>
      <dc:creator>Ajene</dc:creator>
      <dc:date>2022-10-28T00:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Terraform - Unable to create Security Policy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/525618#M3286</link>
      <description>&lt;P&gt;this was the case for me as well, PAN OS version 10.2.2-h2, terraform panos provder is 1.11.0. Omitting hip_profile solved the issue. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 21:32:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/terraform-unable-to-create-security-policy/m-p/525618#M3286</guid>
      <dc:creator>AdrianTotilaz1</dc:creator>
      <dc:date>2023-01-02T21:32:31Z</dc:date>
    </item>
  </channel>
</rss>

