com.hashicorp.cdktf.TerraformSelf Maven / Gradle / Ivy
package com.hashicorp.cdktf;
/**
* (experimental) 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.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.98.0 (build 00b106d)", date = "2024-05-28T19:32:20.231Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = com.hashicorp.cdktf.$Module.class, fqn = "cdktf.TerraformSelf")
public class TerraformSelf extends software.amazon.jsii.JsiiObject {
protected TerraformSelf(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected TerraformSelf(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public TerraformSelf() {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this);
}
/**
* (experimental) Only usable within a connection block to reference the connections parent resource.
*
* Access a property on the resource like this: getAny("hostPort")
*
* @param key This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull java.lang.Object getAny(final @org.jetbrains.annotations.NotNull java.lang.String key) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(com.hashicorp.cdktf.TerraformSelf.class, "getAny", software.amazon.jsii.NativeType.forClass(java.lang.Object.class), new Object[] { java.util.Objects.requireNonNull(key, "key is required") });
}
/**
* (experimental) Only usable within a connection block to reference the connections parent resource.
*
* Access a property on the resource like this: getNumber("hostPort")
*
* @param key This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull java.lang.Number getNumber(final @org.jetbrains.annotations.NotNull java.lang.String key) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(com.hashicorp.cdktf.TerraformSelf.class, "getNumber", software.amazon.jsii.NativeType.forClass(java.lang.Number.class), new Object[] { java.util.Objects.requireNonNull(key, "key is required") });
}
/**
* (experimental) Only usable within a connection block to reference the connections parent resource.
*
* Access a property on the resource like this: getString("publicIp")
*
* @param key This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull java.lang.String getString(final @org.jetbrains.annotations.NotNull java.lang.String key) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(com.hashicorp.cdktf.TerraformSelf.class, "getString", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { java.util.Objects.requireNonNull(key, "key is required") });
}
}