awslabs / aws-api-gateway-developer-portal

A Serverless Developer Portal for easily publishing and cataloging APIs
Apache License 2.0
927 stars 399 forks source link

When deploy getting this error,"CognitoPostConfirmationTriggerFn' at 'functionName' failed to satisfy constraint: Member must have length less than or equal to 64 " #425

Closed wingleungaus closed 4 years ago

wingleungaus commented 4 years ago

Hi, I am trying to deploy the dev portal so many time but every time I am getting this error.

1 validation error detected: Value 'serverlessrepo-api-gateway-dev-portal-CognitoPostConfirmationTriggerFn' at 'functionName' failed to satisfy constraint: Member must have length less than or equal to 64 (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException;

Can anyone shed any light on this, please?

ramtejs commented 4 years ago

@wingleungaus its due to length of lambda function name, try to reduce the stack name and it should be good to go.

ghost commented 4 years ago

This is correct. The error is legitimate, and is a limitation of the current template implementation.

Try to keep your stack name under 64 - 35 = 29 characters ("-CognitoPostAuthenticationTriggerFn", the longest Lambda name suffix, occupies 35 characters, hence where that comes from), and you should be able to use it without error.

wingleungaus commented 4 years ago

Thanks very much. Finally got it deployed. I was using the default name.

alytle commented 3 years ago

This probably should not be closed, the default Stack Name when deployed from SAR is serverlessrepo-api-gateway-dev-portal which results in this error.

p-dealwis commented 2 years ago

If you are using the SAR you can change the default Application Name to something smaller, just a temp fix to make it work for now

chrispward commented 2 years ago

I was trying this yesterday. Its actually < 12 usable characters you can use for the name as 'serverlessrepo' keeps getting prefixed. Be better if this didnt to allow better names.