Skip to content

Commit

Permalink
Pass lookupRoleArn to NestedStackSynthesizerfrom parent Stack
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioAcunaF committed May 17, 2023
1 parent 28914bd commit 682bb86
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/core/lib/stack-synthesizers/nested.ts
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

0 comments on commit 682bb86

Please sign in to comment.