Skip to main content
Expressions in connection blocks cannot refer to their parent resource by name. References create dependencies, and referring to a resource by name within its own block would create a dependency cycle. Instead, expressions can use the self object, which represents the connection’s parent resource and has all of that resource’s attributes. For example, use self.public_ip to reference an aws_instance’s public_ip attribute.

Initializers

import io.cdktn.cdktn.TerraformSelf;

new TerraformSelf();
NameTypeDescription

Static Functions

NameDescription
getAnyOnly usable within a connection block to reference the connections parent resource.
getNumberOnly usable within a connection block to reference the connections parent resource.
getStringOnly usable within a connection block to reference the connections parent resource.

getAny

import io.cdktn.cdktn.TerraformSelf;

TerraformSelf.getAny(java.lang.String key)
Only usable within a connection block to reference the connections parent resource. Access a property on the resource like this: getAny("hostPort")

keyRequired

  • Type: java.lang.String

getNumber

import io.cdktn.cdktn.TerraformSelf;

TerraformSelf.getNumber(java.lang.String key)
Only usable within a connection block to reference the connections parent resource. Access a property on the resource like this: getNumber("hostPort")

keyRequired

  • Type: java.lang.String

getString

import io.cdktn.cdktn.TerraformSelf;

TerraformSelf.getString(java.lang.String key)
Only usable within a connection block to reference the connections parent resource. Access a property on the resource like this: getString("publicIp")

keyRequired

  • Type: java.lang.String