c7n.handler module

c7n.handler.dispatch_event(event, context)[source]
c7n.handler.get_local_output_dir()[source]

Create a local output directory per execution.

We’ve seen occassional (1/100000) perm issues with lambda on temp directory and changing unix execution users (2015-2018), so use a per execution temp space. With firecracker lambdas this may be outdated.

c7n.handler.init_config(policy_config)[source]

Get policy lambda execution configuration.

cli parameters are serialized into the policy lambda config, we merge those with any policy specific execution options.

–assume role and -s output directory get special handling, as to disambiguate any cli context.

account id is sourced from the config options or from api call and cached as a global