Skip to content

Validation issues with LambdaDeployFunction@1 and multiple layers #487

@karlfcnsw

Description

@karlfcnsw

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions