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

feat(toolkit-lib): bootstrap action #63

Merged
merged 48 commits into from
Mar 3, 2025

Conversation

iankhou
Copy link
Contributor

@iankhou iankhou commented Feb 19, 2025

Fixes aws/aws-cdk#33180. Typed return will be included in a follow-up PR.

Description:

Bootstrap Action for the CDK Toolkit.

Testing:

  • Unit test coverage for:
    • Bootstrap stack creation
    • No-op (no stack changes)
    • Generic bootstrap error
    • Permissions error during bootstrap
  • Bootstrapped an environment in a test account using this code

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@iankhou iankhou self-assigned this Feb 19, 2025
@iankhou iankhou requested review from mrgrain and kaizencc February 19, 2025 03:34
@iankhou iankhou changed the title Iankhou toolkit bootstrap feat(toolkit-lib): bootstrap action Feb 19, 2025
/**
* Bootstrap Action
*/
public async bootstrap(cx: ICloudAssemblySource, options: BootstrapEnvironmentOptions = {}): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This action has a slightly different syntax. It's an environment based action that takes in a list of environment strings.

There is an option to read environments from a provided cx (see defineEnvironments` in the current code). But I'm wondering if we should instead provide this as a helper function that can be called "outside".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added userEnvironmentSpecs, which, when empty, will select all environments from all stacks (like deploy).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the new interface, the function must be called with either environments or cx.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just kidding, I created a new class called BootstrapEnvironments that takes in either a cx or list of envs.

@mrgrain mrgrain deployed to integ-approval March 3, 2025 17:49 — with GitHub Actions Active
@mrgrain mrgrain deployed to run-tests March 3, 2025 20:44 — with GitHub Actions Active
@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Mar 3, 2025
Merged via the queue into main with commit faa2de0 Mar 3, 2025
20 checks passed
@aws-cdk-automation aws-cdk-automation deleted the iankhou-toolkit-bootstrap branch March 3, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toolkit Action: bootstrap incl. typed return
4 participants