Max length char of 140 for layers arn in `lambda update-function-configuration --layers` command
- Dominant language
- Python
- Stars
- 17.3k
- Forks
- 4.6k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 13
Description
### Describe the bug
Cannot update the many layers from a lambda function using cli if more than one layer is used.
Also, cannot update layers incrementally since the command replaces all layers at once, so if the layer ARN is not provided it will be removed from the lambda.
### Expected Behavior
Expected to all layers provided in the sequence to be added/updated to the function.
### Current Behavior
The following error is shown:
```
An error occurred (ValidationException) when calling the UpdateFunctionConfiguration operation: 1 validation error detected: Value 'FULL_LAYER_ARN_1,FULL_LAYER_ARN_2' at 'layers' failed to satisfy constraint: Member must satisfy constraint: [Member must have length less than or equal to 140, Member must have length greater than or equal to 1, Member must satisfy regular expression pattern: (arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+)|(arn:[a-zA-Z0-9-]+:lambda:::awslayer:[a-zA-Z0-9-_]+), Member must not be null]
```
### Reproduction Steps
While trying to update the layers from a given lambda function with the following command:
```
aws lambda update-function-configuration --function-name FUNCTION_NAME --layers FULL_LAYER_ARN_1,FULL_LAYER_ARN_2
```
Use 2 or more layers in the same call and the error will show.
### Possible Solution
Allow to use more than 140 chars in the layers parameter if the parameter is a comma separated value, meaning there are multiple layer ARNs being provided.
### Additional Information/Context
_No response_
### CLI version used
aws-cli/2.13.26
### Environment details (OS name and version, etc.)
Python/3.11.6 Darwin/23.0.0 source/arm64
Contributor guide
Assessment
This issue has not been assessed yet.