File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -212,3 +212,25 @@ is_management_account() {
212212 current_account=$( get_current_account)
213213 [[ " $current_account " == " $MANAGEMENT_ACCOUNT_ID " ]]
214214}
215+
216+ # Get account name/environment from account ID
217+ get_account_name () {
218+ local account_id=" $1 "
219+
220+ if [[ " $account_id " == " $DEV_ACCOUNT " ]]; then
221+ echo " Dev"
222+ elif [[ " $account_id " == " $STAGING_ACCOUNT " ]]; then
223+ echo " Staging"
224+ elif [[ " $account_id " == " $PROD_ACCOUNT " ]]; then
225+ echo " Prod"
226+ elif [[ " $account_id " == " $MANAGEMENT_ACCOUNT_ID " ]]; then
227+ echo " Management"
228+ else
229+ echo " Unknown"
230+ fi
231+ }
232+
233+ # Alias for compatibility with s3.sh
234+ get_env_name_for_account () {
235+ get_account_name " $1 "
236+ }
You can’t perform that action at this time.
0 commit comments