There are some pretty big changes for ufo version 4. Here’s what’s new:
- Fuller CLI Toolkit Commands
- Load Balancer Support
- Updated Tutorial Guide
- Security Groups
- Improved Fargate Support
- Extra Env Support
- CloudFormation Implementation
- Upgrade Guide
Fuller CLI Toolkit Commands
Here are a few of the new ufo CLI commands.
ufo ps ufo current ufo releases ufo rollback ufo status ufo stop ufo cancel
The ufo ps command provides a useful summary of the ECS service. Example.
$ ufo ps => Service: demo-web Service name: development-demo-web-Ecs-13D2BFA4ULNC9 Status: ACTIVE Running count: 1 Desired count: 1 Launch type: EC2 Task definition: demo-web:169 Elb: develop-Elb-X92TDVRWRRUR-1002475526.us-east-1.elb.amazonaws.com Elb type: application +----------+------+--------------+------------+---------+-------+ | Id | Name | Release | Started | Status | Notes | +----------+------+--------------+------------+---------+-------+ | 2676b88b | web | demo-web:169 | 2 days ago | RUNNING | | +----------+------+--------------+------------+---------+-------+ $
The ufo current command is one of my favorites as it makes other ufo commands shorter. With
ufo current you can set the current service you are working with, so you don’t have to type it repeatedly.
Check out the CLI reference docs for the full list of commands and more info on each command.
Load Balancer Support
Load balancer support was an impetus for version 4. Previously, you would have to create a load balancer yourself. Now ufo can create the load balancer for you. By default, an ELB is created for ECS services with a container named web. For non-web containers, an ELB is not created.
ufo ship demo-web # by default creates an ELB ufo ship demo-web --elb=false # to disable the ELB creation ufo ship demo-worker # by default does not create an ELB
You can still use existing load balancers if desired. To do that, pass an existing load balancer’s target group arn to ufo as part of the
ufo ship command.
ufo ship demo-web --elb=arn:aws:elasticloadbalancing:us-east-1:123456789:targetgroup/target-name/2378947392743
More info: Load Balancer docs
Updated Tutorial Guide
Ufo creates and sets up security groups with some helpful permissions. The security groups are set up so that ELB managed by ufo has access to talk to the ECS task. You can also specify existing security groups to associate with your ECS task or ELB.
The ufo security groups work in conjunction with awsvpc network mode. If you are using the default bridge network mode, then you are responsible for security group setup instead. This is because in bridge network mode the EC2 instance security group controls access and ufo does not have control that security group.
The awsvpc network mode is the required for Fargate. So in the case of Fargate, ufo can manage these security groups. This makes it even easier to set up Fargate.
The pros and cons with awsvpc vs bridge network mode are discussed here: ECS network mode.
Improved Fargate Support
Though Fargate support was added in version 3 of ufo, it required you to adjust the
.ufo/params.yml file with the proper Fargate settings. In version 4, Fargate usage is inferred from the task definition and the ECS service parameters are automatically adjusted for you. Basically, you have less work to do and only have to get the ECS task definition right. A demo and tutorial of ECS Fargate with ufo is here: Fargate docs
Extra Env Support
There’s a concept of extra environments. You can create additional ECS services or “environments” by setting the
UFO_ENV_EXTRA variable. Example:
UFO_ENV_EXTRA=2 ufo ship demo-web
This allows you to create as many environments as you wish quickly. A more in-depth post is here: How to Create Unlimited Extra Environments
Most of the new resources in ufo like Load Balancers and Security Groups are implemented as a CloudFormation resource in version 4. Here are some thoughts on why this was done: Why CloudFormation. The creation of ECS service is also created as a CloudFormation resource. The CloudFormation resource properties are completely configurable with the cfn settings file.
Because the ECS service is created by CloudFormation in version 4, ufo will deploy an additional ECS service if you already have created an ECS service with ufo version 3. You’ll need to upgrade your existing ECS services by following the upgrade guide: Upgrading to Version 4
Ufo version 4 is much more powerful. Load balancers are no longer required to be manually created. Improved Fargate support makes it simpler to get an application up and running on ECS without having to managed servers. Extra env support is a neat concept that allows you to create more additional environments with virtually no work. This makes it a lot easier to deploy web applications onto ECS with less work. Hope folks enjoy this release. 🎉