Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 91 additions & 40 deletions README.md

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions amazon_q.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module "chatbot_role" {
source = "./modules/iam"
}

module "chatbot_slack_workspace" {
count = length(var.slack_config) > 0 ? 1 : 0
source = "./modules/slack_workspace"

workspace_id = var.slack_config.workspace_id
default_iam_role_arn = module.chatbot_role.iam_role_arn

channels_config = {
prod = {
slack_channel_id = var.slack_config.channel_id
sns_topic_arns = [aws_sns_topic.prod_chatbot.arn]
}
}
}

#Testing is required for this module

module "chatbot_team_workspace" {
count = length(var.teams_config) > 0 ? 1 : 0
source = "./modules/team_workspace"

teams_tenant_id = var.teams_config.teams_tenant_id
default_iam_role_arn = module.chatbot_role.iam_role_arn

channels_config = {
prod = {
teams_channel_id = var.teams_config.channel_id
team_id = var.teams_config.team_id
sns_topic_arns = [aws_sns_topic.prod_chatbot.arn]
}
}
}
#Testing is required for this module
27 changes: 27 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# AWS Provider Configuration
provider "aws" {
region = "us-east-1"
}

module "ecs_to_slack" {
source = "../terraform-aws-ecs-events-to-slack"
name = "amazon_q_notifications"

# Enable ECS task state change events
enable_ecs_task_state_event_rule = true
ecs_task_state_event_rule_detail = {
clusterArn = ["arn:aws:ecs:us-east-1:123333333333:cluster/your-cluster-name"]
}
slack_config = {
channel_id = "1234567890" # Your Slack workspace ID
workspace_id = "1234567890" # Your Slack channel ID
}
# teams_config = {
# team_id = "1234567890" # Your Teams id ID
# channel_id = "1234567890" # Your Teams channel ID
# teams_tenant_id = "1234567890" # Your Teams tenant ID
# }
}



27 changes: 23 additions & 4 deletions examples/complex/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ data "aws_ecs_cluster" "this" {
}

module "ecs_to_slack" {
source = "../../"
name = "ecs-to-slack"
slack_webhook_url = "https://hooks.slack.com/YOUR-WEBHOOK-ID"
source = "../terraform-aws-ecs-events-to-slack"
name = "amazon_q_notifications"


# Process events "ECS Task State Change"
# Find more infro here https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns-content-based-filtering.html
Expand Down Expand Up @@ -52,17 +52,36 @@ module "ecs_to_slack" {
}
}
}
slack_config = {
channel_id = "1234567890" # Your Slack workspace ID
workspace_id = "1234567890" # Your Slack channel ID
}
#Testing is required for teams
# teams_config = {
# team_id = "1234567890" # Your Teams id ID
# channel_id = "1234567890" # Your Teams channel ID
# teams_tenant_id = "1234567890" # Your Teams tenant ID
# }
}
}


module "ecs_to_slack_no_jenkins" {
source = "../../"
name = "ecs-to-slack"
slack_webhook_url = "https://hooks.slack.com/YOUR-WEBHOOK-ID"


ecs_task_state_event_rule_detail = {
lastStatus = ["STOPPED"]
stoppedReason = [{ "anything-but" = "Stopped by Jenkins Amazon ECS PlugIn" }] # filter out jenkins ecs plugin events
}
slack_config = {
channel_id = "1234567890" # Your Slack workspace ID
workspace_id = "1234567890" # Your Slack channel ID
}
# teams_config = {
# team_id = "1234567890" # Your Teams id ID
# channel_id = "1234567890" # Your Teams channel ID
# teams_tenant_id = "1234567890" # Your Teams tenant ID
# }
}
16 changes: 13 additions & 3 deletions examples/container-instance-state/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ data "aws_ecs_cluster" "this" {
}

module "ecs_to_slack" {
source = "../../"
name = "ecs-to-slack"
slack_webhook_url = "https://hooks.slack.com/YOUR-WEBHOOK-ID"
source = "../terraform-aws-ecs-events-to-slack"
name = "amazon_q_notifications"


# Do not create any built-in rule
ecs_task_state_event_rule_detail = {}
Expand All @@ -26,5 +26,15 @@ module "ecs_to_slack" {
status = [{ "anything-but" = "ACTIVE" }] # except events with status = ACTIVE
}
}
slack_config = {
channel_id = "1234567890" # Your Slack workspace ID
workspace_id = "1234567890" # Your Slack channel ID
}
#Testing is required for teams
# teams_config = {
# team_id = "1234567890" # Your Teams id ID
# channel_id = "1234567890" # Your Teams channel ID
# teams_tenant_id = "1234567890" # Your Teams tenant ID
# }
}
}
15 changes: 0 additions & 15 deletions examples/simple-secretsmanager/main.tf

This file was deleted.

17 changes: 0 additions & 17 deletions examples/simple-ssm_parameter/main.tf

This file was deleted.

11 changes: 0 additions & 11 deletions examples/simple/main.tf

This file was deleted.

Loading