aws-cdk-lib.aws_lambda.CodeSigningConfig

class CodeSigningConfig (construct)

LanguageType name
.NETAmazon.CDK.AWS.Lambda.CodeSigningConfig
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambda#CodeSigningConfig
Javasoftware.amazon.awscdk.services.lambda.CodeSigningConfig
Pythonaws_cdk.aws_lambda.CodeSigningConfig
TypeScript (source)aws-cdk-lib » aws_lambda » CodeSigningConfig

Implements IConstruct, IDependable, IResource, ICodeSigningConfig

Defines a Code Signing Config.

Example

import * as signer from 'aws-cdk-lib/aws-signer';

const signingProfile = new signer.SigningProfile(this, 'SigningProfile', {
  platform: signer.Platform.AWS_LAMBDA_SHA384_ECDSA,
});

const codeSigningConfig = new lambda.CodeSigningConfig(this, 'CodeSigningConfig', {
  signingProfiles: [signingProfile],
});

new lambda.Function(this, 'Function', {
  codeSigningConfig,
  runtime: lambda.Runtime.NODEJS_18_X,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
});

Initializer

new CodeSigningConfig(scope: Construct, id: string, props: CodeSigningConfigProps)

Parameters

  • scope Construct
  • id string
  • props CodeSigningConfigProps

Construct Props

NameTypeDescription
signingProfilesISigningProfile[]List of signing profiles that defines a trusted user who can sign a code package.
description?stringCode signing configuration description.
untrustedArtifactOnDeployment?UntrustedArtifactOnDeploymentCode signing configuration policy for deployment validation failure.

signingProfiles

Type: ISigningProfile[]

List of signing profiles that defines a trusted user who can sign a code package.


description?

Type: string (optional, default: No description.)

Code signing configuration description.


untrustedArtifactOnDeployment?

Type: UntrustedArtifactOnDeployment (optional, default: UntrustedArtifactOnDeployment.WARN)

Code signing configuration policy for deployment validation failure.

If you set the policy to Enforce, Lambda blocks the deployment request if signature validation checks fail. If you set the policy to Warn, Lambda allows the deployment and creates a CloudWatch log.

Properties

NameTypeDescription
codeSigningConfigArnstringThe ARN of Code Signing Config.
codeSigningConfigIdstringThe id of Code Signing Config.
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.

codeSigningConfigArn

Type: string

The ARN of Code Signing Config.


codeSigningConfigId

Type: string

The id of Code Signing Config.


env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
static fromCodeSigningConfigArn(scope, id, codeSigningConfigArn)Creates a Signing Profile construct that represents an external Signing Profile.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromCodeSigningConfigArn(scope, id, codeSigningConfigArn)

public static fromCodeSigningConfigArn(scope: Construct, id: string, codeSigningConfigArn: string): ICodeSigningConfig

Parameters

  • scope Construct — The parent creating construct (usually this).
  • id string — The construct's name.
  • codeSigningConfigArn string — The ARN of code signing config.

Returns

  • ICodeSigningConfig

Creates a Signing Profile construct that represents an external Signing Profile.