amazon-archives / aws-waf-sample

This repository contains example scripts and sets of rules for the AWS WAF service. Please be aware that the applicability of these examples to specific workloads may vary.
MIT No Attribution
512 stars 235 forks source link

Stacknames with hyphens causes Lambda runtime error #9

Open borisxk opened 8 years ago

borisxk commented 8 years ago

parser.py:363

If the CloudFormation stack is created with a hyphen in the name, then parser.py errors out on Line 364 at runtime due to the fact that the parse of the function name via 'context.invoked_function_arn' on line 363 incorrectly includes the function name. (the 'split' command does not parse the string correctly due to the extra hyphens)

To replicate: Run CloudFormation with stackname = 'my-waf-ratelimit'

Error in logs: An error occurred (ValidationError) when calling the DescribeStacks operation: Stack with id my-waf-ratelimit-LambdaWAFBlacklistingFunction does not exist: ClientError Traceback (most recent call last): File "/var/task/parser.py", line 443, in lambda_handler raise e ClientError: An error occurred (ValidationError) when calling the DescribeStacks operation: Stack with id my-waf-ratelimit-LambdaWAFBlacklistingFunction