Resource: aws_storagegateway_cached_iscsi_volume

Manages an AWS Storage Gateway cached iSCSI volume.

Example Usage

Create Empty Cached iSCSI Volume

resource "aws_storagegateway_cached_iscsi_volume" "example" {
  gateway_arn          = aws_storagegateway_cache.example.gateway_arn
  network_interface_id = aws_instance.example.private_ip
  target_name          = "example"
  volume_size_in_bytes = 5368709120 # 5 GB
}

Create Cached iSCSI Volume From Snapshot

resource "aws_storagegateway_cached_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"
  volume_size_in_bytes = aws_ebs_snapshot.example.volume_size * 1024 * 1024 * 1024
}

Create Cached iSCSI Volume From Source Volume

resource "aws_storagegateway_cached_iscsi_volume" "example" {
  gateway_arn          = aws_storagegateway_cache.example.gateway_arn
  network_interface_id = aws_instance.example.private_ip
  source_volume_arn    = aws_storagegateway_cached_iscsi_volume.existing.arn
  target_name          = "example"
  volume_size_in_bytes = aws_storagegateway_cached_iscsi_volume.existing.volume_size_in_bytes
}

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_cached_iscsi_volume using the volume Amazon Resource Name (ARN). For example:

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

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

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