runway.cfngin.actions.base module
CFNgin base action.
- runway.cfngin.actions.base.build_walker(concurrency: int) Callable[[...], Any] [source]
Return a function for waling a graph.
Passed to
runway.cfngin.plan.Plan
for walking the graph.If concurrency is 1 (no parallelism) this will return a simple topological walker that doesn’t use any multithreading.
If concurrency is 0, this will return a walker that will walk the graph as fast as the graph topology allows.
If concurrency is greater than 1, it will return a walker that will only execute a maximum of concurrency steps at any given time.
- Parameters
concurrency – Number of threads to use while walking.
- Returns
Function to walk a
runway.cfngin.dag.DAG
.
- runway.cfngin.actions.base.stack_template_url(bucket_name: str, blueprint: Blueprint, endpoint: str)[source]
Produce an s3 url for a given blueprint.
- Parameters
bucket_name – The name of the S3 bucket where the resulting templates are stored.
blueprint – The blueprint object to create the URL to.
endpoint – The s3 endpoint used for the bucket.
- class runway.cfngin.actions.base.BaseAction[source]
Bases:
object
Actions perform the actual work of each Command.
Each action is responsible for building the
runway.cfngin.plan.Plan
that will be executed.- cancel
Cancel handler.
- Type
- context
The context for the current run.
- Type
- provider_builder
An object that will build a provider that will be interacted with in order to perform the necessary actions.
- Type
Optional[ProviderBuilder]
- s3_conn
Boto3 S3 client.
- Type
S3Client
- __init__(context: CfnginContext, provider_builder: Optional[ProviderBuilder] = None, cancel: Optional[threading.Event] = None)[source]
Instantiate class.
- Parameters
context – The context for the current run.
provider_builder – An object that will build a provider that will be interacted with in order to perform the necessary actions.
cancel – Cancel handler.
- property provider: Provider
Return a generic provider using the default region.
Used for running things like hooks.
- __new__(**kwargs)
- pre_run(*, dump: Union[bool, str] = False, outline: bool = False, **_BaseAction__kwargs: Any) None [source]
Perform steps before running the action.
- post_run(*, dump: Union[bool, str] = False, outline: bool = False, **_BaseAction__kwargs: Any) None [source]
Perform steps after running the action.
- run(*, concurrency: int = 0, dump: Union[bool, str] = False, force: bool = False, outline: bool = False, tail: bool = False, upload_disabled: bool = False, **_kwargs: Any) None [source]
Abstract method for running the action.