Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work #14

Open
n3v3rd1e opened this issue Dec 7, 2020 · 2 comments
Open

Does not work #14

n3v3rd1e opened this issue Dec 7, 2020 · 2 comments

Comments

@n3v3rd1e
Copy link

n3v3rd1e commented Dec 7, 2020

Hello, I assume it must be a mistake on my side, as it seems to work for others, but I just really cannot find any.
I have serverless @1.74.1, is it maybe not compatible with this plugin?

layers:
      - arn:aws:lambda:eu-west-1:65435731276:layer:google-ads-api:latest
plugins:
  modules:
    - serverless-webpack
    - serverless-latest-layer-version
    - serverless-offline # @note must be last plugin

I'm getting the same error about name constraints as others.

e.g:
An error occurred: FLSLSDPersistLsdTestResultsLambdaLambdaFunction - 1 validation error detected: Value '[arn:aws:lambda:ap-southeast-2:xxxxxxxxxxxx:layer:oraclelib:latest]' 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-]+)] (Service: AWSLambdaInternal; Status Code: 400; Error Code: ValidationException; Request ID: 6b295596-80c7-425b-b8f3-7c03673b333c).

Is there anything more to do, than install the plugin and use it the serverless as I did?.
Thanks.

@holderl5
Copy link

holderl5 commented Apr 16, 2021

I am seeing this issue as well. The serverless command shows logs from the plugin:

Serverless: Excluding development dependencies...
Serverless: [serverless-latest-layer-version] Detected unknown Layer ARN arn:aws:lambda:eu-west-1:928616498424:layer:dev-my-shared-library:latest. Please create a new issue to github.com/mooyoul/serverless-latest-layer-version
Serverless: [serverless-latest-layer-version] Detected unknown Layer ARN arn:aws:lambda:eu-west-1:928616498424:layer:dev-my-shared-library:latest. Please create a new issue to github.com/mooyoul/serverless-latest-layer-version
Serverless: Uploading CloudFormation file to S3...

I am using the c-sharp-layer template from serverless guru examples:
https://github.com/serverless-guru/templates.git

@holderl5
Copy link

I had some time this morning and decided to play around with this to see if I could determine what is wrong. It seems like the version list coming back empty is the problem, but I am not entirely sure. I tried the edit below and at least I get a different error now and no longer get the warning, but I am not sure. Still looking.

async fetchLatestVersions(layerARNs) {
const dict = new Map();

for (const layerARN of layerARNs) {
  const version = await this.lookupLatestLayerVersionArn(layerARN);
		if ( !version ) {
			dict.set(layerARN, 'arn:aws:lambda:eu-west-1:REDACTED:layer:dev-my-shared-library:1');
		}
		else {
			dict.set(layerARN, version);
		}
		
}

return dict;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants