Closed angelabad closed 7 years ago
Hi @angelabad - could you run the provision
command with the --noop
flag and post the resulting JSON fragment from the CloudFormation template (found in the ./.sparta) directory that specifies the function name? While I'm looking at the issue, can you work around the issue if you specify the SpartaOptions.Name field in the function options? TIA.
Hi @mweagle, I attach entire json file (I removed sensitive info). In the document I can see:
"FunctionName": "main.echoTelegram",
Could be a a problem with "." (dot)? I say this because regular expression pattern (arn:(aws|aws-us-gov):lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-]+)(:($LATEST|[a-zA-Z0-9-]+))
UnsplashTelegramBot_Devel-cftemplate.json.txt
Cheers, and thanks for your answers.
Hi again @mweagle, If you go to aws web interface and try to create a new lambda function, if you include a dot "." in the name youll get the following error:
Function name must contain only letters, numbers, hyphens, or underscores
So, I think the problem is with . in function name
Thanks in advance!
Yep - I see that. Will have a fix shortly. tyvm for reporting.
Hi, it seem now works fine, but, now the lambda funcition has this name:
main-echoTelegram
with no random or unique parts, so if I upload to test another version of the lambda this will have the same name and it will fails again, isnt it?
Cheers,
Yes - confirmed that in local testing and next release will address that by prefixing the Lambda FunctionName with the CloudFormation StackName to ensure stable uniqueness.
@angelabad - Can you please regress with https://github.com/mweagle/Sparta/blob/master/CHANGES.md#v0131 and LMK if this resolves your issue? TIA.
It seems solved with 0.13.2, now lambda function name is:
UnsplashTelegramBot-Devel-main_echoTelegram
Prefixed with stackname.
Thanks a lot!
👍
Hi, when I try to provision I get the following error:
INFO[0052] Waiting for CloudFormation operation to complete ERRO[0072] Stack provisioning error
ERRO[0072] Error ensuring AWS::Lambda::Function (mainechoTelegramLambda49b221dc927b24011fc3b6f33f28182f47de5242): 1 validation error detected: Value 'main.echoTelegram' at 'functionName' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws|aws-us-gov):lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-]+)(:(\$LATEST|[a-zA-Z0-9-]+))? INFO[0072] Invoking rollback functions RollbackCount=2
You can see repo code at: https://github.com/angelabad/unsplash-telegram-bot/tree/develop
Thanks in advance!