akamai / terraform-provider-akamai

Terraform Akamai provider
https://www.terraform.io/docs/providers/akamai/
Mozilla Public License 2.0
109 stars 96 forks source link

Using property manager with declarative option issue #465

Closed renatotecchio closed 11 months ago

renatotecchio commented 1 year ago

Hi @lkowalsk-akamai-com could you open this issue again? I'm facing three problems when using property manager with declarative option.

In the behavior -> origin block I need to pass the custom certificates but Terraform is not accepting it:

    behavior {
      origin {
       ...
        custom_certificates = [
          {
            subject_CN = "istio-ingressgateway.istio-system.svc"
            subject_alternative_names = ["istio-ingressgateway.istio-system.svc", "istio-ingressgateway.istio-system.svc.cluster.local"]
            subject_RDNs = {
              CN = "istio-ingressgateway.istio-system.svc"
            }     
            not_after = "${env.akamai_origin_certificate_expire}"
            sha1_fingerprint = "${env.akamai_origin_certificate_sha}"
            pem_encoded_cert = "${env.akamai_origin_certificate}"
          }
        ]
      }
    }

Terraform message: An argument named "custom_certificates" is not expected here. Did you mean to define a block of type "custom_certificates"?

In the behavior -> cp_code block I need to pass the cp_code_limits but Terraform is not accepting it:

    behavior {
      cp_code {
        value {
          ...
          cp_code_limits = {
            limit = 100
            current_capacity = 96
            limit_type = global
          }
        }
      }
    }

Terraform message: An argument named "cp_code_limits" is not expected here. Did you mean to define a block of type "cp_code_limits"?

In the behavior -> site_shield block I need to pass the has_mixed_hosts and src but Terraform is not accepting it:

    behavior {
      site_shield {
        ssmap {
         ...
          has_mixed_hosts = false
          src = "PREVIOUS_MAP"
        }
      }
    }

Terraform message: An argument named "has_mixed_hosts" is not expected here. An argument named "src" is not expected here.

renatotecchio commented 1 year ago

Terraform version: v1.5.2 Provider version: v5.1.0 product_id: prd_Site_Defender

majakubiec commented 1 year ago

Hi @renatotecchio

the message An argument named "custom_certificates" is not expected here. Did you mean to define a block of type "custom_certificates"? you see is because you used argument syntax (the one with =) where block syntax were expected by terraform:

expected (notice missing = before {):

 behavior {
      origin {
       ...
        custom_certificates {
            ...
        }
        custom_certificates {
             ...
        }

same for cp_code_limits

cp_code_limits {
       ...
}

Although custom_certificates and 'ssmap' blocks do miss some fields, and we are aware of that.

Regards

lkowalsk-akamai-com commented 11 months ago

This issue should now be fixed