Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Error: produced an unexpected new value: .properties["rosa_creator_arn"] #75

@vamsinm

Description

@vamsinm

when trying to created ROSA cluster using ocm_cluster_rosa_classic and passing data.aws_caller_identity.current.arn as rosa_creator_arn in properties we are seeing following error when re-running terraform. it looks like rosa_creator_arn is mandatory field in properties. not sure what this value is used for. every time we run terraform a new dynamic user created by the assume role so it would always be different.

╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to ocm_cluster_rosa_classic.rosa_cluster,
│ provider "provider[\"registry.terraform.io/openshift-online/ocm\"]"
│ produced an unexpected new value: .properties["rosa_creator_arn"]: was
│ cty.StringVal("arn:aws:sts::<accountid>:assumed-role/automation-role/<dynamic-assumed-role-user-1673973178-nU4b8AH9Q>"),
│ but now
│ cty.StringVal("arn:aws:sts::<accountid>:assumed-role/automation-role/<dynamic-assumed-role-user-1673973068-2lwxcZ2Vy>").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

terraform code:

resource "ocm_cluster_rosa_classic" "rosa_cluster" {
    cloud_region         = var.aws_region
    name                      = var.cluster_name
    aws_account_id       = data.aws_caller_identity.current.account_id
    aws_subnet_ids       = var.rosa_subnet_ids
    availability_zones   = ["us-east-1a"]
    machine_cidr         = var.machine_cidr
    service_cidr         = var.service_cidr
    pod_cidr             = var.pod_cidr
    host_prefix          = var.host_prefix
    version              = "openshift-v4.11.21"
    autoscaling_enabled  = true
    min_replicas         = 3
    max_replicas         = 3
    compute_machine_type = var.compute_machine_type
    multi_az             = false
    aws_private_link     = true
    properties           = {
      rosa_creator_arn   = data.aws_caller_identity.current.arn
    }
    sts                  = local.sts_roles
}

if i am reading correct, properties is optional parameter but it does not look like ocm_cluster_rosa_classic works with out .properties["rosa_creator_arn"].

│ Error: Can't create cluster
│ 
│   with ocm_cluster_rosa_classic.rosa_cluster,
│   on rosa_cluster.tf line 144, in resource "ocm_cluster_rosa_classic" "rosa_cluster":
│  144: resource "ocm_cluster_rosa_classic" "rosa_cluster" {
│ 
│ Can't create cluster with name 'rosa-test': status is 400, identifier is
│ '400', code is 'CLUSTERS-MGMT-400' and operation identifier is
│ '18d26318-db17-43dd-ab63-01dd1080fef1': 'rosa_creator_arn' property is
│ required on ROSA clusters 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions