runway.module.cdk module

CDK module.

runway.module.cdk.get_cdk_stacks(module_path: Path, env_vars: Dict[str, str], context_opts: List[str])List[str][source]

Return list of CDK stacks.

class runway.module.cdk.CloudDevelopmentKit(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)[source]

Bases: runway.module.base.RunwayModuleNpm

CDK Runway Module.

Instantiate class.

  • 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 or module_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.

run_cdk(command: str = 'deploy')Dict[str, bool][source]

Run CDK.


Run cdk diff.


Run cdk deploy.


Run cdk destroy.

__getitem__(key: str)typing.Any

Make the object subscriptable.


key – Attribute to get.

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.


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.


command – List that will be passed into a subprocess.


Run npm install.


Check for the existence for a package.json file in the module.


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.

  • env_vars – Environment variables to check.

  • logger – Optionally provide a custom logger to use.

class runway.module.cdk.CloudDevelopmentKitOptions(data: runway.config.models.runway.options.cdk.RunwayCdkModuleOptionsDataModel)[source]

Bases: runway.module.base.ModuleOptions

Module options for AWS Cloud Development Kit.


A list of commands to be executed before each action (e.g. diff, deploy, destroy).


Options parsed into a data model.


Skip running npm ci in the module directory prior to processing the module.

Instantiate class.


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.


obj – Object to parse.

__eq__(other: typing.Any)bool

Assess equality.

get(name: str, default: Optional[typing.Any] = None)typing.Any

Get a value or return the default.