com.hashicorp.cdktf.TerraformVariable Maven / Gradle / Ivy
package com.hashicorp.cdktf;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.98.0 (build 00b106d)", date = "2024-05-27T11:46:32.287Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = com.hashicorp.cdktf.$Module.class, fqn = "cdktf.TerraformVariable")
public class TerraformVariable extends com.hashicorp.cdktf.TerraformElement implements com.hashicorp.cdktf.ITerraformAddressable {
protected TerraformVariable(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected TerraformVariable(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param config This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public TerraformVariable(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull com.hashicorp.cdktf.TerraformVariableConfig config) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(config, "config is required") });
}
/**
* @param validation This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void addValidation(final @org.jetbrains.annotations.NotNull com.hashicorp.cdktf.TerraformVariableValidationConfig validation) {
software.amazon.jsii.Kernel.call(this, "addValidation", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(validation, "validation is required") });
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.util.Map synthesizeAttributes() {
return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.call(this, "synthesizeAttributes", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class))));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.util.Map synthesizeHclAttributes() {
return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.call(this, "synthesizeHclAttributes", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class))));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull java.lang.Object toHclTerraform() {
return software.amazon.jsii.Kernel.call(this, "toHclTerraform", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
}
/**
* (experimental) Returns a string representation of this construct.
*
* @return a string token referencing the value of this variable
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull java.lang.String toString() {
return software.amazon.jsii.Kernel.call(this, "toString", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull java.lang.Object toTerraform() {
return software.amazon.jsii.Kernel.call(this, "toTerraform", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull com.hashicorp.cdktf.IResolvable getBooleanValue() {
return software.amazon.jsii.Kernel.get(this, "booleanValue", software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.IResolvable.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.util.List getListValue() {
return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.get(this, "listValue", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.Number getNumberValue() {
return software.amazon.jsii.Kernel.get(this, "numberValue", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getStringValue() {
return software.amazon.jsii.Kernel.get(this, "stringValue", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.Object getValue() {
return software.amazon.jsii.Kernel.get(this, "value", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable java.lang.Object getDefaultValue() {
return software.amazon.jsii.Kernel.get(this, "default", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable java.lang.String getDescription() {
return software.amazon.jsii.Kernel.get(this, "description", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable java.lang.Boolean getNullable() {
return software.amazon.jsii.Kernel.get(this, "nullable", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable java.lang.Boolean getSensitive() {
return software.amazon.jsii.Kernel.get(this, "sensitive", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable java.lang.String getType() {
return software.amazon.jsii.Kernel.get(this, "type", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable java.util.List getValidation() {
return java.util.Optional.ofNullable((java.util.List)(software.amazon.jsii.Kernel.get(this, "validation", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.TerraformVariableValidationConfig.class))))).map(java.util.Collections::unmodifiableList).orElse(null);
}
/**
* (experimental) A fluent builder for {@link com.hashicorp.cdktf.TerraformVariable}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final com.hashicorp.cdktf.TerraformVariableConfig.Builder config;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.config = new com.hashicorp.cdktf.TerraformVariableConfig.Builder();
}
/**
* @return {@code this}
* @param defaultValue This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder defaultValue(final java.lang.Object defaultValue) {
this.config.defaultValue(defaultValue);
return this;
}
/**
* @return {@code this}
* @param description This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(final java.lang.String description) {
this.config.description(description);
return this;
}
/**
* @return {@code this}
* @param nullable This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder nullable(final java.lang.Boolean nullable) {
this.config.nullable(nullable);
return this;
}
/**
* @return {@code this}
* @param sensitive This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder sensitive(final java.lang.Boolean sensitive) {
this.config.sensitive(sensitive);
return this;
}
/**
* (experimental) The type argument in a variable block allows you to restrict the type of value that will be accepted as the value for a variable.
*
* If no type constraint is set then a value of any type is accepted.
* While type constraints are optional, we recommend specifying them; they serve as easy reminders for users of the module, and allow Terraform to return a helpful error message if the wrong type is used.
* Type constraints are created from a mixture of type keywords and type constructors. The supported type keywords are:
* * string
* * number
* * bool
* The type constructors allow you to specify complex types such as collections:
* * list()
* * set()
* * map()
* * object({ = , ... })
* * tuple([, ...])
* The keyword any may be used to indicate that any type is acceptable. For more information on the meaning and behavior of these different types, as well as detailed information about automatic conversion of complex types, refer to {@link https://developer.hashicorp.com/terraform/language/expressions/type-constraints Type Constraints}.
* If both the type and default arguments are specified, the given default value must be convertible to the specified type.
*
* @return {@code this}
* @param type The type argument in a variable block allows you to restrict the type of value that will be accepted as the value for a variable. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder type(final java.lang.String type) {
this.config.type(type);
return this;
}
/**
* (experimental) Specify arbitrary custom validation rules for a particular variable using a validation block nested within the corresponding variable block.
*
* @return {@code this}
* @param validation Specify arbitrary custom validation rules for a particular variable using a validation block nested within the corresponding variable block. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder validation(final java.util.List extends com.hashicorp.cdktf.TerraformVariableValidationConfig> validation) {
this.config.validation(validation);
return this;
}
/**
* @return a newly built instance of {@link com.hashicorp.cdktf.TerraformVariable}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public com.hashicorp.cdktf.TerraformVariable build() {
return new com.hashicorp.cdktf.TerraformVariable(
this.scope,
this.id,
this.config.build()
);
}
}
}