question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nice to be able to deploy multiple containers via LoadBalancedFargateService

See original GitHub issue
  • I’m submitting a …

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior? If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

You can deploy only one docker image when you are using ecsPatterns.LoadBalancedFargateService

  • What is the expected behavior (or behavior of feature suggested)?

It’ll be nice to be able to deploy multiple images (a la docker-compose) within a service.

ESC-CLI, for example, currently provides a way to include multiple container images through a docker-compose file.

  • What is the motivation / use case for changing the behavior or adding this feature?

Make the API, LoadBalancedFargateService, more useful.

  • Please tell us about your environment:

    • CDK CLI Version: 1.4.0 (build 175471f)
    • Module Version: 1.4.0
    • OS: OSX Mojave
    • Language: TypeScript
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

  • https://github.com/aws/amazon-ecs-cli

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
piradeepkcommented, Aug 16, 2019

@realharry you can actually add multiple containers after constructing the LoadBalancedFargateService by using the addContainer method within a taskDefinition.

It would look something like:

const fargateService = new LoadBalancedFargateService(...)
fargateService.service.taskDefinition.addContainer(containerName, {
    image: new ecs.AssetImage(path.join(__dirname, '..', 'demo-image'))
})

The LoadBalancedFargateService exposes the FargateService (service), and the FargateService (service) exposes the FargateTaskDefinition(taskDefinition) which allow you to add a container to a Task Definition.

Feel free to let me know if you have any issues with the above.

0reactions
jgouxcommented, Feb 26, 2021

Hello @piradeepk and thanks for the addContainer tip.

Initially I wanted to use a docker-compose.yaml containing two services. I use depends_on and service_healthy to start one service only when the other is up. Seems like your solution doesn’t cover such use case.

Also, only one of the two services needs to be exposed to the ALB.

Can the current API handle my use case?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Task Networking in AWS Fargate | AWS Compute Blog
A better approach would be to deploy the two containers as two different services, each with its own load balancer. This allows clients...
Read more >
Deploying multi container to Fargate Cluster | DevOps Training
This video covers, how to create ECS fargate cluster and setup multi container applications using service discovery, it also covers how to ...
Read more >
How to Setup AWS ECS Fargate with a Load Balancer
This is a step by step tutorial where I show you how to set up a basic Python based AWS Fargate App within...
Read more >
Running Containers on AWS using Amazon ECS and AWS ...
EC2 or AWS Fargate? There are two major models for how to run your containers on AWS: EC2 (Deploy and manage your cluster...
Read more >
How to Deploy an Application to AWS Fargate | by Agus Richard
Following a step by step process of deploying an application to AWS Fargate with Elastic Container Service and Application Load Balancer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found