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

ROSA STS outputs / attr. reference issues #76

Open
willgarcia opened this issue Jan 26, 2023 · 1 comment
Open

ROSA STS outputs / attr. reference issues #76

willgarcia opened this issue Jan 26, 2023 · 1 comment

Comments

@willgarcia
Copy link

The example of ROSA cluster provisioning available here: https://github.com/openshift-online/terraform-provider-ocm/tree/main/examples/create_rosa_cluster/create_rosa_sts_cluster/cluster fails on the following outputs:

terraform apply
....
│ Error: Unsupported attribute
│ 
│   on output.tf line 11, in output "oidc_thumbprint":
│   11:   value = ocm_cluster_rosa_classic.rosa_sts_cluster.sts.thumbprint
│ 
│ This value does not have any attributes.
╵
╷
│ Error: Unsupported attribute
│ 
│   on output.tf line 15, in output "oidc_endpoint_url":
│   15:   value = ocm_cluster_rosa_classic.rosa_sts_cluster.sts.oidc_endpoint_url
│ 
│ This value does not have any attributes.

The STS attributes do not seem to be exposed correctly.

When exporting the entire object with:

output "cluster_data" {
  value = ocm_cluster_rosa_classic.rosa_sts_cluster
}

the STS data is visible in the tfstate file, so this might be related to an issue with certain output attributes.

This issue also prevents the use of any resource references to ocm_cluster_rosa_classic.rosa_sts_cluster.sts.* within the same main.tf, which would indicate why the IAM roles have been separated into a different TF deployment (https://github.com/openshift-online/terraform-provider-ocm/tree/main/examples/create_rosa_cluster/create_rosa_sts_cluster/operator_roles_and_oidc)

@ChrisSmiles
Copy link

ChrisSmiles commented Feb 14, 2023

@willgarcia Guessing you might have a solution by now but i used a workaround for this by adding a lookup to the operator role code. I now run it in the same tf deployment as the cluster code, added the lookup to output.tf as well.

cluster_id = ocm_cluster_rosa_classic.rosa_sts_cluster.id
rh_oidc_provider_thumbprint = lookup(ocm_cluster_rosa_classic.rosa_sts_cluster.sts, "thumbprint")
rh_oidc_provider_url = lookup(ocm_cluster_rosa_classic.rosa_sts_cluster.sts, "oidc_endpoint_url")
operator_roles_properties = data.ocm_rosa_operator_roles.operator_roles.operator_iam_roles

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants