com.hashicorp.cdktf.TerraformAsset Maven / Gradle / Ivy
Show all versions of cdktf Show documentation
package com.hashicorp.cdktf;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-11-11T10:07:42.122Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = com.hashicorp.cdktf.$Module.class, fqn = "cdktf.TerraformAsset")
public class TerraformAsset extends software.constructs.Construct {
protected TerraformAsset(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected TerraformAsset(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* (experimental) A Terraform Asset takes a file or directory outside of the CDK for Terraform context and moves it into it.
*
* Assets copy referenced files into the stacks context for further usage in other resources.
*
* @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 TerraformAsset(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.TerraformAssetConfig 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") });
}
/**
* (experimental) Name of the asset.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getFileName() {
return software.amazon.jsii.Kernel.get(this, "fileName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The path relative to the root of the terraform directory in posix format Use this property to reference the asset.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getPath() {
return software.amazon.jsii.Kernel.get(this, "path", 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.String getAssetHash() {
return software.amazon.jsii.Kernel.get(this, "assetHash", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setAssetHash(final @org.jetbrains.annotations.NotNull java.lang.String value) {
software.amazon.jsii.Kernel.set(this, "assetHash", java.util.Objects.requireNonNull(value, "assetHash is required"));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull com.hashicorp.cdktf.AssetType getType() {
return software.amazon.jsii.Kernel.get(this, "type", software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.AssetType.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setType(final @org.jetbrains.annotations.NotNull com.hashicorp.cdktf.AssetType value) {
software.amazon.jsii.Kernel.set(this, "type", java.util.Objects.requireNonNull(value, "type is required"));
}
/**
* (experimental) A fluent builder for {@link com.hashicorp.cdktf.TerraformAsset}.
*/
@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.TerraformAssetConfig.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.TerraformAssetConfig.Builder();
}
/**
* @return {@code this}
* @param path This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder path(final java.lang.String path) {
this.config.path(path);
return this;
}
/**
* @return {@code this}
* @param assetHash This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder assetHash(final java.lang.String assetHash) {
this.config.assetHash(assetHash);
return this;
}
/**
* @return {@code this}
* @param type This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder type(final com.hashicorp.cdktf.AssetType type) {
this.config.type(type);
return this;
}
/**
* @return a newly built instance of {@link com.hashicorp.cdktf.TerraformAsset}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public com.hashicorp.cdktf.TerraformAsset build() {
return new com.hashicorp.cdktf.TerraformAsset(
this.scope,
this.id,
this.config.build()
);
}
}
}