File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ DB_PASSWORD=
36
36
DB_NAME=
37
37
```
38
38
39
+ If the service type is **Fargate**, nad you're using the `run-task.sh` script, please include:
40
+ ```bash
41
+ SERVICE_TYPE=FARGATE
42
+ SUBNETS_ID=subnet1231231,subnet123123123,subnter123123123123
43
+ ```
44
+ Default values are: null
45
+
39
46
` task-definition.tpl.json ` (example)
40
47
``` json
41
48
{
Original file line number Diff line number Diff line change @@ -31,11 +31,23 @@ echo " CLUSTER_NAME: ${CLUSTER_NAME}"
31
31
echo " APP_NAME: ${APP_NAME} "
32
32
echo " TASK_DEFINITION_ARN: ${TASK_ARN} "
33
33
echo -n " STATUS: "
34
+
35
+ # Check if cluster type is fargate
36
+ if [[ " $SERVICE_TYPE " == " FARGARTE" ]]; then
37
+ TASK_ID=$( aws ecs run-task \
38
+ --cluster $CLUSTER_NAME \
39
+ --task-definition $TASK_ARN \
40
+ --network-configuration " awsvpcConfiguration={subnets=[${SUBNETS} ]" \
41
+ --launch-type FARGATE \
42
+ --query=" tasks[0].taskArn" \
43
+ --output=text)
44
+ else
34
45
TASK_ID=$( aws ecs run-task \
35
46
--cluster $CLUSTER_NAME \
36
47
--task-definition $TASK_ARN \
37
48
--query=" tasks[0].taskArn" \
38
49
--output=text)
50
+ fi
39
51
40
52
sleep 5
41
53
You can’t perform that action at this time.
0 commit comments