ufo 4.2.0 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +9 -9
- data/README.md +3 -3
- data/docs/_config.yml +4 -4
- data/docs/_docs/aws-ecs-task-execution-role.md +28 -0
- data/docs/_docs/conventions.md +1 -1
- data/docs/_docs/faq.md +1 -1
- data/docs/_docs/fargate.md +1 -103
- data/docs/_docs/install.md +1 -1
- data/docs/_docs/quick-start-ec2.md +84 -0
- data/docs/_docs/ssl-support.md +2 -22
- data/docs/_docs/ufo-env.md +1 -1
- data/docs/_includes/content.html +1 -1
- data/docs/_includes/css/main.css +12 -11
- data/docs/_includes/css/syntax.css +5 -0
- data/docs/_includes/css/ufo.css +38 -15
- data/docs/_includes/repo_push_access.md +11 -0
- data/docs/_includes/subnav.html +2 -2
- data/docs/_includes/summary.html +2 -1
- data/docs/_reference/ufo-init.md +1 -1
- data/docs/bin/web +1 -1
- data/docs/docs.md +13 -0
- data/docs/quick-start.md +111 -69
- data/lib/template/.ufo/settings/cfn/default.yml.tt +12 -11
- data/lib/template/.ufo/templates/main.json.erb +1 -1
- data/lib/ufo/help/init.md +1 -1
- data/lib/ufo/stack/context.rb +6 -4
- data/lib/ufo/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a18cfeb62cd6924458083a9bd9726f03fc74cf38e5e9e75e1bcc0987a2cce0bf
|
4
|
+
data.tar.gz: ddcaad850b0446346e103facef3616cb9e647682b4d45cf9b51021a2159b1e37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d248be6a98f50af4f848e8a20da96f8a47e27a9e340276844c4ab41146aa42daead39b587026aa73fdf50c822f8b29b75fdeecc27ce41ca334a7bc7b6c20d099
|
7
|
+
data.tar.gz: 427d5cc7887712b84cf1e07ec3ea8cd599f9b8963f0f1ea47d03a7c900a96ea8e10b4a9ba65a4636f73f3e74293b79648f43f29f554547346222b7c2d23ace40
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [4.3.0]
|
7
|
+
- Default starter ecs ec2 template to networkMode awsvpc
|
8
|
+
|
9
|
+
## [4.2.1]
|
10
|
+
- #69 from tls support for network elb
|
11
|
+
|
6
12
|
## [4.2.0]
|
7
13
|
- dont stop tasks on very first deploy, removes edge case error
|
8
14
|
- update docs: redirection support
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ufo (4.2.
|
4
|
+
ufo (4.2.1)
|
5
5
|
aws-sdk-cloudformation
|
6
6
|
aws-sdk-cloudwatchlogs
|
7
7
|
aws-sdk-ec2
|
@@ -25,32 +25,32 @@ GEM
|
|
25
25
|
minitest (~> 5.1)
|
26
26
|
tzinfo (~> 1.1)
|
27
27
|
aws-eventstream (1.0.1)
|
28
|
-
aws-partitions (1.
|
28
|
+
aws-partitions (1.141.0)
|
29
29
|
aws-sdk-cloudformation (1.14.0)
|
30
30
|
aws-sdk-core (~> 3, >= 3.39.0)
|
31
31
|
aws-sigv4 (~> 1.0)
|
32
32
|
aws-sdk-cloudwatchlogs (1.13.0)
|
33
33
|
aws-sdk-core (~> 3, >= 3.39.0)
|
34
34
|
aws-sigv4 (~> 1.0)
|
35
|
-
aws-sdk-core (3.46.
|
35
|
+
aws-sdk-core (3.46.2)
|
36
36
|
aws-eventstream (~> 1.0)
|
37
37
|
aws-partitions (~> 1.0)
|
38
38
|
aws-sigv4 (~> 1.0)
|
39
39
|
jmespath (~> 1.0)
|
40
|
-
aws-sdk-ec2 (1.
|
40
|
+
aws-sdk-ec2 (1.71.0)
|
41
41
|
aws-sdk-core (~> 3, >= 3.39.0)
|
42
42
|
aws-sigv4 (~> 1.0)
|
43
43
|
aws-sdk-ecr (1.11.0)
|
44
44
|
aws-sdk-core (~> 3, >= 3.39.0)
|
45
45
|
aws-sigv4 (~> 1.0)
|
46
|
-
aws-sdk-ecs (1.
|
46
|
+
aws-sdk-ecs (1.30.0)
|
47
47
|
aws-sdk-core (~> 3, >= 3.39.0)
|
48
48
|
aws-sigv4 (~> 1.0)
|
49
|
-
aws-sdk-elasticloadbalancingv2 (1.
|
49
|
+
aws-sdk-elasticloadbalancingv2 (1.21.0)
|
50
50
|
aws-sdk-core (~> 3, >= 3.39.0)
|
51
51
|
aws-sigv4 (~> 1.0)
|
52
52
|
aws-sigv4 (1.0.3)
|
53
|
-
byebug (
|
53
|
+
byebug (11.0.0)
|
54
54
|
cli_markdown (0.1.0)
|
55
55
|
codeclimate-test-reporter (1.0.9)
|
56
56
|
simplecov (<= 0.13)
|
@@ -61,7 +61,7 @@ GEM
|
|
61
61
|
i18n (1.5.3)
|
62
62
|
concurrent-ruby (~> 1.0)
|
63
63
|
jmespath (1.4.0)
|
64
|
-
json (2.
|
64
|
+
json (2.2.0)
|
65
65
|
memoist (0.16.0)
|
66
66
|
minitest (5.11.3)
|
67
67
|
plissken (1.3.0)
|
@@ -109,4 +109,4 @@ DEPENDENCIES
|
|
109
109
|
ufo!
|
110
110
|
|
111
111
|
BUNDLED WITH
|
112
|
-
1.17.
|
112
|
+
1.17.3
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
<img src="http://ufoships.com/img/logos/ufo-logo.png" />
|
3
3
|
</div>
|
4
4
|
|
5
|
-
# UFO
|
5
|
+
# UFO: ECS Deploy Tool
|
6
6
|
|
7
7
|
[![CircleCI](https://circleci.com/gh/tongueroo/ufo.svg?style=svg)](https://circleci.com/gh/tongueroo/ufo)
|
8
8
|
[![Join the chat at https://gitter.im/tongueroo/ufo](https://badges.gitter.im/tongueroo/ufo.svg)](https://gitter.im/tongueroo/ufo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
@@ -10,8 +10,8 @@
|
|
10
10
|
|
11
11
|
Ufo is a tool that builds Docker images and deploys them to [AWS ECS](https://aws.amazon.com/ecs/). The main command is `ufo ship`. Here's summary of what it does:
|
12
12
|
|
13
|
-
1. Builds a docker image.
|
14
|
-
2. Generates and registers the ECS template definition.
|
13
|
+
1. Builds a docker image.
|
14
|
+
2. Generates and registers the ECS template definition.
|
15
15
|
3. Deploys the ECS template definition to the ECS service.
|
16
16
|
|
17
17
|
Ufo deploys a task definition that is written in a templating language that is easily and fully controllable.
|
data/docs/_config.yml
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Site settings
|
2
|
-
title: UFO ECS
|
2
|
+
title: UFO ECS Deploy Tool
|
3
3
|
email: tongueroo@gmail.com
|
4
4
|
url: http://ufoships.com
|
5
|
-
description: "AWS ECS
|
5
|
+
description: "AWS ECS Deploy Tool"
|
6
6
|
keywords: "AWS EC2 Container Service, AWS ECS, UFO, Deploy to ECS, ufo ship"
|
7
7
|
skills: ""
|
8
8
|
meta_author: Tung Nguyen
|
@@ -26,11 +26,11 @@ disqus_shortname:
|
|
26
26
|
|
27
27
|
# Color settings (hex-codes without the leading hash-tag)
|
28
28
|
color:
|
29
|
-
primary:
|
29
|
+
primary: FFF
|
30
30
|
primary-rgb: "24,288,156" #"128,179,255"
|
31
31
|
secondary: 2c3e50 #FD6E8A
|
32
32
|
secondary-dark: 233140 #A2122F
|
33
|
-
links:
|
33
|
+
links: 0275d8
|
34
34
|
|
35
35
|
# Footer settings
|
36
36
|
footer:
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
title: Create ecsTaskExecutionRole with AWS CLI
|
3
|
+
---
|
4
|
+
|
5
|
+
Here are commands you can copy and paste to create the `ecsTaskExecutionRole` IAM role:
|
6
|
+
|
7
|
+
cat > /tmp/task-execution-assume-role.json <<EOL
|
8
|
+
{
|
9
|
+
"Version": "2012-10-17",
|
10
|
+
"Statement": [
|
11
|
+
{
|
12
|
+
"Sid": "",
|
13
|
+
"Effect": "Allow",
|
14
|
+
"Principal": {
|
15
|
+
"Service": "ecs-tasks.amazonaws.com"
|
16
|
+
},
|
17
|
+
"Action": "sts:AssumeRole"
|
18
|
+
}
|
19
|
+
]
|
20
|
+
}
|
21
|
+
EOL
|
22
|
+
aws iam create-role --role-name ecsTaskExecutionRole --assume-role-policy-document file:///tmp/task-execution-assume-role.json
|
23
|
+
aws iam attach-role-policy --role-name ecsTaskExecutionRole --policy-arn arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
|
24
|
+
|
25
|
+
This is based from [Tutorial: Creating a Cluster with a Fargate Task Using the Amazon ECS CLI](https://docs.amazonaws.cn/en_us/AmazonECS/latest/userguide/ecs-cli-tutorial-fargate.html).
|
26
|
+
|
27
|
+
Also for a tutorial on how to create this `ecsTaskExecutionRole` via the AWS IAM Console: [Amazon ECS Task Execution IAM Role
|
28
|
+
](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html).
|
data/docs/_docs/conventions.md
CHANGED
@@ -44,5 +44,5 @@ ufo ship demo-web --elb arn:aws:elasticloadbalancing:us-east-1:12345689:targetgr
|
|
44
44
|
```
|
45
45
|
|
46
46
|
<a id="prev" class="btn btn-basic" href="{% link _docs/helpers.md %}">Back</a>
|
47
|
-
<a id="next" class="btn btn-primary" href="{% link _docs/
|
47
|
+
<a id="next" class="btn btn-primary" href="{% link _docs/ufo-env.md %}">Next Step</a>
|
48
48
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
data/docs/_docs/faq.md
CHANGED
@@ -11,7 +11,7 @@ Yes, Fargate is supported. To use ufo with Fargate, you will need to adjust the
|
|
11
11
|
|
12
12
|
If it's a brand new project, you can use `ufo init` with the `--launch-type fargate` option and it will generate a starter task definition JSON file that has the right Fargate structure. More info is available at [ufo init reference](/reference/ufo-init/#fargate-support).
|
13
13
|
|
14
|
-
A quick and easy way to test fargate is to follow the [Fargate Docs]({% link
|
14
|
+
A quick and easy way to test fargate is to follow the [Quick Start: Fargate Docs]({% link quick-start.md %}) which provides a demo example.
|
15
15
|
|
16
16
|
**Q: Can I tell ufo to use specific docker build options?**
|
17
17
|
|
data/docs/_docs/fargate.md
CHANGED
@@ -2,109 +2,7 @@
|
|
2
2
|
title: Fargate
|
3
3
|
---
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
Here's video demo of using ufo with ECS Fargate:
|
8
|
-
|
9
|
-
<div class="video-box"><div class="video-container">
|
10
|
-
<iframe src="https://www.youtube.com/embed/nYWt-mM7kyY" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
|
11
|
-
</div></div>
|
12
|
-
|
13
|
-
The commands from the video are also provided and explained below.
|
14
|
-
|
15
|
-
## Fargate Example
|
16
|
-
|
17
|
-
Here's an example of creating web service with Fargate.
|
18
|
-
|
19
|
-
git clone https://github.com/tongueroo/demo-ufo demo
|
20
|
-
cd demo
|
21
|
-
ufo init --image tongueroo/demo-ufo --launch-type fargate --execution-role-arn arn:aws:iam::112233445566:role/ecsTaskExecutionRole
|
22
|
-
ufo current --service demo-web
|
23
|
-
ufo ship
|
24
|
-
|
25
|
-
**IMPORTANT**: Replace the `--execution-role-arn` with the ecsTaskExecutionRole associated with your account. If you do not have an ecsTaskExecutionRole yet, create one by following [Amazon ECS Task Execution IAM Role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) guide.
|
26
|
-
|
27
|
-
You should see output similiar to this. Some output has been removed for conciseness.
|
28
|
-
|
29
|
-
$ ufo ship
|
30
|
-
Building docker image with:
|
31
|
-
docker build -t tongueroo/demo-ufo:ufo-2018-06-29T22-54-07-20b3a10 -f Dockerfile .
|
32
|
-
...
|
33
|
-
10:58:38PM CREATE_COMPLETE AWS::ECS::Service Ecs
|
34
|
-
10:58:40PM CREATE_COMPLETE AWS::CloudFormation::Stack development-demo-web
|
35
|
-
Stack success status: CREATE_COMPLETE
|
36
|
-
Time took for stack deployment: 4m 24s.
|
37
|
-
Software shipped!
|
38
|
-
$
|
39
|
-
|
40
|
-
### Verification ufo commands
|
41
|
-
|
42
|
-
You can verify that service with these ufo commands.
|
43
|
-
|
44
|
-
$ ufo ps
|
45
|
-
=> Service: demo-web
|
46
|
-
Service name: development-demo-web-Ecs-1LMRH98Y352F7
|
47
|
-
Status: ACTIVE
|
48
|
-
Running count: 1
|
49
|
-
Desired count: 1
|
50
|
-
Launch type: FARGATE
|
51
|
-
Task definition: demo-web:84
|
52
|
-
Elb: develop-Elb-BNIP29PG593M-771779085.us-east-1.elb.amazonaws.com
|
53
|
-
+----------+------+-------------+---------------+---------+-------+
|
54
|
-
| Id | Name | Release | Started | Status | Notes |
|
55
|
-
+----------+------+-------------+---------------+---------+-------+
|
56
|
-
| 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
|
57
|
-
+----------+------+-------------+---------------+---------+-------+
|
58
|
-
$ ufo scale 2
|
59
|
-
Scale demo-web service in development cluster to 2
|
60
|
-
$ ufo ps --no-summary
|
61
|
-
+----------+------+-------------+---------------+---------+-------+
|
62
|
-
| Id | Name | Release | Started | Status | Notes |
|
63
|
-
+----------+------+-------------+---------------+---------+-------+
|
64
|
-
| 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
|
65
|
-
+----------+------+-------------+---------------+---------+-------+
|
66
|
-
$ ufo ps --no-summary
|
67
|
-
+----------+------+-------------+---------------+---------+-------+
|
68
|
-
| Id | Name | Release | Started | Status | Notes |
|
69
|
-
+----------+------+-------------+---------------+---------+-------+
|
70
|
-
| 02b78575 | web | demo-web:84 | PENDING | PENDING | |
|
71
|
-
| 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
|
72
|
-
+----------+------+-------------+---------------+---------+-------+
|
73
|
-
$ ufo ps --no-summary
|
74
|
-
+----------+------+-------------+----------------+---------+-------+
|
75
|
-
| Id | Name | Release | Started | Status | Notes |
|
76
|
-
+----------+------+-------------+----------------+---------+-------+
|
77
|
-
| 02b78575 | web | demo-web:84 | 12 seconds ago | RUNNING | |
|
78
|
-
| 78e02265 | web | demo-web:84 | 3 minutes ago | RUNNING | |
|
79
|
-
+----------+------+-------------+----------------+---------+-------+
|
80
|
-
$
|
81
|
-
|
82
|
-
### Verification curl
|
83
|
-
|
84
|
-
You can verify that the app is up and running curling the ELB DNS.
|
85
|
-
|
86
|
-
$ curl develop-Elb-BNIP29PG593M-771779085.us-east-1.elb.amazonaws.com ; echo
|
87
|
-
42
|
88
|
-
$
|
89
|
-
|
90
|
-
Congratulations 🎉 You have successfully deployed an docker web service to "serverless" Fargate.
|
91
|
-
|
92
|
-
## Clean up
|
93
|
-
|
94
|
-
Remove the service to save costs.
|
95
|
-
|
96
|
-
$ ufo destroy
|
97
|
-
You are about to destroy demo-web service on the development cluster.
|
98
|
-
Are you sure you want to do this? (y/n) y
|
99
|
-
Deleting CloudFormation stack with ECS resources: development-demo-web.
|
100
|
-
11:05:40PM DELETE_IN_PROGRESS AWS::CloudFormation::Stack development-demo-web User
|
101
|
-
...
|
102
|
-
11:07:51PM DELETE_COMPLETE AWS::EC2::SecurityGroup EcsSecurityGroup
|
103
|
-
Stack development-demo-web deleted.
|
104
|
-
$
|
105
|
-
|
106
|
-
Here's an article that compares the cost of ECS Fargate: [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison)
|
107
|
-
|
5
|
+
This doc has been moved to [Quick Start: Fargate]({% link quick-start.md %}).
|
108
6
|
|
109
7
|
<a id="prev" class="btn btn-basic" href="{% link _docs/conventions.md %}">Back</a>
|
110
8
|
<a id="next" class="btn btn-primary" href="{% link _docs/ufo-env.md %}">Next Step</a>
|
data/docs/_docs/install.md
CHANGED
@@ -31,7 +31,7 @@ For more information about the Bolts Toolbelt or to get an installer for another
|
|
31
31
|
* Docker: You will need a working version of [Docker](https://docs.docker.com/engine/installation/) installed as ufo shells out and calls the `docker` command.
|
32
32
|
* AWS: Set up your AWS credentials at `~/.aws/credentials` and `~/.aws/config`. This is the [AWS standard way of setting up credentials](https://aws.amazon.com/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/).
|
33
33
|
|
34
|
-
<a id="prev" class="btn btn-basic" href="{% link quick-start.md %}">Back</a>
|
34
|
+
<a id="prev" class="btn btn-basic" href="{% link _docs/quick-start-ec2.md %}">Back</a>
|
35
35
|
<a id="next" class="btn btn-primary" href="{% link _docs/tutorial.md %}">Next Step</a>
|
36
36
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
37
37
|
|
@@ -0,0 +1,84 @@
|
|
1
|
+
---
|
2
|
+
title: "Quick Start: EC2"
|
3
|
+
---
|
4
|
+
|
5
|
+
## What is ECS EC2?
|
6
|
+
|
7
|
+
ECS EC2 is a way to run Docker containers on your own EC2 instances. This difference between ECS EC2 and ECS Fargate is who manages the servers. With ECS Fargate, AWS manages the EC2 instances for you and provides an interesting "serverless" option. With ECS EC2, you manage the EC2 instances and are responsible for maintenance. The pro with ECS EC2 is more control and cost savings, since you're not paying for the overhead for AWS Fargate maintenance. Refer to [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison) for a pricing comparison.
|
8
|
+
|
9
|
+
## Let's Go
|
10
|
+
|
11
|
+
In a hurry? No sweat! Here's a quick start to using ufo that takes only a few minutes. For this example, we will use a Sinatra app from [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo). The `ufo init` command sets up the ufo directory structure in your project. The `ufo ship` command deploys your code to an AWS ECS service. The `ufo ps` and `ufo scale` command shows you how to verify and scale additional containers.
|
12
|
+
|
13
|
+
gem install ufo
|
14
|
+
git clone https://github.com/tongueroo/demo-ufo.git demo
|
15
|
+
cd demo
|
16
|
+
ufo init --image=tongueroo/demo-ufo # NOTE: use your own account
|
17
|
+
ufo current --service demo-web
|
18
|
+
ufo ship
|
19
|
+
ufo ps
|
20
|
+
ufo scale 2
|
21
|
+
|
22
|
+
This quickstart assumes:
|
23
|
+
|
24
|
+
* You have push access to the repo. Refer to the Notes "Repo Push Access" section below for more info.
|
25
|
+
* You are using ECS EC2 and have an ECS cluster with EC2 Container instances running. Refer to the Notes "ECS EC2 vs ECS Fargate" section below for more info.
|
26
|
+
|
27
|
+
## What Happened
|
28
|
+
|
29
|
+
The `ufo ship demo-web` command does the following:
|
30
|
+
|
31
|
+
1. Builds the Docker image and pushes it to a registry
|
32
|
+
2. Builds the ECS task definitions and registry them to ECS
|
33
|
+
3. Updates the ECS Service
|
34
|
+
4. Creates an ELB and connects it to the ECS Service
|
35
|
+
|
36
|
+
You should see something similar to this:
|
37
|
+
|
38
|
+
```
|
39
|
+
$ ufo init --app=demo --image=tongueroo/demo-ufo
|
40
|
+
Setting up ufo project...
|
41
|
+
create .env
|
42
|
+
create .ufo/settings.yml
|
43
|
+
create .ufo/task_definitions.rb
|
44
|
+
create .ufo/templates/main.json.erb
|
45
|
+
create .ufo/variables/base.rb
|
46
|
+
create .ufo/variables/development.rb
|
47
|
+
create .ufo/variables/production.rb
|
48
|
+
create Dockerfile
|
49
|
+
create bin/deploy
|
50
|
+
append .gitignore
|
51
|
+
Starter ufo files created.
|
52
|
+
$ ufo ship demo-web
|
53
|
+
Building docker image with:
|
54
|
+
docker build -t tongueroo/demo-ufo:ufo-2017-09-10T15-00-19-c781aaf -f Dockerfile .
|
55
|
+
....
|
56
|
+
Software shipped!
|
57
|
+
$ ufo ps
|
58
|
+
+----------+------+-------------+---------------+---------+-------+
|
59
|
+
| Id | Name | Release | Started | Status | Notes |
|
60
|
+
+----------+------+-------------+---------------+---------+-------+
|
61
|
+
| f590ee5e | web | demo-web:85 | 1 minutes ago | RUNNING | |
|
62
|
+
+----------+------+-------------+---------------+---------+-------+
|
63
|
+
$ ufo scale 2
|
64
|
+
Scale demo-web service in development cluster to 2
|
65
|
+
$
|
66
|
+
```
|
67
|
+
|
68
|
+
Congratulations! You have successfully deployed code to AWS ECS with ufo. It was really that simple 😁
|
69
|
+
|
70
|
+
{% include repo_push_access.md %}
|
71
|
+
|
72
|
+
## ECS EC2 vs ECS Fargate
|
73
|
+
|
74
|
+
Ufo does not create the EC2 servers themselves to run the ECS tasks. If you use `ufo ship` to deploy an application to ECS EC2 and have not set up the EC2 servers, then the CloudFormation update will not be able to provision the ECS tasks and eventually roll back. Essentially it cannot create the ECS tasks because there are no EC2 servers to run them.
|
75
|
+
|
76
|
+
Refer to the AWS [Creating a Cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create_cluster.html) docs to create an ECS cluster. Also refer to [ECS Terms Tutorial](https://blog.boltops.com/2017/09/08/aws-ecs-terms-tutorial) for an explanation of ECS terms.
|
77
|
+
|
78
|
+
If you would like not to manage the EC2 server fleet, you are looking for ECS Fargate instead of ECS EC2. ECS Fargate allows you to run ECS Tasks and AWS will manage the EC2 server fleet for you. Refer to the [Quick Start: Fargate]({% link quick-start.md %}) docs and use those quick start like commands instead. The pricing for Fargate is more because AWS manages the server fleet for you. Refer to [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison) for a pricing comparison.
|
79
|
+
|
80
|
+
Learn more in the next sections.
|
81
|
+
|
82
|
+
<a id="prev" class="btn btn-basic" href="{% link quick-start.md %}">Back</a>
|
83
|
+
<a id="next" class="btn btn-primary" href="{% link _docs/install.md %}">Next Step</a>
|
84
|
+
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
data/docs/_docs/ssl-support.md
CHANGED
@@ -2,9 +2,7 @@
|
|
2
2
|
title: SSL Support
|
3
3
|
---
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
If you are using an Application Load Balancer you can configure SSL support by uncomment the `listener_ssl` option in `.ufo/settings/cfn/default.yml`. Here's an example:
|
5
|
+
You can configure SSL support by uncomment the `listener_ssl` option in `.ufo/settings/cfn/default.yml`. Here's an example:
|
8
6
|
|
9
7
|
```
|
10
8
|
listener_ssl:
|
@@ -16,25 +14,7 @@ listener_ssl:
|
|
16
14
|
For the certificate arn, you will need to create a certificate with AWS ACM. To do so, you can follow these instructions: [Request a Public Certificate
|
17
15
|
](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html)
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
ufo ship
|
22
|
-
|
23
|
-
## Network Load Balancers
|
24
|
-
|
25
|
-
Network Load Balancers work at layer 4, so they do not support SSL termination because SSL happens higher up in the OSI model. With Network Load Balancers you must handle SSL termination within your app with the server you are using. For example, apache, nginx or tomcat.
|
26
|
-
|
27
|
-
You also will need to also configure the target group to check the port that your app server is listening to and configure the health_check_protocol to HTTPS. Here's an example:
|
28
|
-
|
29
|
-
```
|
30
|
-
listener_ssl:
|
31
|
-
port: 443
|
32
|
-
target_group:
|
33
|
-
port: 443
|
34
|
-
health_check_protocol: HTTPS
|
35
|
-
```
|
36
|
-
|
37
|
-
The protocol in the case of the network load balancer is TCP and is configured to TCP by default by ufo for Network Load Balancers, so you don't have to configure the protocol.
|
17
|
+
The protocol will be either HTTP or HTTPS for Application Load Balancers and TCP or TLS for Network Load Balancers. Ufo will infer the right value, so you usually don't have to configure the protocol manually. You can configure it if required though.
|
38
18
|
|
39
19
|
<a id="prev" class="btn btn-basic" href="{% link _docs/ecs-network-mode.md %}">Back</a>
|
40
20
|
<a id="next" class="btn btn-primary" href="{% link _docs/route53-support.md %}">Next Step</a>
|
data/docs/_docs/ufo-env.md
CHANGED
@@ -44,6 +44,6 @@ AWS_PROFILE=whatever => UFO_ENV=development # since there are no profiles that m
|
|
44
44
|
|
45
45
|
Notice how `AWS_PROFILE=whatever` results in `UFO_ENV=development`. This is because there are no matching aws_profiles in the `settings.yml`. More info on settings is available at [settings]({% link _docs/settings.md %}).
|
46
46
|
|
47
|
-
<a id="prev" class="btn btn-basic" href="{% link _docs/
|
47
|
+
<a id="prev" class="btn btn-basic" href="{% link _docs/conventions.md %}">Back</a>
|
48
48
|
<a id="next" class="btn btn-primary" href="{% link _docs/ufo-env-extra.md %}">Next Step</a>
|
49
49
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
data/docs/_includes/content.html
CHANGED
data/docs/_includes/css/main.css
CHANGED
@@ -9,12 +9,12 @@ body {
|
|
9
9
|
}
|
10
10
|
|
11
11
|
p {
|
12
|
-
|
13
|
-
|
12
|
+
font-size: 1.1em;
|
13
|
+
line-height: 1.5;
|
14
|
+
margin-bottom: 20px;
|
14
15
|
}
|
15
16
|
|
16
17
|
p.small {
|
17
|
-
/*font-size: 16px;*/
|
18
18
|
font-size: 1em;
|
19
19
|
}
|
20
20
|
|
@@ -23,7 +23,7 @@ pre code {
|
|
23
23
|
}
|
24
24
|
|
25
25
|
code {
|
26
|
-
font-size: 0.
|
26
|
+
font-size: 0.80em;
|
27
27
|
}
|
28
28
|
|
29
29
|
a,
|
@@ -35,15 +35,16 @@ a.active {
|
|
35
35
|
color: #{{ site.color.links }};
|
36
36
|
}
|
37
37
|
|
38
|
+
|
38
39
|
h1,
|
39
40
|
h2,
|
40
41
|
h3,
|
41
42
|
h4,
|
42
43
|
h5,
|
43
44
|
h6 {
|
44
|
-
|
45
|
-
font-
|
46
|
-
|
45
|
+
font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif';
|
46
|
+
font-weight: 200;
|
47
|
+
letter-spacing: 1px;
|
47
48
|
}
|
48
49
|
|
49
50
|
h3,
|
@@ -79,7 +80,7 @@ hr.star-light {
|
|
79
80
|
}
|
80
81
|
|
81
82
|
hr.star-light:after {
|
82
|
-
color: #
|
83
|
+
color: #366db6;
|
83
84
|
background-color: #{{ site.color.primary }};
|
84
85
|
}
|
85
86
|
|
@@ -211,16 +212,16 @@ section {
|
|
211
212
|
section h2 {
|
212
213
|
margin: 0;
|
213
214
|
margin-bottom: 15px;
|
214
|
-
font-size: 1.6em
|
215
|
+
/*font-size: 1.6em;*/
|
215
216
|
}
|
216
217
|
|
217
218
|
section h3 {
|
218
|
-
font-size: 1.4em
|
219
|
+
/*font-size: 1.4em;*/
|
219
220
|
}
|
220
221
|
|
221
222
|
section.success {
|
222
223
|
color: #fff;
|
223
|
-
background: #
|
224
|
+
background: #3972c7;
|
224
225
|
}
|
225
226
|
|
226
227
|
@media(max-width:767px) {
|
@@ -58,3 +58,8 @@
|
|
58
58
|
.highlight .vg { color: #008080 } /* Name.Variable.Global */
|
59
59
|
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
|
60
60
|
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
|
61
|
+
|
62
|
+
/* fix css the pre code block that is generated with ```*/
|
63
|
+
.highlighter-rouge .highlight {
|
64
|
+
background: #ecf0f1;
|
65
|
+
}
|
data/docs/_includes/css/ufo.css
CHANGED
@@ -5,7 +5,8 @@ ol.overview-stages li {
|
|
5
5
|
|
6
6
|
section#main {
|
7
7
|
/*text-align: center;*/
|
8
|
-
|
8
|
+
font-family: 'Muli', 'Helvetica', 'Arial', 'sans-serif';
|
9
|
+
color: #292b2c;
|
9
10
|
background: #{{ site.color.primary }};
|
10
11
|
}
|
11
12
|
|
@@ -55,8 +56,20 @@ section#main .intro-text .skills {
|
|
55
56
|
text-align: left;
|
56
57
|
}
|
57
58
|
|
59
|
+
.content-body h1 {
|
60
|
+
font-size: 1.6em;
|
61
|
+
}
|
62
|
+
|
58
63
|
.content-body h2 {
|
59
|
-
|
64
|
+
font-size: 1.4em;
|
65
|
+
}
|
66
|
+
|
67
|
+
.content-body h3 {
|
68
|
+
font-size: 1.35em;
|
69
|
+
}
|
70
|
+
|
71
|
+
.content-body h4 {
|
72
|
+
font-size: 1.3em;
|
60
73
|
}
|
61
74
|
|
62
75
|
.content-body ul,
|
@@ -65,14 +78,12 @@ section#main .intro-text .skills {
|
|
65
78
|
}
|
66
79
|
.content-body ul li,
|
67
80
|
.content-body ol li {
|
68
|
-
font-size: 1.
|
81
|
+
font-size: 1.1em;
|
69
82
|
}
|
70
83
|
|
71
84
|
.content-nav {
|
72
|
-
/*background-color: green;*/
|
73
|
-
margin-top: 40px;
|
74
85
|
font-size: 1.2em;
|
75
|
-
color: #
|
86
|
+
color: #484d4e;
|
76
87
|
}
|
77
88
|
|
78
89
|
.content-nav ul, .content-nav ol {
|
@@ -82,18 +93,21 @@ section#main .intro-text .skills {
|
|
82
93
|
}
|
83
94
|
|
84
95
|
.content-nav a {
|
85
|
-
color: #
|
96
|
+
color: #484d4e;
|
86
97
|
}
|
87
98
|
|
88
99
|
.content-nav a.active {
|
89
|
-
color: #e2ddef
|
100
|
+
/*color: #e2ddef;*/
|
101
|
+
color: #2c3e50;
|
90
102
|
font-weight: bold;
|
91
103
|
}
|
92
104
|
|
93
105
|
/* override for syntax.css */
|
94
106
|
code {
|
95
107
|
color: #443e40;
|
96
|
-
background-color: #cdcbd4
|
108
|
+
/*background-color: #cdcbd4;*/
|
109
|
+
background-color: #f7f7f9;
|
110
|
+
|
97
111
|
}
|
98
112
|
|
99
113
|
footer h3 {
|
@@ -131,17 +145,21 @@ ul.tools li {
|
|
131
145
|
}
|
132
146
|
|
133
147
|
.edit-on-github {
|
134
|
-
font-size: 0.9em;
|
135
148
|
border-top: thin solid white;
|
136
149
|
border-bottom: thin solid white;
|
137
150
|
padding: 20px 0;
|
138
151
|
margin-top: 80px;
|
139
152
|
}
|
140
153
|
|
141
|
-
.edit-on-github h2
|
142
|
-
|
143
|
-
|
144
|
-
|
154
|
+
.edit-on-github h2 {
|
155
|
+
font-size: 1.25em;
|
156
|
+
}
|
157
|
+
.edit-on-github p {
|
158
|
+
font-size: 0.95em;
|
159
|
+
}
|
160
|
+
.edit-on-github ul li,
|
161
|
+
.edit-on-github ol li {
|
162
|
+
font-size: 0.9em;
|
145
163
|
}
|
146
164
|
|
147
165
|
.use-cases {
|
@@ -167,10 +185,15 @@ table.ship-options td:first-child {
|
|
167
185
|
}
|
168
186
|
|
169
187
|
#summary {
|
170
|
-
|
188
|
+
font-size: 1.2em;
|
171
189
|
padding-bottom: 0;
|
172
190
|
margin-bottom: 0;
|
173
191
|
}
|
192
|
+
@media(max-width:992px) {
|
193
|
+
#summary {
|
194
|
+
font-size: 1em;
|
195
|
+
}
|
196
|
+
}
|
174
197
|
|
175
198
|
.video-box {
|
176
199
|
max-width: 700px;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
## Repo Push Access
|
2
|
+
|
3
|
+
The quick start example pushes the Docker image to a Dockerhub repo. You need your own repo with push access. This repo could be your own Dockerhub account or ECR repo. You can control the setting with the `--image` option. Example:
|
4
|
+
|
5
|
+
ufo init --image=yourusername/yourrepo # use your own account
|
6
|
+
|
7
|
+
Also, if you are using ECR instead, you can specify an ECR repo with the `--image` option. Example:
|
8
|
+
|
9
|
+
ufo init --image 123456789012.dkr.ecr.us-west-2.amazonaws.com/myimage
|
10
|
+
|
11
|
+
For more info, refer to the [ufo init](http://ufoships.com/reference/ufo-init/) reference docs.
|
data/docs/_includes/subnav.html
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
<div class="col-md-3 content-nav">
|
2
2
|
<ul>
|
3
|
-
<li><a href="{% link quick-start.md %}">Quick Start</a></li>
|
3
|
+
<li><a href="{% link quick-start.md %}">Quick Start: Fargate</a></li>
|
4
|
+
<li><a href="{% link _docs/quick-start-ec2.md %}">Quick Start: EC2</a></li>
|
4
5
|
<li><a href="{% link _docs/install.md %}">Installation</a></li>
|
5
6
|
<li><a href="{% link _docs/tutorial.md %}">Tutorial</a>
|
6
7
|
<ul class="tutorial">
|
@@ -21,7 +22,6 @@
|
|
21
22
|
<li><a href="{% link _docs/variables.md %}">Shared Variables</a></li>
|
22
23
|
<li><a href="{% link _docs/helpers.md %}">Helpers</a></li>
|
23
24
|
<li><a href="{% link _docs/conventions.md %}">Conventions</a></li>
|
24
|
-
<li><a href="{% link _docs/fargate.md %}">Fargate</a></li>
|
25
25
|
<li><a href="{% link _docs/ufo-env.md %}">Ufo Env</a></li>
|
26
26
|
<li><a href="{% link _docs/ufo-env-extra.md %}">Ufo Env Extra</a></li>
|
27
27
|
<li><a href="{% link _docs/ufo-current.md %}">Ufo Current</a></li>
|
data/docs/_includes/summary.html
CHANGED
@@ -8,12 +8,13 @@
|
|
8
8
|
</div>
|
9
9
|
<div class="row">
|
10
10
|
<div class="col-lg-6 col-lg-offset-3">
|
11
|
-
<p>The main command is <code>ufo ship</code>. Here's
|
11
|
+
<p>The main command is <code>ufo ship</code>. Here's what it does:</p>
|
12
12
|
|
13
13
|
<ol class="landing-summary">
|
14
14
|
<li>Builds a docker image.</li>
|
15
15
|
<li>Registers the ECS template definition.</li>
|
16
16
|
<li>Deploys to ECS.</li>
|
17
|
+
<li>Creates an ELB.</li>
|
17
18
|
</ol>
|
18
19
|
</div>
|
19
20
|
</div>
|
data/docs/_reference/ufo-init.md
CHANGED
@@ -81,7 +81,7 @@ You can also generate the init ufo files and bypass the prompt by providing the
|
|
81
81
|
|
82
82
|
ufo init --image tongueroo/demo-ufo --app demo --launch-type fargate --execution-role-arn arn:aws:iam::123456789012:role/ecsTaskExecutionRole
|
83
83
|
|
84
|
-
For more information and a demo of Fargate support, check out the [Fargate Docs]({% link
|
84
|
+
For more information and a demo of Fargate support, check out the [Quick Start: Fargate Docs]({% link quick-start.md %}).
|
85
85
|
|
86
86
|
## Custom Templates
|
87
87
|
|
data/docs/bin/web
CHANGED
data/docs/docs.md
CHANGED
@@ -9,9 +9,22 @@ Ufo is a tool that makes deploying to AWS ECS easy. Ufo provides a `ufo ship` co
|
|
9
9
|
1. ufo builds the docker container image
|
10
10
|
2. registers that image to ECS as a task definition
|
11
11
|
3. deploys that registered task definition to ECS by updating the service.
|
12
|
+
3. creates an ELB and associates it with the ECS service.
|
12
13
|
|
13
14
|
Ufo was built directly from real life production use cases after seeing the same patterns repeated over and over. Ufo enables you to write the AWS task definition json format file in ERB, an easy templating language. This allows you to reuse the ufo tool with multiple applications and only put the truly application specific business logic in each app code base.
|
14
15
|
|
16
|
+
## Learn More
|
17
|
+
|
18
|
+
You might like these articles:
|
19
|
+
|
20
|
+
* [UFO and ECS Fargate Introduction Tutorial](https://blog.boltops.com/2018/07/11/ufo-and-ecs-fargate-introduction-tutorial)
|
21
|
+
* [UFO ECS Deploy Tool Introduction](https://blog.boltops.com/2018/07/06/ufo-ecs-deployment-tool-introduction)
|
22
|
+
* [UFO How to Create Unlimited Extra Environments](https://blog.boltops.com/2018/07/12/ufo-how-to-create-unlimited-extra-environments)
|
23
|
+
* [UFO Version 4 Release: Load Balancer Support](https://blog.boltops.com/2018/07/05/ufo-version-4-release)
|
24
|
+
* [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison)
|
25
|
+
|
26
|
+
Also, the [UFO Tutorial Docs]({% link _docs/tutorial.md %}) provide a detail walkthrough on how each UFO step works.
|
27
|
+
|
15
28
|
<a id="prev" class="btn btn-basic" href="{% link _docs/tutorial-ufo-ships.md %}">Back</a>
|
16
29
|
<a id="next" class="btn btn-primary" href="{% link _docs/structure.md %}">Next Step</a>
|
17
30
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
data/docs/quick-start.md
CHANGED
@@ -1,19 +1,28 @@
|
|
1
1
|
---
|
2
|
-
title: Quick Start
|
2
|
+
title: "Quick Start: Fargate"
|
3
3
|
---
|
4
4
|
|
5
|
-
|
5
|
+
## What is ECS Fargate?
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
AWS Fargate is a technology for Amazon ECS that allows you to run containers without having to manage servers or clusters. It provides an interesting "serverless" option for running Docker containers on AWS. The major benefit with ECS Fargate is you pass on the maintenance burden to AWS. Refer to [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison) for a pricing comparison.
|
8
|
+
|
9
|
+
## Let's Go
|
10
|
+
|
11
|
+
In a hurry? No sweat! Here's a quick start to using ufo that takes only a few minutes. For this example, we will use a Sinatra app from [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo). The `ufo init` command sets up the ufo directory structure in your project. The `ufo ship` command deploys your code to an AWS ECS service. The `ufo ps` and `ufo scale` command shows you how to verify and scale additional containers.
|
12
|
+
|
13
|
+
git clone https://github.com/tongueroo/demo-ufo demo
|
9
14
|
cd demo
|
10
|
-
|
15
|
+
AWS_ACCOUNT=$(aws sts get-caller-identity | jq -r '.Account')
|
16
|
+
ufo init --image tongueroo/demo-ufo --launch-type fargate --execution-role-arn arn:aws:iam::$AWS_ACCOUNT:role/ecsTaskExecutionRole
|
11
17
|
ufo current --service demo-web
|
12
18
|
ufo ship
|
13
19
|
ufo ps
|
14
20
|
ufo scale 2
|
15
21
|
|
16
|
-
|
22
|
+
This quickstart assumes:
|
23
|
+
|
24
|
+
* You have push access to the repo. Refer to the Notes "Repo Push Access" section below for more info.
|
25
|
+
* The `ecsTaskExecutionRole` needs to exist on your AWS account. If you do not have an ecsTaskExecutionRole yet, create one by following: [Create ecsTaskExecutionRole with AWS CLI]({% link _docs/aws-ecs-task-execution-role.md %}).
|
17
26
|
|
18
27
|
## What Happened
|
19
28
|
|
@@ -22,67 +31,100 @@ The `ufo ship demo-web` command does the following:
|
|
22
31
|
1. Builds the Docker image and pushes it to a registry
|
23
32
|
2. Builds the ECS task definitions and registry them to ECS
|
24
33
|
3. Updates the ECS Service
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
$ ufo
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
ufo
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
34
|
+
4. Creates an ELB and connects it to the ECS Service
|
35
|
+
|
36
|
+
You should see output similar to this.
|
37
|
+
|
38
|
+
$ ufo ship
|
39
|
+
Building docker image with:
|
40
|
+
docker build -t tongueroo/demo-ufo:ufo-2018-06-29T22-54-07-20b3a10 -f Dockerfile .
|
41
|
+
...
|
42
|
+
10:58:38PM CREATE_COMPLETE AWS::ECS::Service Ecs
|
43
|
+
10:58:40PM CREATE_COMPLETE AWS::CloudFormation::Stack development-demo-web
|
44
|
+
Stack success status: CREATE_COMPLETE
|
45
|
+
Time took for stack deployment: 4m 24s.
|
46
|
+
Software shipped!
|
47
|
+
$
|
48
|
+
|
49
|
+
## Video Demo
|
50
|
+
|
51
|
+
Here's demo of ufo with ECS Fargate:
|
52
|
+
|
53
|
+
<div class="video-box"><div class="video-container">
|
54
|
+
<iframe src="https://www.youtube.com/embed/nYWt-mM7kyY" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
|
55
|
+
</div></div>
|
56
|
+
|
57
|
+
## Verification ufo commands
|
58
|
+
|
59
|
+
You can verify that service with these ufo commands.
|
60
|
+
|
61
|
+
$ ufo ps
|
62
|
+
=> Service: demo-web
|
63
|
+
Service name: development-demo-web-Ecs-1LMRH98Y352F7
|
64
|
+
Status: ACTIVE
|
65
|
+
Running count: 1
|
66
|
+
Desired count: 1
|
67
|
+
Launch type: FARGATE
|
68
|
+
Task definition: demo-web:84
|
69
|
+
Elb: develop-Elb-BNIP29PG593M-771779085.us-east-1.elb.amazonaws.com
|
70
|
+
+----------+------+-------------+---------------+---------+-------+
|
71
|
+
| Id | Name | Release | Started | Status | Notes |
|
72
|
+
+----------+------+-------------+---------------+---------+-------+
|
73
|
+
| 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
|
74
|
+
+----------+------+-------------+---------------+---------+-------+
|
75
|
+
$ ufo scale 2
|
76
|
+
Scale demo-web service in development cluster to 2
|
77
|
+
$ ufo ps --no-summary
|
78
|
+
+----------+------+-------------+---------------+---------+-------+
|
79
|
+
| Id | Name | Release | Started | Status | Notes |
|
80
|
+
+----------+------+-------------+---------------+---------+-------+
|
81
|
+
| 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
|
82
|
+
+----------+------+-------------+---------------+---------+-------+
|
83
|
+
$ ufo ps --no-summary
|
84
|
+
+----------+------+-------------+---------------+---------+-------+
|
85
|
+
| Id | Name | Release | Started | Status | Notes |
|
86
|
+
+----------+------+-------------+---------------+---------+-------+
|
87
|
+
| 02b78575 | web | demo-web:84 | PENDING | PENDING | |
|
88
|
+
| 78e02265 | web | demo-web:84 | 2 minutes ago | RUNNING | |
|
89
|
+
+----------+------+-------------+---------------+---------+-------+
|
90
|
+
$ ufo ps --no-summary
|
91
|
+
+----------+------+-------------+----------------+---------+-------+
|
92
|
+
| Id | Name | Release | Started | Status | Notes |
|
93
|
+
+----------+------+-------------+----------------+---------+-------+
|
94
|
+
| 02b78575 | web | demo-web:84 | 12 seconds ago | RUNNING | |
|
95
|
+
| 78e02265 | web | demo-web:84 | 3 minutes ago | RUNNING | |
|
96
|
+
+----------+------+-------------+----------------+---------+-------+
|
97
|
+
$
|
98
|
+
|
99
|
+
## Verification curl
|
100
|
+
|
101
|
+
You can verify that the app is up and running curling the ELB DNS.
|
102
|
+
|
103
|
+
$ curl develop-Elb-BNIP29PG593M-771779085.us-east-1.elb.amazonaws.com ; echo
|
104
|
+
42
|
105
|
+
$
|
106
|
+
|
107
|
+
Congratulations 🎉 You have successfully deployed a docker web service to "serverless" Fargate.
|
108
|
+
|
109
|
+
Note: This quick start requires a working Docker installation. For Docker installation instructions refer to the [Docker installation guide](https://docs.docker.com/engine/installation/).
|
110
|
+
|
111
|
+
## Clean up
|
112
|
+
|
113
|
+
Remove the service to save costs.
|
114
|
+
|
115
|
+
$ ufo destroy
|
116
|
+
You are about to destroy demo-web service on the development cluster.
|
117
|
+
Are you sure you want to do this? (y/n) y
|
118
|
+
Deleting CloudFormation stack with ECS resources: development-demo-web.
|
119
|
+
11:05:40PM DELETE_IN_PROGRESS AWS::CloudFormation::Stack development-demo-web User
|
120
|
+
...
|
121
|
+
11:07:51PM DELETE_COMPLETE AWS::EC2::SecurityGroup EcsSecurityGroup
|
122
|
+
Stack development-demo-web deleted.
|
123
|
+
$
|
124
|
+
|
125
|
+
Here's an article that compares the cost of ECS Fargate: [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison)
|
126
|
+
|
127
|
+
{% include repo_push_access.md %}
|
128
|
+
|
129
|
+
<a id="next" class="btn btn-primary" href="{% link _docs/quick-start-ec2.md %}">Next Step</a>
|
87
130
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
88
|
-
|
@@ -33,15 +33,20 @@ target_group:
|
|
33
33
|
listener:
|
34
34
|
port: 80
|
35
35
|
# For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocol is TCP.
|
36
|
-
# protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP
|
36
|
+
# protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP, TLS
|
37
37
|
# ufo sets these defaults:
|
38
38
|
# application elb: HTTP # unless port is 443
|
39
39
|
# application elb: HTTPS # if port is 443
|
40
|
-
# network elb: TCP
|
40
|
+
# network elb: TCP # unless port is 443
|
41
|
+
# network elb: TLS # if port is 443
|
41
42
|
# Can keep protocol commented out,
|
42
43
|
# unless need to override the defaults.
|
44
|
+
# If using the listener to handle SSL
|
45
|
+
# certificates:
|
46
|
+
# - certificate_arn: arn:aws:acm:us-east-1:111111111111:certificate/11111111-2222-3333-4444-555555555555
|
43
47
|
|
44
|
-
#
|
48
|
+
# An optional second listener can be created.
|
49
|
+
# If HTTPS and SSL is required then the listener_ssl config is what you should use.
|
45
50
|
# Application ELBs support SSL termination.
|
46
51
|
# Network load balancers do not and must pass the request through to the app
|
47
52
|
# to handle SSL termination.
|
@@ -49,16 +54,12 @@ listener:
|
|
49
54
|
# ufo creates an ssl listener when listener_ssl is set.
|
50
55
|
# listener_ssl:
|
51
56
|
# port: 443
|
52
|
-
# # protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP
|
53
|
-
# # ufo handles setting the defaults:
|
54
|
-
# # application elb: HTTPS
|
55
|
-
# # network elb: TCP
|
56
|
-
# # Certificates are supported by application load balancers only.
|
57
|
-
# # Network load balancers do not support SSL termination so do not support
|
58
|
-
# # certificates.
|
59
57
|
# # certificates:
|
60
58
|
# # - certificate_arn: arn:aws:acm:us-east-1:111111111111:certificate/11111111-2222-3333-4444-555555555555
|
61
|
-
|
59
|
+
# # protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP, TLS
|
60
|
+
# # ufo handles setting the defaults:
|
61
|
+
# # application elb: HTTPS
|
62
|
+
# # network elb: TLS
|
62
63
|
|
63
64
|
# Configure dns to automatically be associated with the ELB dns name.
|
64
65
|
# Note, the route53 record set for the domain name must already exist.
|
data/lib/ufo/help/init.md
CHANGED
@@ -68,7 +68,7 @@ You can also generate the init ufo files and bypass the prompt by providing the
|
|
68
68
|
|
69
69
|
ufo init --image tongueroo/demo-ufo --app demo --launch-type fargate --execution-role-arn arn:aws:iam::123456789012:role/ecsTaskExecutionRole
|
70
70
|
|
71
|
-
For more information and a demo of Fargate support, check out the [Fargate Docs]({% link
|
71
|
+
For more information and a demo of Fargate support, check out the [Quick Start: Fargate Docs]({% link quick-start.md %}).
|
72
72
|
|
73
73
|
## Custom Templates
|
74
74
|
|
data/lib/ufo/stack/context.rb
CHANGED
@@ -47,13 +47,15 @@ class Ufo::Stack
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def default_listener_protocol
|
50
|
-
|
51
|
-
|
50
|
+
if elb_type == 'network'
|
51
|
+
cfn[:listener][:port] == 443 ? 'TLS' : 'TCP'
|
52
|
+
else
|
53
|
+
cfn[:listener][:port] == 443 ? 'HTTPS' : 'HTTP'
|
54
|
+
end
|
52
55
|
end
|
53
56
|
|
54
57
|
def default_listener_ssl_protocol
|
55
|
-
|
56
|
-
'HTTPS'
|
58
|
+
elb_type == 'network' ? 'TLS' : 'HTTPS'
|
57
59
|
end
|
58
60
|
|
59
61
|
# if the configuration is set to anything then enable it
|
data/lib/ufo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ufo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-cloudformation
|
@@ -291,6 +291,7 @@ files:
|
|
291
291
|
- docs/_config.yml
|
292
292
|
- docs/_docs/auto-completion.md
|
293
293
|
- docs/_docs/automated-cleanup.md
|
294
|
+
- docs/_docs/aws-ecs-task-execution-role.md
|
294
295
|
- docs/_docs/conventions.md
|
295
296
|
- docs/_docs/customize-cloudformation.md
|
296
297
|
- docs/_docs/ecs-network-mode.md
|
@@ -302,6 +303,7 @@ files:
|
|
302
303
|
- docs/_docs/migrations.md
|
303
304
|
- docs/_docs/next-steps.md
|
304
305
|
- docs/_docs/params.md
|
306
|
+
- docs/_docs/quick-start-ec2.md
|
305
307
|
- docs/_docs/redirection-support.md
|
306
308
|
- docs/_docs/route53-support.md
|
307
309
|
- docs/_docs/run-in-pieces.md
|
@@ -352,6 +354,7 @@ files:
|
|
352
354
|
- docs/_includes/nav.html
|
353
355
|
- docs/_includes/quotes.html
|
354
356
|
- docs/_includes/reference.md
|
357
|
+
- docs/_includes/repo_push_access.md
|
355
358
|
- docs/_includes/subnav.html
|
356
359
|
- docs/_includes/summary.html
|
357
360
|
- docs/_includes/ufo-ship-options.md
|
@@ -591,8 +594,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
591
594
|
- !ruby/object:Gem::Version
|
592
595
|
version: '0'
|
593
596
|
requirements: []
|
594
|
-
|
595
|
-
rubygems_version: 2.7.6
|
597
|
+
rubygems_version: 3.0.2
|
596
598
|
signing_key:
|
597
599
|
specification_version: 4
|
598
600
|
summary: AWS ECS Deployment Tool
|