putFunctionCodeSigningConfig method

Future<PutFunctionCodeSigningConfigResponse> putFunctionCodeSigningConfig({
  1. required String codeSigningConfigArn,
  2. required String functionName,
})

Update the code signing configuration for the function. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function.

May throw ServiceException. May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw TooManyRequestsException. May throw ResourceConflictException. May throw CodeSigningConfigNotFoundException.

Parameter codeSigningConfigArn : The The Amazon Resource Name (ARN) of the code signing configuration.

Parameter functionName : The name of the Lambda function.

Name formats

  • Function name - MyFunction.
  • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.
  • Partial ARN - 123456789012:function:MyFunction.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

Implementation

Future<PutFunctionCodeSigningConfigResponse> putFunctionCodeSigningConfig({
  required String codeSigningConfigArn,
  required String functionName,
}) async {
  ArgumentError.checkNotNull(codeSigningConfigArn, 'codeSigningConfigArn');
  _s.validateStringLength(
    'codeSigningConfigArn',
    codeSigningConfigArn,
    0,
    200,
    isRequired: true,
  );
  ArgumentError.checkNotNull(functionName, 'functionName');
  _s.validateStringLength(
    'functionName',
    functionName,
    1,
    140,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'CodeSigningConfigArn': codeSigningConfigArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/2020-06-30/functions/${Uri.encodeComponent(functionName)}/code-signing-config',
    exceptionFnMap: _exceptionFns,
  );
  return PutFunctionCodeSigningConfigResponse.fromJson(response);
}