https://github.com/bboure/aws-ecs-task-definition
A Serverless Component to deploy ECS Task Definitions in minutes
https://github.com/bboure/aws-ecs-task-definition
aws ecs serverless serverless-components
Last synced: 7 months ago
JSON representation
A Serverless Component to deploy ECS Task Definitions in minutes
- Host: GitHub
- URL: https://github.com/bboure/aws-ecs-task-definition
- Owner: bboure
- Created: 2019-07-10T17:13:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-10T17:16:23.000Z (over 6 years ago)
- Last Synced: 2025-01-30T09:12:28.357Z (8 months ago)
- Topics: aws, ecs, serverless, serverless-components
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# awsEcsTaskDefinition
Deploy an AWS ECS Task Definition using [Serverless Component](https://github.com/serverless/components)
1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)
### 1. Install
```console
$ npm install -g @serverless/cli
```### 2. Create
```console
$ touch serverless.yml .env .env.prod
```The directory should look something like this:
```
|- serverless.yml
|- .env # your development AWS api keys
|- .env.prod # your production AWS api keys
```the `.env` files are not required if you have the aws keys set globally and you want to use a single stage, but they should look like this.
```
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
```### 3. Configure
```yml
# serverless.ymlname: my-component
stage: develasticSearch:
component: "@bboure/aws-ecs-task-definition"
inputs:
region: ${region}
taskDefinition:
family: my-task
cpu: "1024"
memory: "2048"
volumes:
- name: foo
host:
sourcePath: /home/foo
- name: bar
host:
sourcePath: /home/bar
containerDefinitions:
- name: myContainer
portMappings:
- hostPort: 80
containerPort: 80
protocol: tcp
cpu: 0
environment:
- name: FOO
value: BAR
mountPoints:
- containerPath: /var/www/foo
sourceVolume: foo
- containerPath: /var/www/bar
sourceVolume: bar
memory: 768
image: alpine:latest
essential: true
```### 4. Deploy
```console
$ componentsAwsEcsTaskDefinition:
region: eu-west-1
family: my-task
arn: arn:aws:ecs:eu-west-1:955509148573:task-definition/my-task:10s › AwsEcsTaskDefinition › done
```
### New to Components?
Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.