-
Notifications
You must be signed in to change notification settings - Fork 301
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
azuread_group - support for the owners
property
#62
Conversation
Related: #36 |
@katbyte, @tombuildsstuff, do you guys have any ideas how we could tackle the issue of the 'not deletable' (see known issues above) group owners? BTW you have the same behaviour in the Azure Portal.
Should we leave this up to the User? |
Would it be an option to not implement it as a separate resource but instead integrate it into the group resource? There you could always pass the full list of owners in and not allow the list to be empty. |
@twendt, I think this is the right way to do it. I'm going to look into it. |
There are reasons to have it as a separate resource (you can separate out creating & managing the owners) & within the resource (central location, ability to explicitly define who the owners should be) And as such we should support both. as to the issue of not being able to remove the last user, I say we fail destruction/update and leave that up to the user as theres not much we can do about it. |
I will look into this in the next days. |
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.
Thanks for the new resource @tiwood,
Aside from a few minor comments i've left inline this is looking pretty good! As with the group_user resource i would like to release with support to set this in the adgroup resource aswell. let me know if that is to big of an ask and i'll look into adding that myself 🙂
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.
Hope yo don't mind but i've pushed the required changes to this branch to get it good to merge 🙂 LGTM now 👍
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.
LGTM with some minor spelling
azuread/resource_group.go
Outdated
@@ -83,11 +93,22 @@ func resourceGroupCreate(d *schema.ResourceData, meta interface{}) error { | |||
if v, ok := d.GetOk("members"); ok { | |||
members := tf.ExpandStringSlicePtr(v.(*schema.Set).List()) | |||
|
|||
// we could lock here against the group ember resource, but the should not be used together (todo conflicts with at a resource level?) |
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 could lock here against the group ember resource, but the should not be used together (todo conflicts with at a resource level?) | |
// we could lock here against the group member resource, but they should not be used together (todo conflicts with at a resource level?) |
azuread/resource_group.go
Outdated
if v, ok := d.GetOk("owners"); ok { | ||
members := tf.ExpandStringSlicePtr(v.(*schema.Set).List()) | ||
|
||
// we could lock here against the group owner resource, but the should not be used together (todo conflicts with at a resource level?) |
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 could lock here against the group owner resource, but the should not be used together (todo conflicts with at a resource level?) | |
// we could lock here against the group owner resource, but they should not be used together (todo conflicts with at a resource level?) |
owners
property
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
(1/2 of #36)
This adds a new resource to manage Azure AD Group Owners with Terraform.
Additionally this adds support for
owners
in the resource azuread_group.owners
is not set, it should leave existing owners as is.Example Usage
Example for azuread_group
Argument Reference
The following arguments are supported:
group_object_id
- (Required) The object id of the Azure AD Group where the Owner should be added.owner_object_id
- (Required) The object id of the Azure AD User you want to add as Owner.Caveats
Azure requires at least one owner per Azure AD group. That means the destruction of 'azuread_group_owner' resources will fail if no additional owner is present on the group.