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

fix(cdk-lib): Pass lookupRoleArn to NestedStackSynthesizer #25625

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,13 @@ export class DefaultStackSynthesizer extends StackSynthesizer implements IReusab
return this.qualifier;
}

/**
* The role used to lookup for this stack
*/
public get lookupRole(): string | undefined {
return this.lookupRoleArn;
}

public bind(stack: Stack): void {
super.bind(stack);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ export class NestedStackSynthesizer extends StackSynthesizer {
public synthesize(session: ISynthesisSession): void {
// Synthesize the template, but don't emit as a cloud assembly artifact.
// It will be registered as an S3 asset of its parent instead.
this.synthesizeTemplate(session);
this.synthesizeTemplate(session, this.parentDeployment.lookupRole);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export abstract class StackSynthesizer implements IStackSynthesizer {
return undefined;
}

/**
* The role used to lookup for this stack
*/
public get lookupRole(): string | undefined {
return undefined;
}

private _boundStack?: Stack;

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/aws-cdk-lib/core/lib/stack-synthesizers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ export interface IStackSynthesizer {
*/
readonly bootstrapQualifier?: string;

/**
* The role used to lookup for this stack
*
* @default - no role
*/
readonly lookupRole?: string;

/**
* Bind to the stack this environment is going to be used on
*
Expand Down