putProvisionedConcurrencyConfig method
Adds a provisioned concurrency configuration to a function's alias or version.
May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw ResourceConflictException. May throw TooManyRequestsException. May throw ServiceException.
Parameter functionName
:
The name of the Lambda function.
Name formats
-
Function name -
my-function
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN -
123456789012:function:my-function
.
Parameter provisionedConcurrentExecutions
:
The amount of provisioned concurrency to allocate for the version or
alias.
Parameter qualifier
:
The version number or alias name.
Implementation
Future<PutProvisionedConcurrencyConfigResponse>
putProvisionedConcurrencyConfig({
required String functionName,
required int provisionedConcurrentExecutions,
required String qualifier,
}) async {
ArgumentError.checkNotNull(functionName, 'functionName');
_s.validateStringLength(
'functionName',
functionName,
1,
140,
isRequired: true,
);
ArgumentError.checkNotNull(
provisionedConcurrentExecutions, 'provisionedConcurrentExecutions');
_s.validateNumRange(
'provisionedConcurrentExecutions',
provisionedConcurrentExecutions,
1,
1152921504606846976,
isRequired: true,
);
ArgumentError.checkNotNull(qualifier, 'qualifier');
_s.validateStringLength(
'qualifier',
qualifier,
1,
128,
isRequired: true,
);
final $query = <String, List<String>>{
'Qualifier': [qualifier],
};
final $payload = <String, dynamic>{
'ProvisionedConcurrentExecutions': provisionedConcurrentExecutions,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/2019-09-30/functions/${Uri.encodeComponent(functionName)}/provisioned-concurrency',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return PutProvisionedConcurrencyConfigResponse.fromJson(response);
}