DataDog / terraform-provider-datadog

Terraform Datadog provider
https://www.terraform.io/docs/providers/datadog/
Mozilla Public License 2.0
403 stars 379 forks source link

Documentation for `datadog_team_permission_settings` is misleading/incomplete #2446

Closed 2rs2ts closed 4 months ago

2rs2ts commented 5 months ago

Datadog Terraform Provider Version

v3.39.0

Terraform Version

v1.8.5

What resources or data sources are affected?

Terraform Configuration Files

resource "datadog_team" "myteam" {
  description = "My team description"
  handle      = "myteam"
  name        = "Myteam"
}

resource "datadog_team_permission_setting" "let_terraform_modify" {
  for_each = toset(["manage_membership", "edit"])
  team_id  = datadog_team.myteam.id
  action   = each.key
  value    = "organization"
}

Relevant debug or panic output

No response

Expected Behavior

I expected that this configuration would work and would make it so that anyone in my organization would be able to apply this terraform repo (after the datadog_team was initially created by someone with the permission to do so, anyway.)

The docs say that the values I used were valid.

Actual Behavior

Error: error updating team permission setting

  with datadog_team_permission_setting.let_terraform_modify["edit"],
  on main.tf line 76, in resource "datadog_team_permission_setting" "let_terraform_modify":
  76: resource "datadog_team_permission_setting" "let_terraform_modify" {

400 Bad Request: {"errors":["Invalid value type \"organization\". Valid values: teams_manage, admins, members"]}

I believe that the docs should make it more clear which values are valid. For what it's worth, I got a 403 on the other part of the for_each, which indicated that the value I chose was valid but I lack permissions to execute the change. I'm working with my org's admins to get the right permissions, but I believe the 400 error is not caused by me lacking access.

Steps to Reproduce

  1. terraform apply

Important Factoids

No response

References

No response

nkzou commented 4 months ago

Hey there, looks like the valid value options are dependent on the action value.

I'll confirm this with the backend team and get a documentation change out. Thanks for the report.