aws_ddk_core.config.Config

class aws_ddk_core.config.Config(config_strategy: Optional[aws_ddk_core.config.config.ConfigStrategy] = None)

Class used to read configuration with a configurable strategy.

__init__(config_strategy: Optional[aws_ddk_core.config.config.ConfigStrategy] = None) None

Create Config class instance.

Provide ConfigStrategy to determine how/where the config should be read from. Reads from cdk.json in the root of the repo by default.

Parameters

config_strategy (Optional[ConfigStrategy]) – Strategy that determines how and where to read config from. JSONConfigStrategy by default

Methods

__init__([config_strategy])

Create Config class instance.

get_cdk_version()

Return CDK version.

get_env(environment_id)

Get environment representing AWS account and region.

get_env_config(environment_id)

Get environment config.

get_resource_config(environment_id, id)

Get resource config of the resource with given id in the environment with the given environment id.

get_tags()

Return tags.

get_cdk_version() Optional[str]

Return CDK version.

Returns

cdk_version – CDK version

Return type

Optional[str]

get_env(environment_id: str) aws_cdk.Environment

Get environment representing AWS account and region.

Parameters

environment_id (str) – Identifier of the environment

Returns

env – CDK Environment(account, region)

Return type

Environment

get_env_config(environment_id: str) Dict[str, Any]

Get environment config.

Parameters

environment_id (str) – Identifier of the environment

Returns

env_config – Dictionary that contains config for the given environment

Return type

Dict[str, Any]

get_resource_config(environment_id: str, id: str) Dict[str, Any]

Get resource config of the resource with given id in the environment with the given environment id.

Parameters
  • environment_id (str) – Identifier of the environment

  • id (str) – Identifier of the resource

Returns

config – Dictionary that contains config for the given resource in the given environment

Return type

Dict[str, Any]

get_tags() Dict[str, str]

Return tags.

Returns

tags – Dict of a form {‘tag_key’: ‘value’}

Return type

Dict[str, str]