Resource: aws_storagegateway_stored_iscsi_volume

Manages an AWS Storage Gateway stored iSCSI volume.

Example Usage

Create Empty Stored iSCSI Volume

resource "aws_storagegateway_stored_iscsi_volume" "example" {
  gateway_arn            = aws_storagegateway_cache.example.gateway_arn
  network_interface_id   = aws_instance.example.private_ip
  target_name            = "example"
  preserve_existing_data = false
  disk_id                = data.aws_storagegateway_local_disk.test.id
}

Create Stored iSCSI Volume From Snapshot

resource "aws_storagegateway_stored_iscsi_volume" "example" {
  gateway_arn            = aws_storagegateway_cache.example.gateway_arn
  network_interface_id   = aws_instance.example.private_ip
  snapshot_id            = aws_ebs_snapshot.example.id
  target_name            = "example"
  preserve_existing_data = false
  disk_id                = data.aws_storagegateway_local_disk.test.id
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import aws_storagegateway_stored_iscsi_volume using the volume Amazon Resource Name (ARN). For example:

import {
  to = aws_storagegateway_stored_iscsi_volume.example
  id = "arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678"
}

Using terraform import, import aws_storagegateway_stored_iscsi_volume using the volume Amazon Resource Name (ARN). For example:

% terraform import aws_storagegateway_stored_iscsi_volume.example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678