<p>I want to create Security Policy in my Google Kubernetes such that there is Adaptive Protection enabled for the DDoS attacks, on my application layer.</p>
<p>Reading pulumi documents, this is what I came up with:</p>
<pre><code>ddos_layer7_defense_policy_name = &quot;ddos-layer7-defense-policy&quot;
ddos_layer7_defense_policy = gcp.compute.SecurityPolicy(
    resource_name=ddos_layer7_defense_policy_name,
    description=&quot;Policy for enabling DDoS defence on L7&quot;,
    name=ddos_layer7_defense_policy_name,
    adaptive_protection_config=gcp.compute.SecurityPolicyAdaptiveProtectionConfigArgs(
        layer7_ddos_defense_config=gcp.compute.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigArgs(
            enable=False, # enable DDoS defense
            rule_visibility=&quot;STANDARD&quot; 
        )
    )

)
</code></pre>
<p>I read the <a href="https://www.pulumi.com/registry/packages/gcp/api-docs/compute/securitypolicy/#securitypolicyadaptiveprotectionconfiglayer7ddosdefenseconfig" rel="nofollow noreferrer">official documents</a>, and while they also denote <code>enable=True</code> as the first argument, my local Pulumi library (the one installed in the virtualenv) does not have that <code>kwarg</code>. However, when I look at the code, I can see the two flags being very much present.</p>
<p>Still, I get the invalid key error:</p>
<pre><code>    error: gcp:compute/securityPolicy:SecurityPolicy resource 'ddos-layer7-defense-policy' has a problem: Invalid or unknown key. Examine values at 'SecurityPolicy.AdaptiveProtectionConfig.Layer7DdosDefenseConfig'.
</code></pre>
<p>Reading at the source code is not helping either as the signature matches to what I am providing.</p>
<p>This problem is also unsolved by people working on pulumi, such as <a href="https://archive.pulumi.com/t/2764528/did-anyone-try-to-configure-cloud-armour-https-www-pulumi-co#62c18e79-b3f0-41d9-bb4f-7e84f8fc483d" rel="nofollow noreferrer">this</a>.</p>
<h1>Update 1: Setting <code>enable=True</code> and removing <code>rule_visibility</code> produces the same result.</h1>

Aviral Srivastava
<p>The pulumi-gcp provider is derived from the Google Terraform provider.</p>
<p>There was a <a href="https://github.com/hashicorp/terraform-provider-google/issues/12554" rel="nofollow noreferrer">bug in this resource</a> in the Terraform provider which meant that it wasn't possible to manage these resources properly because the resource properties weren't being correctly sent to the API.</p>
<p>This was fixed in <a href="https://github.com/hashicorp/terraform-provider-google/pull/12661" rel="nofollow noreferrer">this</a> PR which was merged into <a href="https://github.com/hashicorp/terraform-provider-google/releases/tag/v4.39.0" rel="nofollow noreferrer">v4.39.0</a> of the Terraform provider.</p>
<p>This then propagated to the Pulumi provider in <a href="https://github.com/pulumi/pulumi-gcp/releases/tag/v6.40.0" rel="nofollow noreferrer">v6.40.0</a>.</p>
<p>It's likely you're not using <code>&gt;6.40.0</code> of the Pulumi provider, which is why you're experiencing this issue. Try upgrading, and then reattempt.</p>
