runway.cfngin.actions.deploy module
CFNgin deploy action.
- runway.cfngin.actions.deploy.build_stack_tags(stack: Stack) List[TagTypeDef] [source]
Build a common set of tags to attach to a stack.
- runway.cfngin.actions.deploy.should_update(stack: Stack) bool [source]
Test whether a stack should be submitted for updates to CloudFormation.
- Parameters
stack – The stack object to check.
- runway.cfngin.actions.deploy.should_submit(stack: Stack) bool [source]
Test whether a stack should be submitted to CF for update/create.
- Parameters
stack – The stack object to check.
- runway.cfngin.actions.deploy.should_ensure_cfn_bucket(outline: bool, dump: bool) bool [source]
Test whether access to the cloudformation template bucket is required.
- Parameters
outline – The outline action.
dump – The dump action.
- Returns
If access to CF bucket is needed, return True.
- class runway.cfngin.actions.deploy.UsePreviousParameterValue[source]
Bases:
object
Class used to indicate a Parameter should use it’s existing value.
- __init__()
- __new__(**kwargs)
- runway.cfngin.actions.deploy.handle_hooks(stage: Literal['post_deploy', 'pre_deploy'], hooks: List[CfnginHookDefinitionModel], provider: Provider, context: CfnginContext, *, dump: Union[bool, str] = False, outline: bool = False) None [source]
Handle pre/post hooks.
- Parameters
stage – The name of the hook stage - pre_deploy/post_deploy.
hooks – A list of dictionaries containing the hooks to execute.
provider – The provider the current stack is using.
context – The current CFNgin context.
dump – Whether running with dump set or not.
outline – Whether running with outline set or not.
- class runway.cfngin.actions.deploy.Action[source]
Bases:
runway.cfngin.actions.base.BaseAction
Responsible for building & deploying CloudFormation stacks.
Generates the deploy plan based on stack dependencies (these dependencies are determined automatically based on output lookups from other stacks).
The plan can then either be printed out as an outline or executed. If executed, each stack will get launched in order which entails:
Pushing the generated CloudFormation template to S3 if it has changed
Submitting either a create or update of the given stack to the
runway.cfngin.providers.base.BaseProvider
.
- static build_parameters(stack: Stack, provider_stack: Optional[StackTypeDef] = None) List[ParameterTypeDef] [source]
Build the CloudFormation Parameters for our stack.
- Parameters
stack – A CFNgin stack.
provider_stack – An optional CFNgin provider object.
- Returns
The parameters for the given stack
- pre_run(*, dump: Union[bool, str] = False, outline: bool = False, **_: Any) None [source]
Any steps that need to be taken prior to 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]
Kicks off the create/update of the stacks in the stack_definitions.
This is the main entry point for the action.
- Parameters
concurrency – The maximum number of concurrent deployments.
dump – Dump the plan rather than execute it.
force – Not used by this action.
outline – Outline the plan rather than execute it.
tail – Tail the stack’s events.
upload_disabled – Whether to explicitly disable uploading the CloudFormation template to S3.
- __init__(context: CfnginContext, provider_builder: Optional[ProviderBuilder] = None, cancel: Optional[threading.Event] = None)
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.
- __new__(**kwargs)
- post_run(*, dump: Union[bool, str] = False, outline: bool = False, **_: Any) None [source]
Any steps that need to be taken after running the action.
- property provider: Provider
Return a generic provider using the default region.
Used for running things like hooks.