Skip to content

Resource

A construct which represents a resource.

Initializers

import ros_cdk_core
ros_cdk_core.Resource(
  scope: Construct,
  id: str,
  physical_name: str = None
)
Name Type Description
scope Construct No description.
id str No description.
physical_name str The value passed in by users to the physical name prop of the resource.

scopeRequired


idRequired

  • Type: str

physical_nameOptional

  • Type: str
  • Default: The physical name will be allocated at deployment time

The value passed in by users to the physical name prop of the resource.

  • undefined implies that a physical name will be allocated during deployment.
  • a concrete value implies a specific physical name
  • PhysicalName.GENERATE_IF_NEEDED is a marker that indicates that a physical will only be generated by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated.

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.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
get_att No description.
set_metadata No description.

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.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired


add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired


add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired


get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

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

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ConstructNode The construct tree node associated with this construct.
ref str No description.
stack Stack The stack in which this resource is defined.
resource RosResource No description.

nodeRequired

node: ConstructNode

The construct tree node associated with this construct.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource