Skip to content

RosMapping

Represents a mapping.

Initializers

import ros_cdk_core
ros_cdk_core.RosMapping(
  scope: Construct,
  id: str,
  mapping: typing.Mapping[typing.Mapping[typing.Any]] = None
)
Name Type Description
scope Construct No description.
id str No description.
mapping typing.Mapping[typing.Mapping[typing.Any]] Mapping of key to a set of corresponding set of named values.

scopeRequired


idRequired

  • Type: str

mappingOptional

  • Type: typing.Mapping[typing.Mapping[typing.Any]]
  • Default: No mapping.

Mapping of key to a set of corresponding set of named values.

The key identifies a map of name-value pairs and must be unique within the mapping.

For example, if you want to set values based on a region, you can create a mapping that uses the region name as a key and contains the values you want to specify for each specific region.


Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
override_logical_id Overrides the auto-generated logical ID with a specific ID.
find_in_map No description.
set_value Sets a value in the map based on the two keys.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

The synthesis session.


override_logical_id

def override_logical_id(
  new_logical_id: str
) -> None

Overrides the auto-generated logical ID with a specific ID.

new_logical_idRequired

  • Type: str

The new logical ID to use for this stack element.


find_in_map

def find_in_map(
  key1: str,
  key2: str
) -> IResolvable

key1Required

  • Type: str

key2Required

  • Type: str

set_value

def set_value(
  key1: str,
  key2: str,
  value: typing.Any
) -> None

Sets a value in the map based on the two keys.

key1Required

  • Type: str

key2Required

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.
is_ros_element Returns true if a construct is a stack element (i.e. part of the synthesized template).

is_construct

import ros_cdk_core
ros_cdk_core.RosMapping.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

is_ros_element

import ros_cdk_core
ros_cdk_core.RosMapping.is_ros_element(
  x: typing.Any
)

Returns true if a construct is a stack element (i.e. part of the synthesized template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ConstructNode The construct tree node associated with this construct.
creation_stack typing.List[str] No description.
logical_id str The logical ID for this stack element.
stack Stack The stack in which this element is defined.
ref str Return a string that will be resolved to a RosTemplate { Ref } for this element.

nodeRequired

node: ConstructNode

The construct tree node associated with this construct.


creation_stackRequired

creation_stack: typing.List[str]
  • Type: typing.List[str]

logical_idRequired

logical_id: str
  • Type: str

The logical ID for this stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).


stackRequired

stack: Stack

The stack in which this element is defined.

RosElements must be defined within a stack scope (directly or indirectly).


refRequired

ref: str
  • Type: str

Return a string that will be resolved to a RosTemplate { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).