akamai / terraform-provider-akamai

Terraform Akamai provider

Home Page:https://www.terraform.io/docs/providers/akamai/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changes at Akamai side vs the plan not containing "value" for empty variables?

vegardengen opened this issue · comments

Hi,

It seems something has changed - likely in Akamai - in the last day. I had a failure deploying a property that deployed perfectly a few days earlier, and the only change is in a variable value.

It seems empty variables will omit "value" from the rules-section of the plan. It seems it has always done that, but now I see that Akamai have stopped accepting it, giving the below error.

I'll of course try some upgrades here and there, as I am not on newest terraform or terraform provider, but it doesn't look like that's the issue.

Terraform Version

terraform 1.4, akamai terraform provider 3.5.0

Affected Resource(s)

Please list the resources as a list, for example:

  • akamai_property
  • akamai_property_activation

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resources.tf contains:

resource "akamai_property" "xxxx" {
....
rule_format = "v2023-01-05"
rules = data.akamai_property_rules_template.rules.json
}

....
resource "akamai_property_activation" "xxxx" {
property_id = akamai_property.xxxx.id
contact = ["vegard.engen@dnb.no"]
version = akamai_property.xxxx.latest_version
network = upper(var.network)
note = var.note

Debug Output (relevant excerpt)

akamai_property.xxxx: Modifying... [id=prp_759429]
Error: updating rule tree: API error:
{
"type": "https://problems.luna.akamaiapis.net/papi/v0/json-schema-invalid",
"title": "Input does not match schema",
"detail": "Your input has a syntax problem. Please double check against the schema.",
"instance": "[MASKED]https:///papi/v1/properties/prp_759429/versions/29/rules?contractId=ctr_P-2ZIU5WF\u0026groupId=grp_154446#c4df64e849601177",
"statusCode": 400,
"errors": [
{
"location": "/rules/variables/1",
"schemaLocation": "/definitions/variable",
"detail": "object has missing required properties (["value"])",
"required": [
"name",
"value"
],
"missing": [
"value"
]
}

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

Should have become empty variables in Akamai.

Actual Behavior

Failed to deploy

Steps to Reproduce

  • Create a property.
  • Create variables in a json with "value": ""
  • Try to deploy

Important Factoids

References

Hi @vegardengen! Thanks for sharing it with us. I'll investigate it and get back to you.

I have verified that the issue is no longer there in 5.1.0, and luckily for us, the upgrade from 3.5.0 to 5.1.0 seems pretty straight forward.

(4.1.0 introduced strict requirement for variable usage that conflicted with what we are doing, but that was reversed in 5.1.0)

I'm glad v5.1.0 works for you and thank you @vegardengen for letting us know. I'm closing this issue then. Please, reopen if you have any other questions or create a new one.