Skip to content

Commit

Permalink
feat(envoy): add dependsOn on logging side car if present
Browse files Browse the repository at this point in the history
  • Loading branch information
saefty committed Jan 11, 2024
1 parent d671915 commit a79a67d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions envoy.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
locals {
// optional envoy container for AWS AppMesh
envoy_container_defaults = {
dependsOn = var.firelens.enabled ? [{ containerName = var.firelens.container_name, condition = "HEALTHY" }] : []
name = var.app_mesh.container_name
image = "${data.aws_caller_identity.current.account_id}.dkr.ecr.${data.aws_region.current.name}.amazonaws.com/ecr-public/appmesh/aws-appmesh-envoy:v1.24.0.0-prod"
essential = true
Expand Down
14 changes: 13 additions & 1 deletion fluentbit.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
// optional FluentBit container for log aggregation
fluentbit_container_defaults = {
name = "fluentbit"
name = var.firelens.container_name
image = "${data.aws_caller_identity.current.account_id}.dkr.ecr.${data.aws_region.current.name}.amazonaws.com/ecr-public/aws-observability/aws-for-fluent-bit:2.29.0"
essential = true
mountPoints = []
Expand All @@ -15,6 +15,18 @@ locals {
{ name = " FLB_LOG_LEVEL", value = "error" }
],

healthCheck = {
retries = 3
command = [
"CMD-SHELL",
"curl -s http://localhost:2020/api/v1/uptime | grep uptime_hr | grep -q running"
]
timeout = 2
interval = 5
startPeriod = 10
}


firelensConfiguration = {
type = "fluentbit"
options = {
Expand Down
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ variable "firelens" {
description = "Configuration for optional custom log routing using FireLens over fluentbit sidecar."
default = {}
type = object({
container_name = optional(string, "fluentbit")
container_definition = optional(any, {})
enabled = optional(bool, false)
opensearch_host = optional(string, "")
Expand Down

0 comments on commit a79a67d

Please sign in to comment.