This change enables custom plugins to be developed under the rpdk.v1.extensions entrypoint to extend cfn functionality. E.g. developing a new hello command:
cfn hello --name Adrian
Hello, Adrian!
In this change, I introduce the ExtensionPlugin abstract base class, which has 2 methods. command_name determines what the command will be (e.g. hello in the above example). This registers a subparser under cfn. The second method is setup_parser which should be implemented in the child class to setup any arguments and behaviors required (e.g. --name parameter and printing Hello, Adrian! in examble above)
The way a new extension can be setup is the same way as other plugins already developed, where you simply pip install the package in your environment.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: NA
Description of changes:
This change enables custom plugins to be developed under the
rpdk.v1.extensions
entrypoint to extendcfn
functionality. E.g. developing a newhello
command:In this change, I introduce the
ExtensionPlugin
abstract base class, which has 2 methods.command_name
determines what the command will be (e.g.hello
in the above example). This registers a subparser undercfn
. The second method issetup_parser
which should be implemented in the child class to setup any arguments and behaviors required (e.g.--name
parameter and printingHello, Adrian!
in examble above)The way a new extension can be setup is the same way as other plugins already developed, where you simply
pip install
the package in your environment.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.