Skip to content
v2.277.0

CodeSigningConfigProps Struct ​

Construction properties for a Code Signing Config object.

Example ​

ts
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_LATEST,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
});
python
import aws_cdk.aws_signer as signer


signing_profile = signer.SigningProfile(self, "SigningProfile",
    platform=signer.Platform.AWS_LAMBDA_SHA384_ECDSA
)

code_signing_config = lambda_.CodeSigningConfig(self, "CodeSigningConfig",
    signing_profiles=[signing_profile]
)

lambda_.Function(self, "Function",
    code_signing_config=code_signing_config,
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    code=lambda_.Code.from_asset(path.join(__dirname, "lambda-handler"))
)
java
import software.amazon.awscdk.services.signer.*;


SigningProfile signingProfile = SigningProfile.Builder.create(this, "SigningProfile")
        .platform(Platform.AWS_LAMBDA_SHA384_ECDSA)
        .build();

CodeSigningConfig codeSigningConfig = CodeSigningConfig.Builder.create(this, "CodeSigningConfig")
        .signingProfiles(List.of(signingProfile))
        .build();

Function.Builder.create(this, "Function")
        .codeSigningConfig(codeSigningConfig)
        .runtime(Runtime.NODEJS_LATEST)
        .handler("index.handler")
        .code(Code.fromAsset(join(__dirname, "lambda-handler")))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.Signer;


var signingProfile = new SigningProfile(this, "SigningProfile", new SigningProfileProps {
    Platform = Platform.AWS_LAMBDA_SHA384_ECDSA
});

var codeSigningConfig = new CodeSigningConfig(this, "CodeSigningConfig", new CodeSigningConfigProps {
    SigningProfiles = new [] { signingProfile }
});

new Function(this, "Function", new FunctionProps {
    CodeSigningConfig = codeSigningConfig,
    Runtime = Runtime.NODEJS_LATEST,
    Handler = "index.handler",
    Code = Code.FromAsset(Join(__dirname, "lambda-handler"))
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"


signingProfile := signer.NewSigningProfile(this, jsii.String("SigningProfile"), &SigningProfileProps{
	Platform: signer.Platform_AWS_LAMBDA_SHA384_ECDSA(),
})

codeSigningConfig := lambda.NewCodeSigningConfig(this, jsii.String("CodeSigningConfig"), &CodeSigningConfigProps{
	SigningProfiles: []ISigningProfile{
		signingProfile,
	},
})

lambda.NewFunction(this, jsii.String("Function"), &FunctionProps{
	CodeSigningConfig: CodeSigningConfig,
	Runtime: lambda.Runtime_NODEJS_LATEST(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
})

Properties ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
Code signing configuration description.

Default: No description.

signingProfilesISigningProfile[]signing_profilestyping.List[ISigningProfile]signingProfilesList<ISigningProfile>SigningProfilesISigningProfile[]SigningProfiles*[]ISigningProfilerequired#
List of signing profiles that defines a trusted user who can sign a code package.
untrustedArtifactOnDeploymentoptionalUntrustedArtifactOnDeploymentuntrusted_artifact_on_deploymentoptionalUntrustedArtifactOnDeploymentuntrustedArtifactOnDeploymentoptionalUntrustedArtifactOnDeploymentUntrustedArtifactOnDeploymentoptionalUntrustedArtifactOnDeploymentUntrustedArtifactOnDeploymentoptionalUntrustedArtifactOnDeployment#
Code signing configuration policy for deployment validation failure.

Default: UntrustedArtifactOnDeployment.WARN

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.