Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXE-3463 Bug: Rule builder does not generate the correct default value for the customCertificate property #515

Closed
antoine-savignac-nm opened this issue Jan 10, 2024 · 2 comments

Comments

@antoine-savignac-nm
Copy link

antoine-savignac-nm commented Jan 10, 2024

When there is no custom certificates, the provider should generate the rule JSON with a default value of [] for the custom_certificate property in the origin rule.

Terraform Version

1.2.5

Rule format

rules_v2023_10_30

Provider version

5.5.0

Affected Resource(s)

  • akamai_property_rules_builder

Terraform Configuration Files

behavior {
      origin {
        cache_key_hostname = "REQUEST_HOST_HEADER"
        compress           = true
        custom_certificate_authorities {
          ...
        }

        custom_certificate_authorities {
          ...
        }
        custom_valid_cn_values = [
          "{{Origin Hostname}}",
          "{{Forward Host Header}}"
        ]
        enable_true_client_ip            = true
        forward_host_header              = "REQUEST_HOST_HEADER"
        hostname                         = var.origin_hostname
        http_port                        = 80
        https_port                       = 443
        origin_certificate               = ""
        origin_certs_to_honor            = "COMBO"
        origin_sni                       = true
        origin_type                      = "CUSTOMER"
        ports                            = ""
        standard_certificate_authorities = ["akamai-permissive"]
        true_client_ip_client_setting    = false
        true_client_ip_header            = "True-Client-IP"
        verification_mode                = "CUSTOM"
      }
    }

Expected Behavior

The "origin" rule should have been created and added to the property without custom certificates
"customCertificates": [],

Actual Behavior

The API call to activate the property failed because the rule configuration is wrong.
API Error message:

15:57:07 │ Error: activation cannot continue due to rule errors: [
15:57:07 │ 	{
15:57:07 │ 		"behavior_name": "",
15:57:07 │ 		"detail": "The Specific Certificates (pinning) option on the `Origin Server` behavior is required.",
15:57:07 │ 		"error_location": "#/rules/behaviors/0/options/customCertificates",
15:57:07 │ 		"instance": "",
15:57:07 │ 		"status_code": 0,
15:57:07 │ 		"title": "",
15:57:07 │ 		"type": "https://problems.luna.akamaiapis.net/papi/v0/validation/attribute_required"
15:57:07 │ 	}
15:57:07 │ ]

Steps to Reproduce

  1. terraform apply

Important Factoids

If you try to add an empty block (in the HCL) you get an empty object inside a list (in the JSON output), example:
Input:

custom_certificate { }

Output:

{
  "customCertificates": [{}],
}

And this fails when we try to activate the property because it doesn't match the schema

16:40:26 │ 	"title": "Input does not match schema",
16:40:26 │ 	"detail": "Your input has a syntax problem.  Please double check against the schema.",

References

@lsadlon
Copy link

lsadlon commented Jan 11, 2024

Hello @antoine-savignac-nm

Thank you for raising this issue. We were able to reproduce it and create internal ticket to fix it.

BR,
Lukasz

@lsadlon lsadlon changed the title Bug: Rule builder does not generate the correct default value for the customCertificate property DXE-3463 Bug: Rule builder does not generate the correct default value for the customCertificate property Jan 11, 2024
@lkowalsk-akamai-com
Copy link
Contributor

lkowalsk-akamai-com commented Mar 26, 2024

This issue should be fixed with recent release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants