Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: step 4 #29

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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