aws / aws/aws-toolkit-azure-devops
Validation issues with LambdaDeployFunction@1 and multiple layers
- Dominant language
- TypeScript
- Stars
- 258
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
Description
There is a regular expression that validates the layer arn's on the LambdaDeployFunction@1 task, however this regular expression doesn't seem to deal with multiple layers being specified in the task (or I am doing it wrong). Below is the task I have and error I am seeing
`
task: LambdaDeployFunction@1
inputs:
awsCredentials: 'mobiledbsync-dev'
regionName: 'ap-southeast-2'
deploymentMode: 'codeandconfiguration'
functionName: 'mobiledbsync-pg2sqlite'
functionHandler: 'Postgress2Sqlite.lambda_handler'
runtime: 'python3.8'
codeLocation: 'localfile'
localZipFile: '$(Build.ArtifactStagingDirectory)/package.zip'
roleARN: 'arn:aws:iam::removed:role/mobiledbsync-role'
subnets: subnet-removed
outputVariable: lambda_arn
securityGroups: sg-removed
layers:
arn:aws:lambda:ap-southeast-2:817496625479:layer:AWSLambda-Python38-SciPy1x:107
arn:aws:lambda:ap-southeast-2:898466741470:layer:psycopg2-py38:1
timeout: 300
`
and the error I am seeing
`##[error]Error: Error while updating function configuration: ValidationException: 1 validation error detected: Value '[arn:aws:lambda:ap-southeast-2:817496625479:layer:AWSLambda-Python38-SciPy1x:107 arn:aws:lambda:ap-southeast-2:898466741470:layer:psycopg2-py38:1]' 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]`
Contributor guide
Research direction
Start at the LambdaDeployFunction@1 task's layers input validation and reproduce the reported configuration with the two layer ARNs shown. Trace how multiple layer values are parsed and validated; done means valid multiple layer ARNs are accepted and the function configuration update succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, azure, typescript
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100