runway.module.cdk module
CDK module.
- class runway.module.cdk.CloudDevelopmentKit[source]
Bases:
runway.module.base.RunwayModuleNpm
CDK Runway Module.
- __init__(context: RunwayContext, *, explicitly_enabled: Optional[bool] = False, logger: RunwayLogger = <RunwayLogger runway.module.cdk (WARNING)>, module_root: Path, name: Optional[str] = None, options: Optional[Union[Dict[str, Any], ModuleOptions]] = None, parameters: Optional[Dict[str, Any]] = None, **_: Any) None [source]
Instantiate class.
- Parameters
context – Runway context object for the current session.
explicitly_enabled – Whether or not the module is explicitly enabled. This is can be set in the event that the current environment being deployed to matches the defined environments of the module/deployment.
logger – Used to write logs.
module_root – Root path of the module.
name – Name of the module.
options – Options passed to the module class from the config as
options
ormodule_options
if coming from the deployment level.parameters – Values to pass to the underlying infrastructure as code tool that will alter the resulting infrastructure being deployed. Used to templatize IaC.
- property cli_args_context: List[str]
Generate CLI args from self passed to CDK commands as
--context
.
- gen_cmd(command: typing_extensions.Literal[bootstrap, context, deploy, destroy, diff, docs, doctor, init, list, metadata, synthesize], args_list: Optional[List[str]] = None, *, include_context: bool = False) List[str] [source]
Generate and log a CDK command.
This does not execute the command, only prepares it for use.
- Parameters
command – The CDK command to be executed.
args_list – Additional arguments to include in the generated command.
include_context – Optionally, pass context to the CLI. Context is not valid for all commands.
- Returns
The full command to be passed into a subprocess.
- __new__(**kwargs)
- static check_for_npm(*, logger: Union[logging.Logger, PrefixAdaptor, RunwayLogger] = <RunwayLogger runway.module.base (WARNING)>) None
Ensure npm is installed and in the current path.
- Parameters
logger – Optionally provide a custom logger to use.
- log_npm_command(command: List[str]) None
Log an npm command that is going to be run.
- Parameters
command – List that will be passed into a subprocess.
- package_json_missing() bool
Check for the existence for a package.json file in the module.
- Returns
True if the file was not found.
- Return type
- static warn_on_boto_env_vars(env_vars: Dict[str, str], *, logger: Union[logging.Logger, PrefixAdaptor, RunwayLogger] = <RunwayLogger runway.module.base (WARNING)>) None
Inform user if boto-specific environment variables are in use.
- Parameters
env_vars – Environment variables to check.
logger – Optionally provide a custom logger to use.
- class runway.module.cdk.CloudDevelopmentKitOptions[source]
Bases:
runway.module.base.ModuleOptions
Module options for AWS Cloud Development Kit.
- build_steps
A list of commands to be executed before each action (e.g. diff, deploy, destroy).
- data
Options parsed into a data model.
- skip_npm_ci
Skip running
npm ci
in the module directory prior to processing the module.
- __init__(data: runway.config.models.runway.options.cdk.RunwayCdkModuleOptionsDataModel) None [source]
Instantiate class.
- Parameters
data – Options parsed into a data model.
- classmethod parse_obj(obj: object) runway.module.cdk.CloudDevelopmentKitOptions [source]
Parse options definition and return an options object.
- Parameters
obj – Object to parse.
- __new__(**kwargs)