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(core): add description to exportValue and exportStringListValue methods #29150

Merged
merged 7 commits into from
Feb 23, 2024
Merged
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions packages/aws-cdk-lib/core/lib/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,7 @@ export class Stack extends Construct implements ITaggable {
new CfnOutput(this, `Export${options.name}`, {
value: exportedValue,
exportName: options.name,
description: options.description,
});
return Fn.importValue(options.name);
}
Expand All @@ -1215,6 +1216,7 @@ export class Stack extends Construct implements ITaggable {
new CfnOutput(exportsScope, id, {
value: Token.asString(exportable),
exportName,
description: options.description,
});
}

Expand Down Expand Up @@ -1253,6 +1255,7 @@ export class Stack extends Construct implements ITaggable {
new CfnOutput(this, `Export${options.name}`, {
value: Fn.join(STRING_LIST_REFERENCE_DELIMITER, exportedValue),
exportName: options.name,
description: options.description,
});
return Fn.split(STRING_LIST_REFERENCE_DELIMITER, Fn.importValue(options.name));
}
Expand All @@ -1268,6 +1271,7 @@ export class Stack extends Construct implements ITaggable {
// (string lists are invalid)
value: Fn.join(STRING_LIST_REFERENCE_DELIMITER, Token.asList(exportable)),
exportName,
description: options.description,
});
}

Expand Down Expand Up @@ -1766,6 +1770,13 @@ export interface ExportValueOptions {
* @default - A name is automatically chosen
*/
readonly name?: string;

/**
* The description of the outputs
*
* @default - No description
*/
readonly description?: string;
}

function count(xs: string[]): Record<string, number> {
Expand Down