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

Improve CDK spoke account handling #9269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ password for the `jwt_secret` key. You can use the following command to generate
$ cdk bootstrap --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess
```

The CDK will attempt to bootstrap the main account and all spoke accounts: re-run the bootstrap for each account required with appropriate credentials.

### Preparing the CDK Environment

At this point you can now synthesize the CloudFormation template for this code.
Expand All @@ -104,10 +106,10 @@ $ cdk deploy ConsoleMeECS
```

Then, deploy the trust role to the spoke accounts.
While logged in to each spoke account, deploy `ConsoleMeSpoke` stack:
While logged in to each spoke account, deploy required `ConsoleMeSpoke-${SPOKE_ACCOUNT_ID}` stacks:

```
$ cdk deploy ConsoleMeSpoke
$ cdk deploy "ConsoleMeSpoke-${SPOKE_ACCOUNT_ID}"
```

Don't forget to approve the template and security resources before the deployment.
Expand Down
2 changes: 1 addition & 1 deletion cdk/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
account=spoke_account_id, region=os.getenv("AWS_REGION")
)
spoke_stack = ConsolemeSpokeAccountsStack(
app, SPOKE_BASE_NAME, env=spoke_environment
app, f"{SPOKE_BASE_NAME}-{spoke_account_id}", env=spoke_environment
) # Spoke account stack

consoleme_ecs_service_stack = ConsolemeEcsServiceStack(
Expand Down