Skip to content

ECS Helper in Golang: Managed by opg-org-infra & Terraform

License

Notifications You must be signed in to change notification settings

ministryofjustice/opg-ecs-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opg-ecs-helper

ECS Helper in Golang: Managed by opg-org-infra & Terraform

Function

Stabilizer

Check to make sure that the tasks for the list of ECS Services provided have stabilized after a deployment.

Runner

Run ecs run-tasks from the commandline

Building Locally

go build -mod vendor ./cmd/runner
go build -mod vendor ./cmd/stabilizer

Usage

Stabilizer

You need to provide output containing a list of ECS services you want the stabilizer to check.

output "Role" {
  value = "arn:aws:iam::${local.account.id}:role/${var.default_role}"
}

output "Services" {
  value = {
    Cluster = aws_ecs_cluster.my_cluster.name
    Services = [
      aws_ecs_service.my_cool_service.name
    ]
  }
}

By default it will look for the outputs in terraform.output.json. Running terraform output -json > terraform.output.json will create the file for you.

aws-vault exec identity -- ecs-stabilizer

Runner

You need to provide a output of the tasks you want to be able to run using the runner tool:

output "Role" {
  value = "arn:aws:iam::${local.account.id}:role/${var.default_role}"
}

output "Task" {
  value = {
    Cluster    = var.cluster_name
    LaunchType = "FARGATE"
    NetworkConfiguration = {
      AwsvpcConfiguration = {
        SecurityGroups = [var.security_group_id]
        Subnets        = var.subnet_ids
      }
    }
    TaskDefinition = aws_ecs_task_definition.task.arn
  }
}

By default it will look for the outputs in terraform.output.json. Running terraform output -json > terraform.output.json will create the file for you.

aws-vault exec identity -- ecs-runner -task <task_name>

About

ECS Helper in Golang: Managed by opg-org-infra & Terraform

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages