-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws
More file actions
80 lines (64 loc) · 1.98 KB
/
aws
File metadata and controls
80 lines (64 loc) · 1.98 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# run veilid
cd $(dirname $0); set -xe
#bash build.sh >/dev/null 2>&1
#docker volume rm aws-cli
docker volume create aws-cli
docker rm -f aws-cli || true
docker run --rm -it --env-file env.sh -v aws-cli:/root/.aws/ --name aws-cli aws-cli:latest $@
exit $?
# describe clusters
aws ecs describe-clusters \
--cluster $cluster
# describe task
aws ecs describe-tasks \
--cluster $cluster \
--tasks $task | grep enableExecuteCommand
# enable container exec
aws ecs update-service \
--cluster $cluster \
--service $service \
--task-definition $task_definition \
--force-new-deployment \
--enable-execute-command
# disable container exec
aws ecs update-service \
--cluster $cluster \
--service $service \
--task-definition $task_definition \
--force-new-deployment \
--disable-execute-command
# container exec
aws ecs execute-command \
--cluster $cluster \
--task $task \
--container $container \
--interactive \
--command "/bin/bash"
# enable and exec
source env.sh; bash aws ecs update-service \
--cluster $cluster \
--service $service \
--task-definition $task_definition \
--force-new-deployment \
--enable-execute-command \
&& bash aws ecs execute-command \
--cluster $cluster \
--task $task \
--container $container \
--interactive \
--command "/bin/bash"
# exec checker
bash <( curl -Ls https://raw.githubusercontent.com/aws-containers/amazon-ecs-exec-checker/main/check-ecs-exec.sh ) $cluster $task
# django sqlsequencereset
apt update && apt install -y postgresql-client
python manage.py sqlsequencereset fcm_django | python manage.py dbshell
# reboot aws rds
aws rds reboot-db-instance \
--db-instance-identifier $db_instance_identifier
# get rsa info
aws rds describe-db-instances \
--db-instance-identifier $db_instance_identifier | grep DBInstanceStatus
# get rds status
aws rds describe-db-instances \
--db-instance-identifier $db_instance_identifier | jq .DBInstances.[0].DBInstanceStatus