Skip to content

RosMapping

Represents a mapping.

Initializers

import com.aliyun.ros.cdk.core.RosMapping;
RosMapping.Builder.create(Construct scope, java.lang.String id)
//  .mapping(java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.Object>>)
    .build();
Name Type Description
scope Construct No description.
id java.lang.String No description.
mapping java.util.Map> Mapping of key to a set of corresponding set of named values.

scopeRequired


idRequired

  • Type: java.lang.String

mappingOptional

  • Type: java.util.Map>
  • 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
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
overrideLogicalId Overrides the auto-generated logical ID with a specific ID.
findInMap No description.
setValue Sets a value in the map based on the two keys.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

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.


overrideLogicalId

public void overrideLogicalId(java.lang.String newLogicalId)

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

newLogicalIdRequired

  • Type: java.lang.String

The new logical ID to use for this stack element.


findInMap

public IResolvable findInMap(java.lang.String key1, java.lang.String key2)

key1Required

  • Type: java.lang.String

key2Required

  • Type: java.lang.String

setValue

public void setValue(java.lang.String key1, java.lang.String key2, java.lang.Object value)

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

key1Required

  • Type: java.lang.String

key2Required

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

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

isConstruct

import com.aliyun.ros.cdk.core.RosMapping;
RosMapping.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

isRosElement

import com.aliyun.ros.cdk.core.RosMapping;
RosMapping.isRosElement(java.lang.Object x)

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: java.lang.Object

Properties

Name Type Description
node ConstructNode The construct tree node associated with this construct.
creationStack java.util.List No description.
logicalId java.lang.String The logical ID for this stack element.
stack Stack The stack in which this element is defined.
ref java.lang.String Return a string that will be resolved to a RosTemplate { Ref } for this element.

nodeRequired

public ConstructNode getNode();

The construct tree node associated with this construct.


creationStackRequired

public java.util.List<java.lang.String> getCreationStack();
  • Type: java.util.List

logicalIdRequired

public java.lang.String getLogicalId();
  • Type: java.lang.String

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

public Stack getStack();

The stack in which this element is defined.

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


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

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 }).