terraform-provider-slack
terraform-provider-slack copied to clipboard
Resource: slack_conversation_member
Current situation / problem
- We can add members to
slack_usergroup_members
, and then we can setDefault 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
- Later, when we want to move teams to different conversations, we can't - if we update
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.
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.
.