-
Notifications
You must be signed in to change notification settings - Fork 24
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_role_mapping Team not found error #179
Comments
Hey @joe-hutchinson-cko, can you share what your config looks like (specifically the In general we try to avoid retrying 404s because they are a good indication that the underlying resource has been deleted. However, if things are still not working after using a |
Hey Henry, sorry should have added some code to this to start with. resource "okta_group" "writers" {
name = "App.LaunchDarkly.${local.name}.writers"
description = "LaunchDarkly project team ${local.name}"
}
resource "launchdarkly_custom_role" "writers" {
key = "${local.name}-writers-role"
name = "${local.name} Writers Role"
description = "Role for ${local.name} project created by Terraform"
policy_statements {
effect = "allow"
resources = ["proj/${var.project_key}:env/*:flag/*"]
actions = [
"applyApprovalRequest",
"attachReleasePipeline",
"cloneFlag",
"copyFlagConfigFrom",
"copyFlagConfigTo",
"createApprovalRequest",
"createFlag",
"createFlagLink",
"createTriggers",
"deleteApprovalRequest",
"deleteFlag",
"deleteFlagLink",
"deleteTriggers",
"detachReleasePipeline",
"manageFlagFollowers",
"updateApprovalRequest",
"updateAttachedGoals",
"updateClientSideFlagAvailability",
"updateDescription",
"updateExpiringRules",
"updateExpiringTargets",
"updateFallthrough",
"updateFeatureWorkflows",
"updateFlagCodeReferences",
"updateFlagCustomProperties",
"updateFlagDefaultVariations",
"updateFlagLink",
"updateFlagRuleDescription",
"updateFlagSalt",
"updateFlagVariations",
"updateGlobalArchived",
"updateIncludeInSnippet",
"updateMaintainer",
"updateName",
"updateOffVariation",
"updateOn",
"updatePrerequisites",
"updateReleasePhaseCompleted",
"updateRules",
"updateScheduledChanges",
"updateTags",
"updateTargets",
"updateTemporary",
"updateTriggers"
]
}
policy_statements {
effect = "allow"
resources = ["proj/*"]
actions = ["viewProject"]
}
}
resource "launchdarkly_team_role_mapping" "writers" {
team_key = lower(okta_group.writers.name)
custom_role_keys = [launchdarkly_custom_role.writers.key]
} The above is all in all defined in a single module, as I'm referencing outputs of each resource in creation of the next would allow TF in infer the correct order of creation. Happy to try adding |
Thanks for sharing. Given that you are using the output from the Just to confirm, are you seeing these only during the creation of a new team or are they also happening when updating an existing team? |
So far just when creating a new team. It appears to be happening consistently. |
Hi Henry, Bit more detail this is definitely occurring when you Terraform the team at the same time as trying to link it to the role. Error received is:
I can put an arbitrary delay in creating the role mapping but it's a bit of a hack, better solution is for LD API or provider to handle this gracefully. |
Hey @joe-hutchinson-cko, We're pretty heads down on new feature work but I'll try to get someone to pick it up next week. Sorry for the the delay on this. Thanks, |
Hey @joe-hutchinson-cko, We just released v2.15.2 of the Terraform provider. This release includes 404 retries for the Cheers, |
Appears like the newly implemented launchdarkly_team_role_mapping resource can sometimes error when referencing a team that is being created as part of the same Terraform apply operation.
The provider should handle team not found type errors with retries.
The text was updated successfully, but these errors were encountered: