Skip to content

Commit aaa9f9c

Browse files
authored
feat: allow for extra_container_definitions (#162)
1 parent 76c90ef commit aaa9f9c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ allow_github_webhooks = true
238238
| ecs\_task\_memory | The amount (in MiB) of memory used by the task | `number` | `512` | no |
239239
| entrypoint | The entry point that is passed to the container | `list(string)` | `null` | no |
240240
| essential | Determines whether all other containers in a task are stopped, if this container fails or stops for any reason. Due to how Terraform type casts booleans in json it is required to double quote this value | `bool` | `true` | no |
241+
| extra\_container\_definitions | A list of valid container definitions provided as a single valid JSON document. These will be provided as supplimentary to the main Atlantis container definition | `list(any)` | `[]` | no |
241242
| firelens\_configuration | The FireLens configuration for the container. This is used to specify and configure a log router for container logs. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FirelensConfiguration.html | <pre>object({<br> type = string<br> options = map(string)<br> })</pre> | `null` | no |
242243
| github\_webhooks\_cidr\_blocks | List of CIDR blocks used by GitHub webhooks | `list(string)` | <pre>[<br> "140.82.112.0/20",<br> "185.199.108.0/22",<br> "192.30.252.0/22"<br>]</pre> | no |
243244
| internal | Whether the load balancer is internal or external | `bool` | `false` | no |

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ locals {
2828
alb_authenication_method = length(keys(var.alb_authenticate_oidc)) > 0 ? "authenticate-oidc" : length(keys(var.alb_authenticate_cognito)) > 0 ? "authenticate-cognito" : "forward"
2929

3030
# Container definitions
31-
container_definitions = var.custom_container_definitions == "" ? var.atlantis_bitbucket_user_token != "" ? module.container_definition_bitbucket.json_map_encoded_list : module.container_definition_github_gitlab.json_map_encoded_list : var.custom_container_definitions
31+
container_definitions = var.custom_container_definitions == "" ? var.atlantis_bitbucket_user_token != "" ? jsonencode(concat([module.container_definition_bitbucket.json_map_object], var.extra_container_definitions)) : jsonencode(concat([module.container_definition_github_gitlab.json_map_object], var.extra_container_definitions)) : var.custom_container_definitions
3232

3333
container_definition_environment = [
3434
{

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ variable "custom_container_definitions" {
293293
default = ""
294294
}
295295

296+
variable "extra_container_definitions" {
297+
description = "A list of valid container definitions provided as a single valid JSON document. These will be provided as supplimentary to the main Atlantis container definition"
298+
type = list(any)
299+
default = []
300+
}
301+
296302
variable "entrypoint" {
297303
description = "The entry point that is passed to the container"
298304
type = list(string)

0 commit comments

Comments
 (0)