Caches Iscsi Volume Args
Manages an AWS Storage Gateway cached iSCSI volume.
NOTE: The gateway must have cache added (e.g., via the
aws.storagegateway.Cache
resource) before creating volumes otherwise the Storage Gateway API will return an error. NOTE: The gateway must have an upload buffer added (e.g., via theaws.storagegateway.UploadBuffer
resource) before the volume is operational to clients, however the Storage Gateway API will allow volume creation without error in that case and return volume status asUPLOAD BUFFER NOT CONFIGURED
.
Example Usage
NOTE: These examples are referencing the
aws.storagegateway.Cache
resourcegateway_arn
attribute to ensure this provider properly adds cache before creating the volume. If you are not using this method, you may need to declare an expicit dependency (e.g. viadepends_on = [aws_storagegateway_cache.example]
) to ensure proper ordering.
Create Empty Cached iSCSI Volume
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.storagegateway.CachesIscsiVolume;
import com.pulumi.aws.storagegateway.CachesIscsiVolumeArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CachesIscsiVolume("example", CachesIscsiVolumeArgs.builder()
.gatewayArn(aws_storagegateway_cache.example().gateway_arn())
.networkInterfaceId(aws_instance.example().private_ip())
.targetName("example")
.volumeSizeInBytes(5368709120)
.build());
}
}
Create Cached iSCSI Volume From Snapshot
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.storagegateway.CachesIscsiVolume;
import com.pulumi.aws.storagegateway.CachesIscsiVolumeArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CachesIscsiVolume("example", CachesIscsiVolumeArgs.builder()
.gatewayArn(aws_storagegateway_cache.example().gateway_arn())
.networkInterfaceId(aws_instance.example().private_ip())
.snapshotId(aws_ebs_snapshot.example().id())
.targetName("example")
.volumeSizeInBytes(aws_ebs_snapshot.example().volume_size() * 1024 * 1024 * 1024)
.build());
}
}
Create Cached iSCSI Volume From Source Volume
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.storagegateway.CachesIscsiVolume;
import com.pulumi.aws.storagegateway.CachesIscsiVolumeArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CachesIscsiVolume("example", CachesIscsiVolumeArgs.builder()
.gatewayArn(aws_storagegateway_cache.example().gateway_arn())
.networkInterfaceId(aws_instance.example().private_ip())
.sourceVolumeArn(aws_storagegateway_cached_iscsi_volume.existing().arn())
.targetName("example")
.volumeSizeInBytes(aws_storagegateway_cached_iscsi_volume.existing().volume_size_in_bytes())
.build());
}
}
Import
aws_storagegateway_cached_iscsi_volume
can be imported by using the volume Amazon Resource Name (ARN), e.g.,
$ pulumi import aws:storagegateway/cachesIscsiVolume:CachesIscsiVolume example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678