cloud-custodian: 0.8.45.0 and 0.8.45.1 Releases Break Lambda

We’re using c7n-org and c7n, and upon updating to 0.8.45.0 the lambdas deployed start to throw an error about a missing CloudWatch prefix. The same error is thrown in 0.8.45.1. Is there a new parameter we need to configure on the policies? For what it’s worth, manually pushing a lambda with just c7n and not c7n-org does not throw this error.

Stack trace:

Invalid length for parameter logGroupNamePrefix, value: 0, valid range: 1-inf
Traceback (most recent call last):
  File "/var/task/custodian_policy.py", line 4, in run
    return handler.dispatch_event(event, context)
  File "/var/task/c7n/handler.py", line 168, in dispatch_event
    p.push(event, context)
  File "/var/task/c7n/policy.py", line 990, in push
    return mode.run(event, lambda_ctx)
  File "/var/task/c7n/policy.py", line 590, in run
    return PullMode.run(self)
  File "/var/task/c7n/policy.py", line 278, in run
    with self.policy.ctx:
  File "/var/task/c7n/ctx.py", line 89, in __enter__
    self.logs.__enter__()
  File "/var/task/c7n/output.py", line 340, in __enter__
    self.join_log()
  File "/var/task/c7n/output.py", line 349, in join_log
    self.handler = self.get_handler()
  File "/var/task/c7n/resources/aws.py", line 273, in get_handler
    session_factory=lambda x=None: self.ctx.session_factory(region=self.region))
  File "/var/task/c7n/log.py", line 91, in __init__
    logGroupNamePrefix=self.log_group)['logGroups']
  File "/var/task/c7n/utils.py", line 390, in _retry
    return func(*args, **kw)
  File "/var/runtime/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/runtime/botocore/client.py", line 634, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/var/runtime/botocore/client.py", line 682, in _convert_to_request_dict
    api_params, operation_model)
  File "/var/runtime/botocore/validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (5 by maintainers)

Most upvoted comments

0.8.45.2 released with fix for this.

Just checked, on the failing policy I got this defined:

      execution-options:
        log_group: /aws/lambda/custodian-auto-terminator

Indeed, the working policies have no log_group defined.