Skip to content

Commit

Permalink
refactor: step 4 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgollucci authored Nov 18, 2024
1 parent 07fb6f6 commit 6457fbe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/p6lzctl
Original file line number Diff line number Diff line change
Expand Up @@ -384,21 +384,21 @@ p6_lz_run_phase_2_bootstrap_trust() {
local action="$1"

p6_h3 "Phase 2: Bootstrap Trust"
local mgmt_account_id=$(jq -r ".managementAccountId" cdk.context.json)
local management_account_id=$(jq -r ".managementAccountId" cdk.context.json)
local account_ids=$(jq -r 'to_entries[] | select(.key != "managementAccountId") | .value' cdk.context.json)
local account_id
for account_id in $account_ids; do
if [ "$action" = "deploy" ]; then
p6_aws_svc_organizations_sts_su $account_id
pnpm cdk bootstrap aws://$account_id/us-east-1 \
--trust $mgmt_account_id \
--trust-for-lookup $mgmt_account_id \
--trust $management_account_id \
--trust-for-lookup $management_account_id \
--cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess
p6_aws_svc_organizations_sts_su_un
else
echo pnpm cdk bootstrap aws://$account_id/us-east-1 \
--trust $mgmt_account_id \
--trust-for-lookup $mgmt_account_id \
--trust $management_account_id \
--trust-for-lookup $management_account_id \
--cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess
fi
done
Expand Down

0 comments on commit 6457fbe

Please sign in to comment.