
com.pulumi.aws.ec2.outputs.InstanceRootBlockDevice Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.ec2.outputs;
import com.pulumi.core.annotations.CustomType;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class InstanceRootBlockDevice {
/**
* @return Whether the volume should be destroyed on instance termination. Defaults to `true`.
*
*/
private @Nullable Boolean deleteOnTermination;
/**
* @return Device name, e.g., `/dev/sdh` or `xvdh`.
*
*/
private @Nullable String deviceName;
/**
* @return Whether to enable volume encryption. Defaults to `false`. Must be configured to perform drift detection.
*
*/
private @Nullable Boolean encrypted;
/**
* @return Amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). Only valid for volume_type of `io1`, `io2` or `gp3`.
*
*/
private @Nullable Integer iops;
/**
* @return Amazon Resource Name (ARN) of the KMS Key to use when encrypting the volume. Must be configured to perform drift detection.
*
*/
private @Nullable String kmsKeyId;
/**
* @return Map of tags to assign to the device.
*
*/
private @Nullable Map tags;
/**
* @return Map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
*
*/
private @Nullable Map tagsAll;
/**
* @return Throughput to provision for a volume in mebibytes per second (MiB/s). This is only valid for `volume_type` of `gp3`.
*
*/
private @Nullable Integer throughput;
/**
* @return ID of the volume. For example, the ID can be accessed like this, `aws_instance.web.root_block_device.0.volume_id`.
*
*/
private @Nullable String volumeId;
/**
* @return Size of the volume in gibibytes (GiB).
*
*/
private @Nullable Integer volumeSize;
/**
* @return Type of volume. Valid values include `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1`, or `st1`. Defaults to the volume type that the AMI uses.
*
* Modifying the `encrypted` or `kms_key_id` settings of the `root_block_device` requires resource replacement.
*
*/
private @Nullable String volumeType;
private InstanceRootBlockDevice() {}
/**
* @return Whether the volume should be destroyed on instance termination. Defaults to `true`.
*
*/
public Optional deleteOnTermination() {
return Optional.ofNullable(this.deleteOnTermination);
}
/**
* @return Device name, e.g., `/dev/sdh` or `xvdh`.
*
*/
public Optional deviceName() {
return Optional.ofNullable(this.deviceName);
}
/**
* @return Whether to enable volume encryption. Defaults to `false`. Must be configured to perform drift detection.
*
*/
public Optional encrypted() {
return Optional.ofNullable(this.encrypted);
}
/**
* @return Amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). Only valid for volume_type of `io1`, `io2` or `gp3`.
*
*/
public Optional iops() {
return Optional.ofNullable(this.iops);
}
/**
* @return Amazon Resource Name (ARN) of the KMS Key to use when encrypting the volume. Must be configured to perform drift detection.
*
*/
public Optional kmsKeyId() {
return Optional.ofNullable(this.kmsKeyId);
}
/**
* @return Map of tags to assign to the device.
*
*/
public Map tags() {
return this.tags == null ? Map.of() : this.tags;
}
/**
* @return Map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
*
*/
public Map tagsAll() {
return this.tagsAll == null ? Map.of() : this.tagsAll;
}
/**
* @return Throughput to provision for a volume in mebibytes per second (MiB/s). This is only valid for `volume_type` of `gp3`.
*
*/
public Optional throughput() {
return Optional.ofNullable(this.throughput);
}
/**
* @return ID of the volume. For example, the ID can be accessed like this, `aws_instance.web.root_block_device.0.volume_id`.
*
*/
public Optional volumeId() {
return Optional.ofNullable(this.volumeId);
}
/**
* @return Size of the volume in gibibytes (GiB).
*
*/
public Optional volumeSize() {
return Optional.ofNullable(this.volumeSize);
}
/**
* @return Type of volume. Valid values include `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1`, or `st1`. Defaults to the volume type that the AMI uses.
*
* Modifying the `encrypted` or `kms_key_id` settings of the `root_block_device` requires resource replacement.
*
*/
public Optional volumeType() {
return Optional.ofNullable(this.volumeType);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(InstanceRootBlockDevice defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable Boolean deleteOnTermination;
private @Nullable String deviceName;
private @Nullable Boolean encrypted;
private @Nullable Integer iops;
private @Nullable String kmsKeyId;
private @Nullable Map tags;
private @Nullable Map tagsAll;
private @Nullable Integer throughput;
private @Nullable String volumeId;
private @Nullable Integer volumeSize;
private @Nullable String volumeType;
public Builder() {}
public Builder(InstanceRootBlockDevice defaults) {
Objects.requireNonNull(defaults);
this.deleteOnTermination = defaults.deleteOnTermination;
this.deviceName = defaults.deviceName;
this.encrypted = defaults.encrypted;
this.iops = defaults.iops;
this.kmsKeyId = defaults.kmsKeyId;
this.tags = defaults.tags;
this.tagsAll = defaults.tagsAll;
this.throughput = defaults.throughput;
this.volumeId = defaults.volumeId;
this.volumeSize = defaults.volumeSize;
this.volumeType = defaults.volumeType;
}
@CustomType.Setter
public Builder deleteOnTermination(@Nullable Boolean deleteOnTermination) {
this.deleteOnTermination = deleteOnTermination;
return this;
}
@CustomType.Setter
public Builder deviceName(@Nullable String deviceName) {
this.deviceName = deviceName;
return this;
}
@CustomType.Setter
public Builder encrypted(@Nullable Boolean encrypted) {
this.encrypted = encrypted;
return this;
}
@CustomType.Setter
public Builder iops(@Nullable Integer iops) {
this.iops = iops;
return this;
}
@CustomType.Setter
public Builder kmsKeyId(@Nullable String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
return this;
}
@CustomType.Setter
public Builder tags(@Nullable Map tags) {
this.tags = tags;
return this;
}
@CustomType.Setter
public Builder tagsAll(@Nullable Map tagsAll) {
this.tagsAll = tagsAll;
return this;
}
@CustomType.Setter
public Builder throughput(@Nullable Integer throughput) {
this.throughput = throughput;
return this;
}
@CustomType.Setter
public Builder volumeId(@Nullable String volumeId) {
this.volumeId = volumeId;
return this;
}
@CustomType.Setter
public Builder volumeSize(@Nullable Integer volumeSize) {
this.volumeSize = volumeSize;
return this;
}
@CustomType.Setter
public Builder volumeType(@Nullable String volumeType) {
this.volumeType = volumeType;
return this;
}
public InstanceRootBlockDevice build() {
final var _resultValue = new InstanceRootBlockDevice();
_resultValue.deleteOnTermination = deleteOnTermination;
_resultValue.deviceName = deviceName;
_resultValue.encrypted = encrypted;
_resultValue.iops = iops;
_resultValue.kmsKeyId = kmsKeyId;
_resultValue.tags = tags;
_resultValue.tagsAll = tagsAll;
_resultValue.throughput = throughput;
_resultValue.volumeId = volumeId;
_resultValue.volumeSize = volumeSize;
_resultValue.volumeType = volumeType;
return _resultValue;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy