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

[Bug]: Cannot assign to team the same role but with different workspace ids #179

Open
KarolGongola opened this issue Dec 11, 2024 · 5 comments

Comments

@KarolGongola
Copy link

Description

We cannot create team with e.g. WORKSPACE_OWNER of 2 different workspaces. Example:

resource "astro_team" "admin_team" {
  name              = "team"
  description       = "team description"
  member_ids        = ["SOME_ID"]
  organization_role = "ORGANIZATION_MEMBER"
  workspace_roles = [
  {
    workspace_id = "ID_1"
    role         = "WORKSPACE_OWNER"
  },
  {
    workspace_id = "ID_2"
    role         = "WORKSPACE_OWNER"
  }
  ]
}

Because terraform raises following error:

│ Error: Invalid Configuration: Cannot have multiple roles with the same workspace id
│
│   with astro_team.admin_team,
│   on astro.tf line 27, in resource "astro_team" "admin_team":
│   27: resource "astro_team" "admin_team" {
│
│ Please provide a unique workspace id for each role. The following workspace ids are duplicated: []

So the error message sounds reasonable, but it is not true in my situation. The same I have observed for WORKSPACE_VIEWER as well.

Steps To Reproduce

Try to create team as shown above.

Acceptance Criteria

  • ability to assign one team as WORKSPACE_OWNER to more than one workspace

Anything else?

No response

@KarolGongola
Copy link
Author

KarolGongola commented Dec 11, 2024

I think error comes from this lines of code, but I have no idea how it is possible:

	duplicateWorkspaceIds := common.GetDuplicateWorkspaceIds(workspaceRoles)
	if len(duplicateWorkspaceIds) > 0 {
		resp.Diagnostics.AddError(
			"Invalid Configuration: Cannot have multiple roles with the same workspace id",
			fmt.Sprintf("Please provide a unique workspace id for each role. The following workspace ids are duplicated: %v", duplicateWorkspaceIds),
		)
		return
	}

@KarolGongola
Copy link
Author

I am using following versions:

Terraform v1.9.5
on linux_amd64
+ provider registry.terraform.io/astronomer/astro v1.0.0

@vandyliu
Copy link
Collaborator

vandyliu commented Jan 9, 2025

do you have the exact copy paste terraform config file with the actual IDs?
I just tried and it worked but I'm on version 1.0.3
Image

@KarolGongola
Copy link
Author

Could you please share your terraform version as well?

@vandyliu
Copy link
Collaborator

Could you please share your terraform version as well?

➜  terraform version                                                   [25/01/11|11:01am]
Terraform v1.9.8
on darwin_arm64

Your version of Terraform is out of date! The latest version
is 1.10.4. You can update by downloading from https://www.terraform.io/downloads.html

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

No branches or pull requests

2 participants