runway.cfngin.actions.base module

CFNgin base action.

runway.cfngin.actions.base.build_walker(concurrency)[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 (int) – Number of threads to use while walking.

Returns

Function to walk a runway.cfngin.dag.DAG.

Return type

Callable[.., Any]

runway.cfngin.actions.base.stack_template_url(bucket_name, blueprint, endpoint)[source]

Produce an s3 url for a given blueprint.

Parameters
  • bucket_name (str) – The name of the S3 bucket where the resulting templates are stored.

  • blueprint (runway.cfngin.blueprints.base.Blueprint) – The blueprint object to create the URL to.

  • endpoint (str) – The s3 endpoint used for the bucket.

Returns

S3 URL.

Return type

str

class runway.cfngin.actions.base.BaseAction(context, provider_builder=None, cancel=None)[source]

Bases: object

Actions perform the actual work of each Command.

Each action is tied to a runway.cfngin.commands.stacker.base.BaseCommand, and is responsible for building the runway.cfngin.plan.Plan that will be executed to perform that command.

DESCRIPTION

Description used when creating a plan for an action.

Type

str

bucket_name

S3 bucket used by the action.

Type

str

bucket_region

AWS region where S3 bucket is located.

Type

str

cancel

Cancel handler.

Type

threading.Event

context

The context for the current run.

Type

runway.cfngin.context.Context

provider_builder

An object that will build a provider that will be interacted with in order to perform the necessary actions.

Type

Optional[BaseProviderBuilder]

s3_conn

Boto3 S3 client.

Type

boto3.client.Client

Instantiate class.

Parameters
  • context (runway.cfngin.context.Context) – The context for the current run.

  • provider_builder (Optional[BaseProviderBuilder]) – An object that will build a provider that will be interacted with in order to perform the necessary actions.

  • cancel (threading.Event) – Cancel handler.

DESCRIPTION = 'Base action'
NAME = None
property provider

Return a generic provider using the default region.

Used for running things like hooks.

Returns

runway.cfngin.providers.base.BaseProvider

build_provider(stack)[source]

Build a runway.cfngin.providers.base.BaseProvider.

Parameters

stack (runway.cfngin.stack.Stack) – Stack the action will be executed on.

Returns

Suitable for operating on the given runway.cfngin.stack.Stack.

Return type

runway.cfngin.providers.base.BaseProvider

ensure_cfn_bucket()[source]

CloudFormation bucket where templates will be stored.

execute(**kwargs)[source]

Run the action with pre and post steps.

pre_run(**kwargs)[source]

Perform steps before running the action.

post_run(**kwargs)[source]

Perform steps after running the action.

run(**kwargs)[source]

Abstract method for running the action.

s3_stack_push(blueprint, force=False)[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.

Return type

str

stack_template_url(blueprint)[source]

S3 URL for CloudFormation template object.

Returns

str