Skip to content

Resource

A construct which represents a resource.

Initializers

import ros_cdk_core
ros_cdk_core.Resource(
  scope: Construct,
  id: str,
  account: str = None,
  environment_from_arn: typing.Union[str, IResolvable] = None,
  physical_name: str = None,
  region: str = None
)
Name Type Description
scope Construct No description.
id str No description.
account str The Alibaba Cloud account ID this resource belongs to.
environment_from_arn typing.Union[str, IResolvable] ARN to deduce region and account from.
physical_name str The value passed in by users to the physical name prop of the resource.
region str The Alibaba Cloud region this resource belongs to.

scopeRequired


idRequired

  • Type: str

accountOptional

  • Type: str
  • Default: the resource is in the same account as the stack it belongs to

The Alibaba Cloud account ID this resource belongs to.


environment_from_arnOptional

  • Type: typing.Union[str, IResolvable]
  • Default: take environment from account, region parameters, or use Stack environment.

ARN to deduce region and account from.

The ARN is parsed and the account and region are taken from the ARN. This should be used for imported resources.

Cannot be supplied together with either account or region.


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.

regionOptional

  • Type: str
  • Default: the resource is in the same region as the stack it belongs to

The Alibaba Cloud region this resource belongs to.


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.
fetch_condition No description.
fetch_dependency No description.
fetch_resource_desc 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


fetch_condition

def fetch_condition() -> RosCondition

fetch_dependency

def fetch_dependency() -> typing.List[str]

fetch_resource_desc

def fetch_resource_desc() -> str

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.
env IResourceEnvironment The environment this resource belongs to.
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.


envRequired

env: IResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource