Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bors): add health check #559

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Conversation

marcoieni
Copy link
Member

Plan on staging:

Terraform will perform the following actions:
   # aws_ecs_service.bors will be updated in-place
   ~ resource "aws_ecs_service" "bors" {
         id                                 = "arn:aws:ecs:us-east-2:392478027976:service/bors/bors"
         name                               = "bors"
         tags                               = {}
       ~ task_definition                    = "arn:aws:ecs:us-east-2:392478027976:task-definition/bors:11" -> (known after apply)
         # (15 unchanged attributes hidden)
         # (4 unchanged blocks hidden)
     }
   # aws_ecs_task_definition.bors must be replaced
 -/+ resource "aws_ecs_task_definition" "bors" {
       ~ arn                      = "arn:aws:ecs:us-east-2:392478027976:task-definition/bors:11" -> (known after apply)
       ~ arn_without_revision     = "arn:aws:ecs:us-east-2:392478027976:task-definition/bors" -> (known after apply)
       ~ container_definitions    = jsonencode(
           ~ [
               ~ {
                   - Command                = null
                   - Cpu                    = 0
                   - CredentialSpecs        = null
                   - DependsOn              = null
                   - DisableNetworking      = null
                   - DnsSearchDomains       = null
                   - DnsServers             = null
                   - DockerLabels           = null
                   - DockerSecurityOptions  = null
                   - EntryPoint             = null
                   - Environment            = [
                       - {
                           - Name  = "APP_ID"
                           - Value = "343095"
                         },
                       - {
                           - Name  = "CMD_PREFIX"
                           - Value = "@bors2"
                         },
                       - {
                           - Name  = "RUST_LOG"
                           - Value = "bors=debug"
                         },
                     ]
                   - EnvironmentFiles       = null
                   - Essential              = true
                   - ExtraHosts             = null
                   - FirelensConfiguration  = null
                   - HealthCheck            = null
                   - Hostname               = null
                   - Image                  = "392478027976.dkr.ecr.us-east-2.amazonaws.com/bors"
                   - Interactive            = null
                   - Links                  = null
                   - LinuxParameters        = null
                   - LogConfiguration       = {
                       - LogDriver     = "awslogs"
                       - Options       = {
                           - awslogs-group         = "bors"
                           - awslogs-region        = "us-east-2"
                           - awslogs-stream-prefix = "bors"
                         }
                       - SecretOptions = null
                     }
                   - Memory                 = null
                   - MemoryReservation      = null
                   - MountPoints            = []
                   - Name                   = "bors"
                   - PortMappings           = [
                       - {
                           - AppProtocol        = ""
                           - ContainerPort      = 8080
                           - ContainerPortRange = null
                           - HostPort           = 8080
                           - Name               = null
                           - Protocol           = "tcp"
                         },
                     ]
                   - Privileged             = null
                   - PseudoTerminal         = null
                   - ReadonlyRootFilesystem = null
                   - RepositoryCredentials  = null
                   - ResourceRequirements   = null
                   - Secrets                = [
                       - {
                           - Name      = "DATABASE_URL"
                           - ValueFrom = "arn:aws:ssm:us-east-2:392478027976:parameter/bors/db-endpoint"
                         },
                       - {
                           - Name      = "PRIVATE_KEY"
                           - ValueFrom = "arn:aws:ssm:us-east-2:392478027976:parameter/bors/app-private-key"
                         },
                       - {
                           - Name      = "WEBHOOK_SECRET"
                           - ValueFrom = "arn:aws:ssm:us-east-2:392478027976:parameter/bors/webhook-secret"
                         },
                     ]
                   - StartTimeout           = null
                   - StopTimeout            = null
                   - SystemControls         = []
                   - Ulimits                = null
                   - User                   = null
                   - VolumesFrom            = []
                   - WorkingDirectory       = null
                   + environment            = [
                       + {
                           + name  = "APP_ID"
                           + value = "343095"
                         },
                       + {
                           + name  = "CMD_PREFIX"
                           + value = "@bors2"
                         },
                       + {
                           + name  = "RUST_LOG"
                           + value = "bors=debug"
                         },
                     ]
                   + essential              = true
                   + healthCheck            = {
                       + command     = [
                           + "CMD-SHELL",
                           + "curl -f http://localhost/health || exit 1",
                         ]
                       + startPeriod = 10
                       + timeout     = 10
                     }
                   + image                  = "392478027976.dkr.ecr.us-east-2.amazonaws.com/bors"
                   + logConfiguration       = {
                       + logDriver = "awslogs"
                       + options   = {
                           + awslogs-group         = "bors"
                           + awslogs-region        = "us-east-2"
                           + awslogs-stream-prefix = "bors"
                         }
                     }
                   + name                   = "bors"
                   + portMappings           = [
                       + {
                           + containerPort = 8080
                           + hostPort      = 8080
                           + protocol      = "tcp"
                         },
                     ]
                   + secrets                = [
                       + {
                           + name      = "DATABASE_URL"
                           + valueFrom = "arn:aws:ssm:us-east-2:392478027976:parameter/bors/db-endpoint"
                         },
                       + {
                           + name      = "PRIVATE_KEY"
                           + valueFrom = "arn:aws:ssm:us-east-2:392478027976:parameter/bors/app-private-key"
                         },
                       + {
                           + name      = "WEBHOOK_SECRET"
                           + valueFrom = "arn:aws:ssm:us-east-2:392478027976:parameter/bors/webhook-secret"
                         },
                     ]
                 },
             ] # forces replacement
         )
       ~ id                       = "bors" -> (known after apply)
       ~ revision                 = 11 -> (known after apply)
       - tags                     = {} -> null
       ~ tags_all                 = {} -> (known after apply)
         # (9 unchanged attributes hidden)
     }
 Plan: 1 to add, 1 to change, 1 to destroy.

@marcoieni marcoieni force-pushed the feat-bors-add-health-check branch from 2ac63fa to 5dd7714 Compare September 4, 2024 08:00
@marcoieni
Copy link
Member Author

it works 🎉

image

@marcoieni marcoieni merged commit 626c704 into master Sep 4, 2024
3 checks passed
@marcoieni marcoieni deleted the feat-bors-add-health-check branch September 4, 2024 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant