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-3477 Error when activating property configuration changes - Provider produced inconsistent final plan #549

Open
akrrev opened this issue Apr 24, 2024 · 1 comment

Comments

@akrrev
Copy link

akrrev commented Apr 24, 2024

Hi,

I experience a bug when I try to update the configurations for multiple properties. The error mentions an inconsistent final plan, which should be a provider issue and seems to be caused in the property activation, even when I'm not activating a new version.

Terraform and Akamai Terraform Provider Versions

Terraform v1.8.1
on darwin_arm64
+ provider registry.terraform.io/akamai/akamai v6.1.0
+ provider registry.terraform.io/hashicorp/local v2.5.1
+ provider registry.terraform.io/hashicorp/time v0.11.1
+ provider registry.terraform.io/hashicorp/tls v4.0.5

Affected Resource(s)

Please list the resources as a list, for example:

  • akamai_property_activation
  • akamai_property (not sure if it directly relates to the property or only the property activation).

Terraform Configuration Files

terraform {
  required_providers {
    akamai = {
      source  = "akamai/akamai"
      version = ">= 6.1.0"
    }
  }
  required_version = ">= 1.8.1"
}

locals {
  hostname_list = flatten([
    ... # for loop generating desired structure for dynamic "hostnames" block.
  ])
}

provider "akamai" {
  edgerc         = "edgerc-location"
  config_section = "config-section"
}

resource "akamai_edge_hostname" "PROPERTY_NAME-edgekey-net" {
  contract_id   = "contract-id"
  group_id      = "group-id"
  ip_behavior   = "IPV6_COMPLIANCE"
  edge_hostname = "PROPERTY_NAME.edgekey.net"
}

resource "akamai_property" "PROPERTY_NAME" {
  name      = "PROPERTY_NAME"
  contract_id = "contract_id"
  group_id = "group-id"
  product_id = "prd_Site_Accel"
  hostnames {
    cname_from             = "HOSTNAME"
    cname_to               = akamai_edge_hostname.PROPERTY_NAME-edgekey-net.edge_hostname
    cert_provisioning_type = "CPS_MANAGED"
  }
  dynamic "hostnames" {
    for_each = local.hostname_list
    content {
      cname_from             = "${hostnames.value.hostname}.MORE"
      cname_to               = akamai_edge_hostname.PROPERTY_NAME-edgekey-net.edge_hostname
      cert_provisioning_type = "CPS_MANAGED"
    }
  }
  rule_format = data.akamai_property_rules_builder.PROPERTY_NAME_rule_default.rule_format      # v2024_01_09
  rules       = data.akamai_property_rules_builder.PROPERTY_NAME_rule_default.json
}

resource "akamai_property_activation" "PROPERTY_NAME-staging" {
  property_id                    = akamai_property.PROPERTY_NAME.id
  contact                        = ["contact1@example.com", "contact2@example.com"]
  version                        = var.activate_stage ? akamai_property.PROPERTY_NAME.latest_version : akamai_property.PROPERTY_NAME.staging_version
  network                        = "STAGING"
  auto_acknowledge_rule_warnings = false
  # note                           = ""
}

resource "akamai_property_activation" "PROPERTY_NAME-production" {
  property_id                    = akamai_property.PROPERTY_NAME.id
  contact                        = ["contact1@example.com", "contact2@example.com"]
  version                        = var.activate_prod ? akamai_property.PROPERTY_NAME.latest_version : akamai_property.PROPERTY_NAME.production_version
  network                        = "PRODUCTION"
  auto_acknowledge_rule_warnings = false
  # note                           = ""
}

Expected Behavior

The provider should have updated my properties and activations with the latest configurations and note(s).

Actual Behavior

╷
│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for akamai_property_activation.PROPERTY_NAME-staging to include new values learned so far during apply, provider "registry.terraform.io/akamai/akamai"
│ produced an invalid new value for .note: was null, but now cty.StringVal("SOME COMMENT").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for akamai_property_activation.PROPERTY_NAME-production to include new values learned so far during apply, provider "registry.terraform.io/akamai/akamai"
│ produced an invalid new value for .note: was null, but now cty.StringVal("SOME COMMENT").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵

Steps to Reproduce

  1. Implement changes to the property configuration or its rules.
  2. Leave auto_acknowledge_rule_warnings as false
  3. Change or remove the note for the property activation
  4. Run terraform apply

Additional info

I experienced the same issues in Terraform version 1.6.2 with Akamai Provider version 6.0.0

@lsadlon lsadlon changed the title Error when activating property configuration changes - Provider produced inconsistent final plan DXE-3477 Error when activating property configuration changes - Provider produced inconsistent final plan Apr 24, 2024
@lsadlon
Copy link

lsadlon commented Apr 24, 2024

Hi @akrrev

Thanks for reporting this issue. We were able to reproduce it and will inform you about the progress of fix.

BR,
Lukasz

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

No branches or pull requests

3 participants