diff --git a/infra/terraform/modules/service/README.md b/infra/terraform/modules/service/README.md index 55aee575be..e55899ea79 100644 --- a/infra/terraform/modules/service/README.md +++ b/infra/terraform/modules/service/README.md @@ -47,12 +47,12 @@ | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [assets\_version](#input\_assets\_version) | The version of the assets | `string` | n/a | yes | -| [batch](#input\_batch) | Configuration for the batch process |
object({
version = string
repository = string
subnet_ids = list(string)
task_iam_role_statements = list(object({
effect = string
actions = list(string)
resources = list(string)
}))
jobs = list(object({
name = string
commands = list(string)
cpu = optional(number, 1)
memory = optional(number, 2048)
timeout = optional(number, 300)
schedule = optional(string, "")
}))
})
| n/a | yes | +| [batch](#input\_batch) | Configuration for the batch process |
object({
version = string
repository = string
subnet_ids = list(string)
task_iam_role_statements = list(object({
effect = string
actions = list(string)
resources = list(string)
}))
jobs = list(object({
name = string
commands = list(string)
cpu = optional(number, 1)
memory = optional(number, 2048)
timeout = optional(number, 300)
schedule = optional(string, "")
}))
})
| n/a | yes | | [domain\_name](#input\_domain\_name) | The domain name for the environment | `string` | n/a | yes | | [elasticache\_url](#input\_elasticache\_url) | The URL of the Elasticache cluster | `string` | n/a | yes | | [environment](#input\_environment) | The environment to deploy to | `string` | n/a | yes | | [legacy\_environment](#input\_legacy\_environment) | The legacy environment to deploy use | `string` | n/a | yes | -| [services](#input\_services) | The services to deploy |
map(object({
version = string
repository = string
cpu = number
memory = number
task_iam_role_statements = list(object({
effect = string
actions = list(string)
resources = list(string)
}))
add_cdn_url_to_env = optional(bool, false)
lb_listener_arn = string
// The reason for this was to enable the parallel running of ECS and EC2 services.
// This boolean will control the flow of traffic. If `true`, traffic will go to ECS. If `false`, traffic will go to EC2.
// Can be removed when EC2 services are removed.
listener_rule_enable = optional(bool, true)
listener_rule_priority = optional(number, 10)
listener_rule_host_header = optional(string, "*")
security_group_ids = list(string)
subnet_ids = list(string)
vpc_id = optional(string, null)
}))
| `{}` | no | +| [services](#input\_services) | The services to deploy |
map(object({
version = string
repository = string
cpu = number
memory = number
task_iam_role_statements = list(object({
effect = string
actions = list(string)
resources = list(string)
}))
add_cdn_url_to_env = optional(bool, false)
lb_listener_arn = string
// The reason for this was to enable the parallel running of ECS and EC2 services.
// This boolean will control the flow of traffic. If `true`, traffic will go to ECS. If `false`, traffic will go to EC2.
// Can be removed when EC2 services are removed.
listener_rule_enable = optional(bool, true)
listener_rule_priority = optional(number, 10)
listener_rule_host_header = optional(string, "*")
security_group_ids = list(string)
subnet_ids = list(string)
vpc_id = optional(string, null)
}))
| `{}` | no | | [vpc\_id](#input\_vpc\_id) | The VPC ID | `string` | n/a | yes | ## Outputs diff --git a/infra/terraform/modules/service/batch.tf b/infra/terraform/modules/service/batch.tf index 7b9394bd9a..c48ee12243 100644 --- a/infra/terraform/modules/service/batch.tf +++ b/infra/terraform/modules/service/batch.tf @@ -166,23 +166,22 @@ module "eventbridge_sns" { create_bus = false - role_name = "batch-fail-role" + role_name = "vol-app-${var.environment}-batch-fail-role" rules = { batch-fail-sns = { name = "${var.environment}-batch-fail-event" description = "Capture failed Batch Events sent to SNS" event_pattern = jsonencode({ - "detail-type" : [ - "Batch Job State Change" - ], - "source" : [ - "aws.batch" - ], + "source" : ["aws.batch"], + "detail-type" : ["Batch Job State Change"], "detail" : { "status" : [ "FAILED" - ] + ], + "jobName" : [{ + "wildcard" : "vol-app-${var.environment}-*" + }] } }) enabled = true @@ -204,7 +203,7 @@ module "sns_batch_fail" { source = "terraform-aws-modules/sns/aws" version = "~> 6.1" - name = "${var.environment}-batch-fail-topic" + name = "vol-app-${var.environment}-batch-fail-topic" use_name_prefix = true display_name = "batch-event-failed" @@ -242,7 +241,7 @@ module "sns_batch_fail" { } tags = { - "Name" = "${var.environment}-aws-sns-batch-fail" + "Name" = "vol-app-${var.environment}-aws-sns-batch-fail" }