We deploy our Lambda functions using the AWS CDK and need to sign all Lambda code with a single, existing signing profile. While I understand how to create and apply a new signing profile within a Lambda's definition, this approach doesn't meet our needs. Instead, we want to utilize an already existing signing profile.
Here's how we currently apply a new signing profile:
SigningProfile signingProfile = SigningProfile.Builder.create(this, "SigningProfile-resId")
.platform(Platform.AWS_LAMBDA_SHA384_ECDSA)
.build();
CodeSigningConfig codeSigningConfig = CodeSigningConfig.Builder.create(this, "codeSigningConfig-resId")
.signingProfiles(List.of(signingProfile))
.build();
return Function.Builder.create(this, functionName)
.runtime(----)
.architecture(---)
.handler(handler)
.code(----)
.codeSigningConfig(codeSigningConfig)
.memorySize(memorySize)
.role(functionRole)
.timeout(Duration.seconds(timeoutInSeconds))
.environment(functionEnvironmentVariables)
.description(description)
.build();
How can we modify this to use an existing signing profile instead of creating a new one?