DataDog / terraform-provider-datadog

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

Support restricted users and service accounts (not just roles) #2536

Open multinegsix opened 1 month ago

multinegsix commented 1 month ago

What resources or data sources are affected?

resource_datadog_monitor, resource_datadog_dashboard, ..., whatever that has restricted_roles variable in it.

Feature Request

Currently we can only add "restricted roles", but not "restricted users" or "restricted service account" through Terraform. If a user's ID is specified in "restricted_roles", a 400 bad request will be returned, saying "'restricted_roles' must consist only of valid Role UUIDs".

Importing an existing resource with a user configured for restricted access from the UI will not include any state related to that user having restricted permissions.

This metadata seems not only unsupported/unexposed through TF, but also not in the HTTP API: https://docs.datadoghq.com/api/latest/dashboards/

(So there might be a larger problem to solve that's outside of this provider.)

Update: I found there's a "datadog_restriction_policy" that seems to solve the problem, but unfortunately for dashboard it's a beta feature that needs to be enabled by Support: https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/restriction_policy#resource_id

References

No response