runway.cfngin.actions.base module

CFNgin base action.

runway.cfngin.actions.base.build_walker(concurrency: int)Callable[[], typing.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(context: CfnginContext, provider_builder: Optional[ProviderBuilder] = None, cancel: Optional[threading.Event] = None)[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.

DESCRIPTION

Description used when creating a plan for an action.

Type

str

bucket_name

S3 bucket used by the action.

Type

Optional[str]

bucket_region

AWS region where S3 bucket is located.

Type

Optional[str]

cancel

Cancel handler.

Type

threading.Event

context

The context for the current run.

Type

CfnginContext

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

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

Return a generic provider using the default region.

Used for running things like hooks.

build_provider()Provider[source]

Build a CFNgin provider.

ensure_cfn_bucket()None[source]

CloudFormation bucket where templates will be stored.

execute(**kwargs: typing.Any)None[source]

Run the action with pre and post steps.

pre_run(*, dump: Union[bool, str] = False, outline: bool = False, **_BaseAction__kwargs: typing.Any)None[source]

Perform steps before running the action.

post_run(*, dump: Union[bool, str] = False, outline: bool = False, **_BaseAction__kwargs: typing.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, **_kwargs: typing.Any)None[source]

Abstract method for running the action.

s3_stack_push(blueprint: Blueprint, force: bool = False)str[source]

Push the rendered blueprint’s template to S3.

Verifies that the template doesn’t already exist in S3 before pushing.

Returns

URL to the template in S3.

stack_template_url(blueprint: Blueprint)str[source]

S3 URL for CloudFormation template object.