-
Notifications
You must be signed in to change notification settings - Fork 4k
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(lambda): add tracingConfig
property to a Function
#32320
base: main
Are you sure you want to change the base?
Conversation
tracingConfig
property to a Function
* | ||
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.html#cfn-lambda-function-tracingconfig-mode | ||
*/ | ||
readonly tracingConfig?: TracingConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tracingConfig
property of L1 Construct has the following type
export interface TracingConfigProperty {
readonly mode?: string;
}
public tracingConfig?: cdk.IResolvable | CfnFunction.TracingConfigProperty;
However, the type of the mode
property of this CfnFunction.TracingConfigProperty
is not strict, so L2 Construct does not use CfnFunction.TracingConfigProperty
.
Instead, I have a more strict type (a type that uses enum for the mode
property) and specify it.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
[2024-12-02T23:56:35.036] [ERROR] jsii/compiler - Type model errors prevented the JSII assembly from being created
warning JSII6: A "peerDependency" on "constructs" at "^10.0.0" means you should take a "devDependency" on "constructs" at "10.0.0" (found "^10.0.0")
aws-apigateway/lib/domain-name.ts:132:19 - warning JSII5019: The property name "domainName" conflicts with the declaring class "DomainName". This will result in renaming the class to "_DomainName" in C#. Consider renaming "domainName".
132 public readonly domainName: string;
~~~~~~~~~~
aws-apigateway/lib/domain-name.ts:117:14
117 export class DomainName extends Resource implements IDomainName {
~~~~~~~~~~
The declaring class is introduced here
aws-apigateway/lib/gateway-response.ts:217:19 - warning JSII5019: The property name "responseType" conflicts with the declaring class "ResponseType". This will result in renaming the class to "_ResponseType" in C#. Consider renaming "responseType". I don't think this is an error caused by the code I added, but it doesn't seem to happen on the main branch... 🤔 (Error when running build after making changes to |
Reason for this change
We can set a
tracingConfig
for an Function(Lambda) from cloudformation, but this was not supported in the AWS CDK L2 construct.Description of changes
Add
tracingConfig
property to FunctionProps and set it in the CfnFunction.Description of how you validated changes
Added both unit and integration tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license