-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure-ecs.sh
41 lines (35 loc) · 1.25 KB
/
configure-ecs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e
PROFILE_NAME=config1
CLUSTER_NAME=config1
REGION=ap-south-1
LAUNCH_TYPE=EC2
AWS_ACCESS_KEY_ID="AKIAXTPNKYVY24YU257J"
AWS_SECRET_ACCESS_KEY='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'
ecs-cli configure profile --profile-name "$PROFILE_NAME" --access-key "$AWS_ACCESS_KEY_ID" --secret-key "$AWS_SECRET_ACCESS_KEY"
# will create new vpc, security group, and subnets
# https://dev.to/raphaelmansuy/10-minutes-to-deploy-a-docker-compose-stack-on-aws-illustrated-with-hasura-and-postgres-3f6e
ecs-cli up \
--keypair 'kashett2' \
--capability-iam \
--size 2 \
--instance-type t2.xlarge \
--tags project=config1 \
--cluster-config config1 \
--ecs-profile config1
ecs-cli up \
--keypair 'kashett2' \
--size 2 \
--instance-type t2.xlarge \
--tags project=config1 \
--cluster-config config1 \
--ecs-profile config1 \
--instance-role ecsInstanceRole \
--security-group sg-02211c58e4109228b \
--vpc vpc-4ebdb226 \
--subnets subnet-4fa79327,subnet-7ea4c132 \
--launch-type EC2
ecs-cli compose --project-name config1 --file docker-compose.yml \
--debug service up \
--deployment-max-percent 100 --deployment-min-healthy-percent 0 \
--region ap-south-1 --ecs-profile config1 --cluster-config config1