fix(instance-metadata): Credentials recovering (#1207)

* fix(instance-metadata): Credentials recovering

* fix(expr): Dockerfile to root and expr in SESSION_TIME_REMAINING.

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
Sergio Garcia
2022-06-17 14:23:56 +02:00
committed by GitHub
parent 3944ea2055
commit 633d7bd8a8
8 changed files with 46 additions and 23 deletions
+10 -5
View File
@@ -72,6 +72,9 @@ validate_organizations() {
# Set the new account to assume to recover AWS Organizations Metadata
ACCOUNT_TO_ASSUME="${MANAGEMENT_ACCOUNT_ID}"
# Assume role to recover AWS Organizations metadata
assume_role
# Recover AWS Organizations Metadata
get_orgs_account_details
@@ -81,12 +84,14 @@ validate_organizations() {
# Restoring initial credentials
restoreInitialAWSCredentials
fi
}
if [[ -n "${ACCOUNT_TO_ASSUME}" || -n "${ROLE_TO_ASSUME}" ]]
then
backupInitialAWSCredentials
assume_role
fi
validate_assume_role() {
if [[ -n "${ACCOUNT_TO_ASSUME}" || -n "${ROLE_TO_ASSUME}" ]]
then
backupInitialAWSCredentials
assume_role
fi
}
# JUnit output if -M junit-xml