Loading build_and_push.sh +6 −1 Original line number Diff line number Diff line Loading @@ -64,12 +64,17 @@ cd .. || { echo "Error: no se pudo volver al directorio principal."; exit 1; } echo "Construyendo la imagen Docker..." DOCKER_DEFAULT_PLATFORM=linux/amd64 docker-compose build || { echo "Error en la construcción de la imagen Docker."; exit 1; } # Pedir al usuario el ARN de MFA read -p "Introduce el ID de cuenta de AWS (ej. 230672794366): " AWS_ACCOUNT_ID read -p "Introduce el nombre del dispositivo MFA (ej. google_authenticator_phone): " MFA_DEVICE MFA_ARN="arn:aws:iam::$AWS_ACCOUNT_ID:mfa/$MFA_DEVICE" # Autenticación MFA con AWS para obtener un token temporal read -p "Introduce el código MFA de 6 dígitos: " MFA_CODE # Obtener un token temporal usando MFA echo "Autenticando con AWS usando MFA..." MFA_ARN="arn:aws:iam::230970400116:mfa/authentication_iphone" # Cambia esto si el ARN de tu dispositivo MFA es diferente TEMP_CREDS=$(aws sts get-session-token --serial-number "$MFA_ARN" --token-code "$MFA_CODE" --output json) if [ -z "$TEMP_CREDS" ]; then Loading Loading
build_and_push.sh +6 −1 Original line number Diff line number Diff line Loading @@ -64,12 +64,17 @@ cd .. || { echo "Error: no se pudo volver al directorio principal."; exit 1; } echo "Construyendo la imagen Docker..." DOCKER_DEFAULT_PLATFORM=linux/amd64 docker-compose build || { echo "Error en la construcción de la imagen Docker."; exit 1; } # Pedir al usuario el ARN de MFA read -p "Introduce el ID de cuenta de AWS (ej. 230672794366): " AWS_ACCOUNT_ID read -p "Introduce el nombre del dispositivo MFA (ej. google_authenticator_phone): " MFA_DEVICE MFA_ARN="arn:aws:iam::$AWS_ACCOUNT_ID:mfa/$MFA_DEVICE" # Autenticación MFA con AWS para obtener un token temporal read -p "Introduce el código MFA de 6 dígitos: " MFA_CODE # Obtener un token temporal usando MFA echo "Autenticando con AWS usando MFA..." MFA_ARN="arn:aws:iam::230970400116:mfa/authentication_iphone" # Cambia esto si el ARN de tu dispositivo MFA es diferente TEMP_CREDS=$(aws sts get-session-token --serial-number "$MFA_ARN" --token-code "$MFA_CODE" --output json) if [ -z "$TEMP_CREDS" ]; then Loading