runway.cfngin.actions.deploy module¶
CFNgin deploy action.
- class runway.cfngin.actions.deploy.Action[source]¶
Bases:
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: StackTypeDef | None = 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
- post_run(*, dump: bool | str = False, outline: bool = False, **_: Any) None [source]¶
Any steps that need to be taken after running the action.
- pre_run(*, dump: 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: 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.
- class runway.cfngin.actions.deploy.UsePreviousParameterValue[source]¶
Bases:
object
Class used to indicate a Parameter should use it’s existing value.
- 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.handle_hooks(stage: Literal['post_deploy', 'pre_deploy'], hooks: list[CfnginHookDefinitionModel], provider: Provider, context: CfnginContext, *, dump: 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.
- 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.