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

Errors in Lambda for the Config Visualization Automation #5

Open
mstama opened this issue Nov 10, 2021 · 0 comments
Open

Errors in Lambda for the Config Visualization Automation #5

mstama opened this issue Nov 10, 2021 · 0 comments

Comments

@mstama
Copy link

mstama commented Nov 10, 2021

I'm testing the sample automation available here:
https://github.com/aws-samples/aws-management-and-governance-samples/tree/master/AWSConfig/AWS-Config-Visualization

And notice some errors in the Lambda provisioned:

  • Pattern in the Lambda does not support prefix.
    The central Config bucket provisioned by Control Tower uses a prefix and the pattern used in the automation (and in the original blog post) does not support it.
    The code has this:
    return re.match('^AWSLogs/(\d+)/Config/([\w-]+)/(\d+)/(\d+)/(\d+)/ConfigSnapshot/[^\\\]+$', object_key)
    It should be like this:
    return re.match('.*/AWSLogs/(\d+)/Config/([\w-]+)/(\d+)/(\d+)/(\d+)/ConfigSnapshot/[^\\\]+$', object_key)
  • Wrong group selected for region.
    After the match the function to retrieve the region has the wrong match group returned.
    The code has this, that is the account:
    def get_configuration_snapshot_region(match):
      return match.group(1)
    It should be like this:
    def get_configuration_snapshot_region(match):
      return match.group(2)

Also the blog post mentions that the timeout of the Lambda Function should be changed to 1 min due to the partition creation but the automation keeps the default 3s.

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

1 participant