Skip to content

Commit

Permalink
fix: 5809 batch alarm rule names (#374)
Browse files Browse the repository at this point in the history
* fix: batch rule names

* fix: naming and formatting

* docs: update Terraform docs

* fix: add name to targets

* docs: update Terraform docs

* fix: naming syntax

* fix: more event renaming

* docs: update Terraform docs

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Wi11Shell and github-actions[bot] authored Oct 9, 2024
1 parent 58c076c commit 1168502
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion infra/terraform/modules/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
| <a name="module_log_bucket"></a> [log\_bucket](#module\_log\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 4.0 |
| <a name="module_records"></a> [records](#module\_records) | terraform-aws-modules/route53/aws//modules/records | ~> 4.0 |
| <a name="module_route53_records"></a> [route53\_records](#module\_route53\_records) | terraform-aws-modules/acm/aws | ~> 5.0 |
| <a name="module_sns_batch_fail"></a> [sns\_batch\_fail](#module\_sns\_batch\_fail) | terraform-aws-modules/sns/aws | ~> 6.1 |
| <a name="module_sns_batch_failure"></a> [sns\_batch\_failure](#module\_sns\_batch\_failure) | terraform-aws-modules/sns/aws | ~> 6.1 |

## Resources

Expand Down
18 changes: 7 additions & 11 deletions infra/terraform/modules/service/batch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,8 @@ module "eventbridge_sns" {

create_bus = false

role_name = "vol-app-${var.environment}-batch-fail-role"

rules = {
batch-fail-sns = {
name = "${var.environment}-batch-fail-event"
"vol-app-${var.environment}-batch-failure-event" = {
description = "Capture failed Batch Events sent to SNS"
event_pattern = jsonencode({
"source" : ["aws.batch"],
Expand All @@ -189,24 +186,23 @@ module "eventbridge_sns" {
}

targets = {
batch-fail-sns = [
"vol-app-${var.environment}-batch-failure-event" = [
{
name = "batch-fail-event"
arn = module.sns_batch_fail.topic_arn
arn = module.sns_batch_failure.topic_arn
}
]
}

}

module "sns_batch_fail" {
module "sns_batch_failure" {
source = "terraform-aws-modules/sns/aws"
version = "~> 6.1"

name = "vol-app-${var.environment}-batch-fail-topic"
name = "vol-app-${var.environment}-batch-failure-topic"
use_name_prefix = true
display_name = "batch-event-failed"

display_name = "vol-app-${var.environment}-batch-event-failed"

create_topic_policy = true
enable_default_topic_policy = true
Expand Down Expand Up @@ -241,7 +237,7 @@ module "sns_batch_fail" {
}

tags = {
"Name" = "vol-app-${var.environment}-aws-sns-batch-fail"
"Name" = "vol-app-${var.environment}-aws-sns-batch-failure"

}

Expand Down

0 comments on commit 1168502

Please sign in to comment.