aws-toolkit-azure-devops icon indicating copy to clipboard operation
aws-toolkit-azure-devops copied to clipboard

Validation issues with LambdaDeployFunction@1 and multiple layers

Open karlfcnsw opened this issue 1 year ago • 1 comments

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]

karlfcnsw avatar Oct 16 '22 22:10 karlfcnsw

however this regular expression doesn't seem to deal with multiple layers being specified in the task

Yeah this looks like the case. Marking this as a feature request for now.

JadenSimon avatar Oct 24 '22 16:10 JadenSimon