Skip to content

meshstack_landingzone owned_by_workspace Cannot set value for this attribute #200

@JohannesRudolph

Description

@JohannesRudolph

I upgraded from v0.12 to v0.21 of the provider and got this error

resource "meshstack_landingzone" "azure_m25_sandbox" {
  count = local.azure_m25_enabled ? 1 : 0

  metadata = {
    name = var.azure_m25_platform.sandbox_landing_zone.identifier
    tags = {
      "LandingZoneFamily" = ["sandbox"]
    }
  }
...
14:09:25.989 STDERR tofu: │ Error: Incorrect attribute value type
14:09:25.990 STDERR tofu: │ 
14:09:25.990 STDERR tofu: │   on resources.platform-setup.tf line 102, in resource "meshstack_landingzone" "azure_m25_sandbox":
14:09:25.990 STDERR tofu: │  102:   metadata = {
14:09:25.990 STDERR tofu: │  103:     name = var.azure_m25_platform.sandbox_landing_zone.identifier
14:09:25.990 STDERR tofu: │  104:     tags = {
14:09:25.990 STDERR tofu: │  105:       "LandingZoneFamily" = ["sandbox"]
14:09:25.990 STDERR tofu: │  106:     }
14:09:25.990 STDERR tofu: │  107:   }
14:09:25.990 STDERR tofu: │ 
14:09:25.990 STDERR tofu: │ Inappropriate value for attribute "metadata": attribute
14:09:25.990 STDERR tofu: │ "owned_by_workspace" is required.
14:09:25.990 STDERR tofu: ╵

Okay so let's add one

resource "meshstack_landingzone" "azure_m25_sandbox" {
  count = local.azure_m25_enabled ? 1 : 0

  metadata = {
    name = var.azure_m25_platform.sandbox_landing_zone.identifier
    owned_by_workspace = "test"
    tags = {
      "LandingZoneFamily" = ["sandbox"]
    }
  }

But now i get

  │ Error: Invalid Configuration for Read-Only Attribute
  │ 
  │   with meshstack_landingzone.azure_m25_sandbox,
  │   on resources.platform-setup.tf line 99, in resource "meshstack_landingzone" "azure_m25_sandbox":
  │   99: resource "meshstack_landingzone" "azure_m25_sandbox" {
  │ 
  │ Cannot set value for this attribute as the provider has marked it as
  │ read-only. Remove the configuration line setting the value.
  │ 
  │ Refer to the provider documentation or contact the provider developers for
  │ additional information about configurable and read-only attributes that are
  │ supported.

With no further details about the offending attribute as the line it targets is the resource declaration itself. I suppose it must be the owned_by_workspace attribute. Unfortunately, now I'm stuck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions