/terraform-aws-ecs-events-to-slack

Rules for Amazon EventBridge that fetch ECS events and send that events to Slack

Primary LanguagePythonApache License 2.0Apache-2.0

FivexL

terraform-aws-ecs-events-to-slack

Rules for Amazon EventBridge that fetch ECS events and send them to Slack

Example

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

You can find more examples in the examples/ directory

Info

AWS Terraform provier versions

  • version 0.1.2 is the last version that works with both Terraform AWS provider v3 and v4. There are no plans to update 0.1.X branch.
  • all versions later (0.2.0 and above) require Terraform AWS provider v4 as a baseline

Requirements

Name Version
terraform >= 0.13.1
aws >= 3.69

Providers

Name Version
aws 4.25.0

Modules

Name Source Version
slack_notifications terraform-aws-modules/lambda/aws 3.2.0

Resources

Name Type
aws_cloudwatch_event_rule.this resource
aws_cloudwatch_event_target.this resource

Inputs

Name Description Type Default Required
custom_event_rules A map of objects representing the custom EventBridge rule which will be created in addition to the default rules. any {} no
ecs_deployment_state_event_rule_detail The content of the detail section in the EvenBridge Rule for ECS Deployment State Change events. Use it to filter the events which will be processed and sent to Slack. any
{
"eventType": [
"ERROR"
]
}
no
ecs_service_action_event_rule_detail The content of the detail section in the EvenBridge Rule for ECS Service Action events. Use it to filter the events which will be processed and sent to Slack. any
{
"eventType": [
"WARN",
"ERROR"
]
}
no
ecs_task_state_event_rule_detail The content of the detail section in the EvenBridge Rule for ECS Task State Change events. Use it to filter the events which will be processed and sent to Slack. any
{
"lastStatus": [
"STOPPED"
],
"stoppedReason": [
{
"anything-but": {
"prefix": "Scaling activity initiated by (deployment ecs-svc/"
}
}
]
}
no
enable_ecs_deployment_state_event_rule The boolean flag enabling the EvenBridge Rule for ECS Deployment State Change events. The detail section of this rule is configured with ecs_deployment_state_event_rule_detail variable. bool true no
enable_ecs_service_action_event_rule The boolean flag enabling the EvenBridge Rule for ECS Service Action events. The detail section of this rule is configured with ecs_service_action_event_rule_detail variable. bool true no
enable_ecs_task_state_event_rule The boolean flag enabling the EvenBridge Rule for ECS Task State Change events. The detail section of this rule is configured with ecs_task_state_event_rule_detail variable. bool true no
name The string which will be used for the name of AWS Lambda function and other creaated resources string n/a yes
role_name The string which will be used for the name of Lambda IAM role string null no
slack_webhook_url Slack incoming webhook URL string n/a yes
tags A map of tags to add to all resources map(string) {} no

Outputs

No outputs.