-
Notifications
You must be signed in to change notification settings - Fork 0
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
feature: init version #1
Conversation
send_user_invitation = each.value.send_user_invitation | ||
|
||
lifecycle { | ||
ignore_changes = [name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's include a comment on why we lifecycle ignore name
. I think it's because it gets sets to the users email or something until they first sign in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any naming modifications in our Clients' Datadog. Also, couldn't find any explanation why it was added initially.
I removed this lifecycle, because we can't explain why this is here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gberenice looking good! Few requests, but overall this was thorough and well done!
main.tf
Outdated
disabled = each.value.disabled | ||
email = each.value.email | ||
name = each.value.name | ||
roles = [data.datadog_role.standard.id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should work to provide some mapping to the other roles as well -- Just including the standard feels like we're not providing a complete module since we know we've used the others elsewhere. Mind adding that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gowiem the reason I didn't add the mapping is that currently we use the following schema for access_roles:
- username: veronika.gnilitska
name: Veronika Gnilitska
...
access_roles:
aws: false
datadog: true
So datadog is just enabled or disabled.
I can update this module to support out-of-the-box roles, something like:
access_roles:
datadog:
enabled: true
role: [standard | ro | admin]
And after that - updated our team.yaml.
How does that sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added support for the out-of-the-box roles. Let me know your thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this access_roles
shouldn't be here at all. I'll push some changes soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gowiem okay, I think I cleaned this out.
I'd love to work on tests and things like that, let's discuss the priority on our next call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sounds good!
examples/complete/example.yaml
Outdated
datadog_api_key: ENC[AES256_GCM,data:joPOPI58VO5E2g==,iv:G3BamrS3ANDMhJqjyZbn1YhAqf2GJ7g7DdVivrYVzDw=,tag:k2sGvVtoxznn7U8x8I7oUw==,type:int] | ||
datadog_app_key: ENC[AES256_GCM,data:GeerHEomnls2Cg==,iv:9uiNp5vvv/8/6sqNix28FRm1btWy6CF3fnGD3RV3oMI=,tag:LbGRJu7Bz8HdJYR+6iO/vQ==,type:int] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you create a test datadog account? Because if so... bravo 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no. We don't have tests yet, so I decided to use a decryptable SOPS file example. SOPS with age
doesn't depend on any cloud resource and is good for these types of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm all for using age
here, makes sense 👍
We should spin up a internal DD org so we can test this module, even if those are tests are manual for now. We could also create some terraform test
blocks as well...
Let's talk about this Thursday.
998e298
to
4f7ce9b
Compare
3e5c7cc
to
8857106
Compare
validation { | ||
condition = alltrue([for role in flatten([for user in var.users : user.roles]) : contains(["standard", "admin", "read_only"], role)]) | ||
error_message = "Each role must be one of 'standard', 'admin', or 'read_only'." | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌 🙌 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome -- well done Veronika! One request and then we'll get it shipped!
for_each = local.users | ||
disabled = each.value.disabled | ||
email = each.value.email | ||
name = each.value.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea with lifecycle_ignore on the name was that users can change their name in the console and it causes a recreate or drift in the resource. We shouldn't care about how they want to spell their names or how they change them so we lifecycle ignored it... I'm thinking we add that back and make that clear via a comment. Sorry to reverse!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay. I've never seen that users actually care about that 😆 , but it's a valid point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. Sorry, this has been a bit hectic 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gberenice hectic? We just very quickly iterated on a bunch of good changes on this PR. This was kinda how I want all PRs to go. Things are going to need to change. We should be bringing up all of our thoughts on what is good practice or what we expect and then having fast feedback loops on iterating on those changes. This was great, hats off to you on doing things quickly and responding correctly to feedback 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gowiem thanks for the great feedback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Info
Datadog Standard Role
and should be extended in the future to handle more cases.