Skip to content
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

destory alicloud_ram_group_membership will delete all users in group #7348

Open
lv12312 opened this issue Jun 14, 2024 · 2 comments
Open

destory alicloud_ram_group_membership will delete all users in group #7348

lv12312 opened this issue Jun 14, 2024 · 2 comments

Comments

@lv12312
Copy link

lv12312 commented Jun 14, 2024

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v1.8.5
terraform-provider-alicloud v1.224

Affected Resource(s)

  • alicloud_ram_group_membership

Terraform Configuration Files

# Create a new RAM user.
resource "alicloud_ram_user" "user" {
  name         = var.name
  display_name = var.name
  comments     = "user"
}
resource "alicloud_ram_group_membership" "membership" {
  group_name = data.alicloud_ram_groups.groups_ds.groups.0.name
  user_names = [alicloud_ram_user.user.name]
}
data "alicloud_ram_groups" "groups_ds" {
  name_regex = var.group_name
}

Expected Behavior

Ther user_group already have another users. After terraform apply the user mentioned above will add to this group.
When I run terrform destory after terraform apply. The user will remove from this group.

Actual Behavior

All users in this group are destoryed. It's a dangerous operation.

@ygxxii
Copy link

ygxxii commented Jun 18, 2024

Issue met using:

  • Terraform v1.8.5
  • terraform-provider-alicloud v1.225.0

After running terraform destroy, all members in this group is deleted (include members not added by this alicloud_ram_group_membership).

@ChenHanZhang
Copy link
Collaborator

We have identified the problem, and all users under the user group will be read in the current implementation of this resource, so when deleted, all users under the user group will be removed.
Since modifying the implementation of this resource may cause incompatible changes, we are evaluating the fix and will reply to the specific schedule later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants