File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ DB_PASSWORD=
43
43
DB_NAME=
44
44
```
45
45
46
+ If the service type is **Fargate**, and you're using the `run-task.sh` script, please include:
47
+ ```bash
48
+ SERVICE_TYPE=FARGATE
49
+ SUBNETS=subnet1231231,subnet123123123,subnter123123123123
50
+ ```
51
+ Default values are: null
52
+
46
53
` task-definition.tpl.json ` (example)
47
54
``` json
48
55
{
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 " == " FARGATE" ]]; 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