Skip to content

Commit ca3a1fb

Browse files
authored
Skip DNS Recreation and make ALB Optional (#8)
* Update action.yaml * Bump action.yaml defn * Fixing action, cleaning out README * Bumping commons and adjusting README
1 parent 7094c32 commit ca3a1fb

File tree

3 files changed

+45
-5
lines changed

3 files changed

+45
-5
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
This action uses the new GitHub Actions Commons, that is used by many Bitovi GitHub Actions, and so it's constantly evolving and improving.
66

7+
⚠️ BREAKING CHANGES INTRODUCED IN V1
8+
Migrating from v0.1.* to v1.0.0 is possible. See [migration path](#migration-path) below.
9+
710
![alt](https://bitovi-gha-pixel-tracker-deployment-main.bitovi-sandbox.com/pixel/VWxHSTB15-F2P3xFRAdVX)
811
## Action Summary
912
With this action, you can create your ECS (Fargate or EC2) cluster, with tasks and service definitions in a matter of minutes! With an ALB, DNS and even Certificate (if in Route53)
@@ -41,7 +44,7 @@ jobs:
4144
deploy-ecs:
4245
runs-on: ubuntu-latest
4346
- name: Create Nginx example
44-
uses: bitovi/github-actions-deploy-ecs@v0.1.6
47+
uses: bitovi/github-actions-deploy-ecs@v1
4548
id: ecs
4649
with:
4750
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -80,7 +83,7 @@ jobs:
8083
url: ${{ steps.ecs.outputs.ecs_dns_record }}
8184
steps:
8285
- name: Create Nginx example
83-
uses: bitovi/github-actions-deploy-ecs@v0.1.6
86+
uses: bitovi/github-actions-deploy-ecs@v1
8487
id: ecs
8588
with:
8689
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -133,7 +136,11 @@ jobs:
133136
```
134137
135138
## Extra advanced usage
136-
If you know what you are doing, you can play around defining a JSON file for the Task definition. That allows you more granular control of it.
139+
If you know what you are doing, you can play around defining a JSON file for the container definitions. That allows you more granular control of it.
140+
141+
### Example Task Definition
142+
143+
You can find an example ECS task definition in [`task-definition.example.json`](./task-definition.example.json).
137144

138145
# Inputs
139146

@@ -187,7 +194,7 @@ The following inputs can be used as `step.with` keys
187194
| `aws_ecs_task_name`| String | Elastic Container Service task name. If task is defined with a JSON file, should be the same as the container name. |
188195
| `aws_ecs_task_ignore_definition` | Boolean | Ignores changes done in the ECS Tasks and services. That way stack can be managed from outside Terraform. Defaults to `false` |
189196
| `aws_ecs_task_execution_role`| String | Elastic Container Service task execution role name from IAM. Defaults to `ecsTaskExecutionRole`. |
190-
| `aws_ecs_task_json_definition_file`| String | Name of the json file containing task definition. Overrides every other input. |
197+
| `aws_ecs_task_json_definition_file`| String | Name of the json file containing container definitions. Overrides every other input. |
191198
| `aws_ecs_task_network_mode`| String | Network type to use in task definition. One of `none`, `bridge`, `awsvpc`, and `host`. |
192199
| `aws_ecs_task_cpu`| String | Task CPU Amount. |
193200
| `aws_ecs_task_mem`| String | Task Mem Amount. |
@@ -298,6 +305,13 @@ The following inputs can be used as `step.with` keys
298305
## Contributing
299306
We would love for you to contribute to [`bitovi/github-actions-deploy-ecs`](https://github.com/bitovi/github-actions-deploy-ecs). [Issues](https://github.com/bitovi/github-actions-deploy-ecs/issues) and [Pull Requests](https://github.com/bitovi/github-actions-deploy-ecs/pulls) are welcome!
300307

308+
## **Migration path**
309+
310+
In order to migrate from v0 to v1, the following path should be taken. **Expect downtime**
311+
1. Set `aws_r53_enable` to `false`, run the action.
312+
2. Bump to `v1` of the action with `aws_ecs_container_port` and `aws_ecs_lb_port` removed. Run the action.
313+
3. Add ports back. Run the action.
314+
4. Set `aws_r53_enable` to `true`, run the action.
301315

302316
## Note about resource identifiers
303317

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ runs:
307307
steps:
308308
- name: Deploy with BitOps
309309
id: deploy
310-
uses: bitovi/github-actions-commons@v1
310+
uses: bitovi/github-actions-commons@v2
311311
with:
312312
# Current repo vars
313313
gh_action_repo: ${{ github.action_path }}

task-definition.example.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"name": "test-world-staging-api",
4+
"image": "nginx:alpine",
5+
"essential": true,
6+
"cpu": 256,
7+
"memory": 512,
8+
"portMappings": [
9+
{
10+
"containerPort": 80,
11+
"protocol": "tcp",
12+
"hostPort": 80,
13+
"appProtocol": "http"
14+
}
15+
],
16+
"environment": [],
17+
"logConfiguration": {
18+
"logDriver": "awslogs",
19+
"options": {
20+
"awslogs-group": "/ecs/my-task-family",
21+
"awslogs-region": "us-east-1",
22+
"awslogs-stream-prefix": "api"
23+
}
24+
}
25+
}
26+
]

0 commit comments

Comments
 (0)