-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add platform_group_members resource #187
Conversation
Mark 'members' attribute to be deprecated
@alexhung Are there any plans on allowing an import of theses members? When I add a member in Artifactory, it is not shown as diff in the terraform state. |
@bakito Changes from Artifactory should reflect in Terraform state. I'll take a look. |
@bakito I add an user, a group, and a group-membership resource to my local dev Artifactory: alexh@alexh-mac terraform-provider-platform % terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# artifactory_managed_user.test-user will be created
+ resource "artifactory_managed_user" "test-user" {
+ admin = false
+ disable_ui_access = true
+ email = "[email protected]"
+ groups = (known after apply)
+ id = (known after apply)
+ internal_password_disabled = false
+ name = "test"
+ password = (sensitive value)
+ profile_updatable = true
}
# platform_group.test-group will be created
+ resource "platform_group" "test-group" {
+ admin_privileges = false
+ auto_join = true
+ description = "Test group"
+ name = "test-group"
+ realm = (known after apply)
+ realm_attributes = (known after apply)
+ use_group_members_resource = true
}
# platform_group_members.test-group will be created
+ resource "platform_group_members" "test-group" {
+ members = [
+ "admin",
+ "anonymous",
+ "test",
]
+ name = "test-group"
}
Plan: 3 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
platform_group.test-group: Creating...
artifactory_managed_user.test-user: Creating...
platform_group.test-group: Creation complete after 3s [name=test-group]
artifactory_managed_user.test-user: Creation complete after 2s [id=test]
platform_group_members.test-group: Creating...
platform_group_members.test-group: Creation complete after 1s [name=test-group]
Apply complete! Resources: 3 added, 0 changed, 0 destroyed. Then I logged into Artifactory and manually removed the alexh@alexh-mac terraform-provider-platform % terraform plan
platform_group.test-group: Refreshing state... [name=test-group]
artifactory_managed_user.test-user: Refreshing state... [id=test]
platform_group_members.test-group: Refreshing state... [name=test-group]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# platform_group_members.test-group will be updated in-place
~ resource "platform_group_members" "test-group" {
~ members = [
+ "anonymous",
# (2 unchanged elements hidden)
]
name = "test-group"
}
Plan: 0 to add, 1 to change, 0 to destroy.
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now. Are you not seeing this plan update? |
@alexhung Thank you for the quick reply. I tried the same again today, and everything works perfect. |
@bakito No problem! Glad it is working for you now. |
This allows independent management of users in group.
Add
use_group_members_resource
attribute toplatform_group
resource to control ifmembers
attribute is used.Closes #169