Class Names
Functions for devising unique names for constructs.
Inheritance
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Names : DeputyBase
Syntax (vb)
Public Class Names
Inherits DeputyBase
Remarks
For example, those can be used to allocate unique physical names for resources.
Synopsis
Constructors
Names(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Names(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
NodeUniqueId(Node) | Returns a CloudFormation-compatible unique identifier for a construct based on its path. |
UniqueId(IConstruct) | Returns a CloudFormation-compatible unique identifier for a construct based on its path. |
UniqueResourceName(IConstruct, IUniqueResourceNameOptions) | Returns a CloudFormation-compatible unique identifier for a construct based on its path. |
Constructors
Names(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Names(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Names(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Names(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
NodeUniqueId(Node)
Returns a CloudFormation-compatible unique identifier for a construct based on its path.
public static string NodeUniqueId(Node node)
Parameters
- node Constructs.Node
The construct node.
Returns
System.String
a unique id based on the construct path
Remarks
The identifier includes a human readable portion rendered from the path components and a hash suffix.
TODO (v2): replace with API to use constructs.Node
.
UniqueId(IConstruct)
Returns a CloudFormation-compatible unique identifier for a construct based on its path.
public static string UniqueId(IConstruct construct)
Parameters
- construct Constructs.IConstruct
The construct.
Returns
System.String
a unique id based on the construct path
Remarks
The identifier includes a human readable portion rendered from the path components and a hash suffix. uniqueId is not unique if multiple copies of the stack are deployed. Prefer using uniqueResourceName().
UniqueResourceName(IConstruct, IUniqueResourceNameOptions)
Returns a CloudFormation-compatible unique identifier for a construct based on its path.
public static string UniqueResourceName(IConstruct construct, IUniqueResourceNameOptions options)
Parameters
- construct Constructs.IConstruct
The construct.
- options IUniqueResourceNameOptions
Options for defining the unique resource name.
Returns
System.String
a unique resource name based on the construct path
Remarks
This function finds the stackName of the parent stack (non-nested) to the construct, and the ids of the components in the construct path.
The user can define allowed special characters, a separator between the elements, and the maximum length of the resource name. The name includes a human readable portion rendered from the path components, with or without user defined separators, and a hash suffix. If the resource name is longer than the maximum length, it is trimmed in the middle.