montblu / terraform-octopusdeploy-bootstrap

Simple Terraform module used to manage a Octopus instance
https://registry.terraform.io/modules/montblu/bootstrap/octopusdeploy/latest
GNU General Public License v3.0
0 stars 0 forks source link

include slack resources creation #57

Open tcarrondo opened 3 days ago

tcarrondo commented 3 days ago

octopusdeploy_team.slack octopusdeploy_user.slack octopusdeploy_user_role.slack

and document Slack step template install and API key needed

pessoa commented 1 day ago

Let's not call it "Slack connection" since it's used to access Octopus to pull the template json.

DFurt commented 1 day ago

currently used configuration with ActionTemplateView permission

resource "octopusdeploy_user" "slack" {
  count = var.environment == "staging" ? 1 : 0

  display_name = "${local.octopus_prefix} - Slack connection"
  username     = "slack"
  is_active    = true
  is_service   = true
}

resource "octopusdeploy_user_role" "slack" {
  count                     = var.environment == "staging" ? 1 : 0
  can_be_deleted            = true
  description               = "Responsible for slack communications."
  granted_space_permissions = ["ActionTemplateView"]
  name                      = "Slack Communication"
}

resource "octopusdeploy_team" "slack" {
  count = var.environment == "staging" ? 1 : 0

  name = "${local.octopus_prefix} - Slack connection"
  user_role {
    space_id     = module.octopus_inception.octopus_space_id
    user_role_id = octopusdeploy_user_role.slack[0].id
  }
  users = [
    octopusdeploy_user.slack[0].id
  ]
}