1. ALB DNS 조회

aws elbv2 describe-load-balancers --query 'LoadBalancers[*].DNSName' --output text

2. ALB DNS 환경변수 설정

export ALB_DNS="skills-server-alb-868926070.ap-northeast-2.elb.amazonaws.com"

3. Secrets Manager 목록 조회

aws secretsmanager list-secrets --query 'SecretList[*].Name' --output text

4. 진짜 비밀번호 조회

aws secretsmanager get-secret-value --secret-id '위 명령어로 나온 ID' --query SecretString --output text

5. 환경변수 설정

export MYSQL_USER="admin"
export MYSQL_PASSWORD="위 명령어에서 나온 password"

6. 실제 DB 이름 조회

mysql -h $MYSQL_HOST -u admin -p'LHeJ-hyhhSs?q:QPYJ8ndp18tpqD' -e "SHOW DATABASES;"

7. DB 이름 환경변수 설정

export MYSQL_DBNAME="skills"

8. 앱 재시작

pkill -f app.py
nohup python3 app.py &

9. 확인

curl -X POST "http://$ALB_DNS/v1/user" \\
  -H "Content-Type: application/json" \\
  -d '{"name": "kim", "age": "19", "country": "korea"}'

sudo dnf install mariadb105-server -y

sudo systemctl start mariadb sudo systemctl enable mariadb

sudo systemctl status mariadb