Coder Social home page Coder Social logo

Comments (5)

nyanshak avatar nyanshak commented on August 16, 2024

I believe you're actually looking for 'access_role' field (that's what it's called in the Datadog api), but it's unfortunately not yet supported by this provider. Issue #4 is an open feature request to add the behavior you're looking for.

The current 'role' field refers to something different, something akin to "title" (such as "SRE" or "Lead Developer"). Unfortunately, there is a bug with this field referenced here #12, where it's impossible to actually set that role field after creation.

from terraform-provider-datadog.

s4mur4i avatar s4mur4i commented on August 16, 2024

Then there is the second behavior which is strange, why is the read-only user converted back to standard user?
Could it be that: https://docs.datadoghq.com/api/#user-update
if no access_role is defined it reverts back to standard user? which would sound strange to me.

from terraform-provider-datadog.

nyanshak avatar nyanshak commented on August 16, 2024

As far as I can tell, with 0.10.7 terraform, 1.0.0 datadog provider, the provider never specifically sets access_role. The go-datadog-api user struct doesn't even have an access_role field.

Since we're not specifically sending access_role, this should be the equivalent of doing:

user="[email protected]"

curl -X PUT -H "Content-type: application/json" \                               
     -d "{\"email\": \"${user}\", \"name\": \"alt user\"}" \
    "https://app.datadoghq.com/api/v1/user/${user}?api_key=${api_key}&application_key=${app_key}"

I've tested this (on a read-only user), and I still get back a read-only user. I've also tested sending both of these:

"access_role":  "", # empty string
"access_role": null, # explicitly send null

Sending either of those did not result in the role being changed back to 'st' for standard.

from terraform-provider-datadog.

crivetechie avatar crivetechie commented on August 16, 2024

as of go-datadog-api v2.8 the user struct supports the access_role field and the is_admin field has been marked as deprecated. any chance to leverage on this to add feature #4 ?

from terraform-provider-datadog.

masci avatar masci commented on August 16, 2024

The role argument is confusing to say the least, I'm going to close this issue as the provider behaviour is (unfortunately) correct in terms of API calls. Going to schedule work to deprecate role (was removed from datadog docs too) and is_admin in favor of the solutions proposed in #4.

from terraform-provider-datadog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.