Fixes #53 - mugc not respecting function_prefix #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
c7n allows a configurable Lambda function name prefix, which defaults to
custodian-
. For the policies, this is configured in the actual policy YML. However, for mugc garbage collection, it needs to be explicitly passed in. In the current release, we have mugc hard-coded to the default ofcustodian-
. The result of this, as described in #53, is that manheim-c7n-tools can provision policies with a non-default prefix but mugc keeps trying to clean up the default-prefixed policies.This PR solves this issue with 3 pieces:
function_prefix
option inmanheim-c7n-tools.yml
, which defaults to the current and upstream default ofcustodian-
.MugcStep
to use that configuration option instead of the hard-codedcustodian-
.function-prefix
different from what's in the Config object (manheim-c7n-tools.yml
). This should prevent issues like --step=mugc ignores mode.function-prefix #53 where the prefixes differ between function creation and garbage collection.Testing Done
manheim-c7n-runner -A -s policygen dryrun accountname
to verify behavior