Skip to content

Commit

Permalink
mid work
Browse files Browse the repository at this point in the history
  • Loading branch information
iliapolo committed Sep 12, 2024
1 parent b24e879 commit fc455f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ export class DefaultStackSynthesizer extends StackSynthesizer implements IReusab
* Synthesize the stack template to the given session, passing the configured lookup role ARN
*/
protected synthesizeStackTemplate(stack: Stack, session: ISynthesisSession) {
stack._synthesizeTemplate(session, this.lookupRoleArn);
stack._synthesizeTemplate(session, this.lookupRoleArn, this.props.lookupRoleAdditionalOptions);
}

/**
Expand All @@ -490,7 +490,7 @@ export class DefaultStackSynthesizer extends StackSynthesizer implements IReusab
this.addBootstrapVersionRule(this._requiredBootstrapVersionForDeployment, this.bootstrapStackVersionSsmParameter!);
}

const templateAssetSource = this.synthesizeTemplate(session, this.lookupRoleArn);
const templateAssetSource = this.synthesizeTemplate(session, this.lookupRoleArn, this.props.lookupRoleAdditionalOptions);
const templateAsset = this.addFileAsset(templateAssetSource);

const assetManifestId = this.assetManifest.emitManifest(this.boundStack, session, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ export abstract class StackSynthesizer implements IStackSynthesizer {
* the credentials will be the same identity that is doing the `UpdateStack`
* call, which may not have the right permissions to write to S3.
*/
protected synthesizeTemplate(session: ISynthesisSession, lookupRoleArn?: string): FileAssetSource {
this.boundStack._synthesizeTemplate(session, lookupRoleArn);
protected synthesizeTemplate(session: ISynthesisSession, lookupRoleArn?: string,
lookupRoleAdditionalOptions?: { [key: string]: any }): FileAssetSource {
this.boundStack._synthesizeTemplate(session, lookupRoleArn, lookupRoleAdditionalOptions);
return stackTemplateFileAsset(this.boundStack, session);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/core/lib/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ export class Stack extends Construct implements ITaggable {
* Synthesizes the cloudformation template into a cloud assembly.
* @internal
*/
public _synthesizeTemplate(session: ISynthesisSession, lookupRoleArn?: string): void {
public _synthesizeTemplate(session: ISynthesisSession, lookupRoleArn?: string, lookupRoleAdditionalOptions?: { [key: string]: any }): void {
// In principle, stack synthesis is delegated to the
// StackSynthesis object.
//
Expand Down Expand Up @@ -1105,7 +1105,7 @@ export class Stack extends Construct implements ITaggable {

for (const ctx of this._missingContext) {
if (lookupRoleArn != null) {
builder.addMissing({ ...ctx, props: { ...ctx.props, lookupRoleArn } });
builder.addMissing({ ...ctx, props: { ...ctx.props, lookupRoleArn, ...(lookupRoleAdditionalOptions ?? {}) } });
} else {
builder.addMissing(ctx);
}
Expand Down

0 comments on commit fc455f1

Please sign in to comment.