terraform-provider-slack icon indicating copy to clipboard operation
terraform-provider-slack copied to clipboard

Resource: slack_conversation_member

Open rdsubhas opened this issue 4 years ago • 1 comments

Current situation / problem

  • We can add members to slack_usergroup_members, and then we can set Default channels for a usergroup
  • But this is unfortunately a problem, because it's a one-time operation. First time, when a user is added to a usergroup, they get added to the "default" channels of the usergroup.
    • Later, when we want to move teams to different conversations, we can't - if we update channels for a usergroup later – it does not change existing memberships
    • If we remove users from a usergroup, it does not remove them from existing channels

Fix / Proposal

  • New resource: slack_conversation_member – Manage a user being present or not in a conversation/channel
  • Create: conversations.invite
  • Delete: conversations.kick
  • Update: Do nothing, let terraform delete & create
  • Read: conversations.members (tier4 API call, no need to cache right now but we can do it later if needed)

By managing each membership, we can individually add/remove users from conversations live.

rdsubhas avatar May 11 '20 12:05 rdsubhas

But this is unfortunately a problem, because it's a one-time operation.

That's why I haven't supported this resource yet. ignore_changes must be used properly to manage such resources, I guess.

Update: Do nothing, let terraform delete & create

I think doing NOTHING is better. delete and create may generate many messages like someone left. bot invite someone..

jmatsu avatar May 12 '20 00:05 jmatsu