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: Added method addMetadata for singleton lambda construct tree #31040

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 9 additions & 1 deletion packages/aws-cdk-lib/aws-lambda/lib/singleton-lambda.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Construct, IConstruct, IDependable, Node } from 'constructs';
import { Construct, IConstruct, IDependable, Node, MetadataOptions } from 'constructs';
import { Architecture } from './architecture';
import { Function as LambdaFunction, FunctionProps, EnvironmentOptions } from './function';
import { FunctionBase } from './function-base';
Expand Down Expand Up @@ -155,6 +155,14 @@ export class SingletonFunction extends FunctionBase {
this.lambdaFunction.node.addDependency(...up);
}

/**
* Use addMetaData() to write CDK Metadata to Construct tree. View modification in Cloud Assembly manifest.json.
* Not written to CloudFormation template.
*/
public addMetadata(type: string, data: any, options?: MetadataOptions) {
this.lambdaFunction.node.addMetadata(type, data, options);
}

/**
* The SingletonFunction construct cannot be added as a dependency of another construct using
* node.addDependency(). Use this method instead to declare this as a dependency of another construct.
Expand Down
Loading