Skip to content

RosRefElement

Base class for referenceable template constructs which are not Resources.

These constructs are things like Conditions and Parameters, can be referenced by taking the .ref attribute.

Resource constructs do not inherit from RosRefElement because they have their own, more specific types returned from the .ref attribute. Also, some resources aren't referenceable at all (such as BucketPolicies or GatewayAttachments).

Initializers

import { RosRefElement } from '@alicloud/ros-cdk-core'
new RosRefElement(scope: Construct, id: string)
Name Type Description
scope Construct The parent construct.
id string No description.

scopeRequired

The parent construct.


idRequired

  • Type: string

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.

toString

public toString(): string

Returns a string representation of this construct.

synthesize

public synthesize(session: ISynthesisSession): void

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 overrideLogicalId(newLogicalId: string): void

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

newLogicalIdRequired

  • Type: string

The new logical ID to use for this stack element.


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 { RosRefElement } from '@alicloud/ros-cdk-core'
RosRefElement.isConstruct(x: any)

Return whether the given object is a Construct.

xRequired

  • Type: any

isRosElement

import { RosRefElement } from '@alicloud/ros-cdk-core'
RosRefElement.isRosElement(x: 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: any

Properties

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

nodeRequired

public readonly node: ConstructNode;

The construct tree node associated with this construct.


creationStackRequired

public readonly creationStack: string[];
  • Type: string[]

logicalIdRequired

public readonly logicalId: string;
  • Type: 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 readonly stack: Stack;

The stack in which this element is defined.

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


refRequired

public readonly ref: string;
  • Type: 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 }).