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

launchdarkly_team_members data source failing on terraform execution #144

Open
mohamaa opened this issue Apr 18, 2023 · 1 comment
Open

Comments

@mohamaa
Copy link

mohamaa commented Apr 18, 2023

data "launchdarkly_team_members" "tesla" { emails = ["[email protected]", "[email protected]"] } resource "launchdarkly_feature_flag" "mohamaa-featurex" { for_each = var.create_flags ? tomap({ for i, v in var.ff_list : i => v }) : tomap({}) project_key = "projectx" name = each.value.ff_name #"mohamaa-featurex" key = each.value.ff_name #"mohamaa-featurexx" description = "Adds the FeatureX to the displayed interface" tags = ["managed-by-terraform"] maintainer_id = data.launchdarkly_team_members.tesla.id variation_type = "boolean" variations { value = true } variations { value = false } }

│ Error: invalid value for maintainer_id (Must be a 24 character hexadecimal string) │ │ with launchdarkly_feature_flag.mohamaa-featurex["0"], │ on main.tf line 24, in resource "launchdarkly_feature_flag" "mohamaa-featurex": │ 24: maintainer_id = data.launchdarkly_team_members.tesla.id │ ╵

@ldhenry
Copy link
Collaborator

ldhenry commented Apr 19, 2023

Hey @mohamaa,

From what I can tell you are trying to assign multiple team members as maintainers to a feature flag. Today, the Terraform provider only supports assigning a single team member as a feature flag maintainer so you would need to do something like this:

data "launchdarkly_team_member" "member" {
  email = "[email protected]"
}

resource "launchdarkly_feature_flag" "test-flag" {
  project_key    = "projectx"
  name           = "test flag"
  key            = "test-flag"
  tags           = ["managed-by-terraform"]
  maintainer_id  = data.launchdarkly_team_member.member.id
  variation_type = "boolean"
  variations { value = true }
  variations { value = false }
}

Assigning LaunchDarkly teams as maintainers to feature flags is a relatively new feature in LaunchDarkly but is still a clear commission in our Terraform provider today. I've created an internal ticket to add this functionality to our next release and I'll be sure to update this ticket when it's available.

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

No branches or pull requests

2 participants