Stored Iscsi Volume
Manages an AWS Storage Gateway stored iSCSI volume.
NOTE: The gateway must have a working storage added (e.g., via the
aws.storagegateway.WorkingStorage
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 asWORKING STORAGE NOT CONFIGURED
.
Example Usage
Create Empty Stored iSCSI Volume
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.storagegateway.StoredIscsiVolume("example", {
gatewayArn: exampleAwsStoragegatewayCache.gatewayArn,
networkInterfaceId: exampleAwsInstance.privateIp,
targetName: "example",
preserveExistingData: false,
diskId: test.id,
});
import pulumi
import pulumi_aws as aws
example = aws.storagegateway.StoredIscsiVolume("example",
gateway_arn=example_aws_storagegateway_cache["gatewayArn"],
network_interface_id=example_aws_instance["privateIp"],
target_name="example",
preserve_existing_data=False,
disk_id=test["id"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.StorageGateway.StoredIscsiVolume("example", new()
{
GatewayArn = exampleAwsStoragegatewayCache.GatewayArn,
NetworkInterfaceId = exampleAwsInstance.PrivateIp,
TargetName = "example",
PreserveExistingData = false,
DiskId = test.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/storagegateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storagegateway.NewStoredIscsiVolume(ctx, "example", &storagegateway.StoredIscsiVolumeArgs{
GatewayArn: pulumi.Any(exampleAwsStoragegatewayCache.GatewayArn),
NetworkInterfaceId: pulumi.Any(exampleAwsInstance.PrivateIp),
TargetName: pulumi.String("example"),
PreserveExistingData: pulumi.Bool(false),
DiskId: pulumi.Any(test.Id),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.storagegateway.StoredIscsiVolume;
import com.pulumi.aws.storagegateway.StoredIscsiVolumeArgs;
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 StoredIscsiVolume("example", StoredIscsiVolumeArgs.builder()
.gatewayArn(exampleAwsStoragegatewayCache.gatewayArn())
.networkInterfaceId(exampleAwsInstance.privateIp())
.targetName("example")
.preserveExistingData(false)
.diskId(test.id())
.build());
}
}
resources:
example:
type: aws:storagegateway:StoredIscsiVolume
properties:
gatewayArn: ${exampleAwsStoragegatewayCache.gatewayArn}
networkInterfaceId: ${exampleAwsInstance.privateIp}
targetName: example
preserveExistingData: false
diskId: ${test.id}
Create Stored iSCSI Volume From Snapshot
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.storagegateway.StoredIscsiVolume("example", {
gatewayArn: exampleAwsStoragegatewayCache.gatewayArn,
networkInterfaceId: exampleAwsInstance.privateIp,
snapshotId: exampleAwsEbsSnapshot.id,
targetName: "example",
preserveExistingData: false,
diskId: test.id,
});
import pulumi
import pulumi_aws as aws
example = aws.storagegateway.StoredIscsiVolume("example",
gateway_arn=example_aws_storagegateway_cache["gatewayArn"],
network_interface_id=example_aws_instance["privateIp"],
snapshot_id=example_aws_ebs_snapshot["id"],
target_name="example",
preserve_existing_data=False,
disk_id=test["id"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.StorageGateway.StoredIscsiVolume("example", new()
{
GatewayArn = exampleAwsStoragegatewayCache.GatewayArn,
NetworkInterfaceId = exampleAwsInstance.PrivateIp,
SnapshotId = exampleAwsEbsSnapshot.Id,
TargetName = "example",
PreserveExistingData = false,
DiskId = test.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/storagegateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storagegateway.NewStoredIscsiVolume(ctx, "example", &storagegateway.StoredIscsiVolumeArgs{
GatewayArn: pulumi.Any(exampleAwsStoragegatewayCache.GatewayArn),
NetworkInterfaceId: pulumi.Any(exampleAwsInstance.PrivateIp),
SnapshotId: pulumi.Any(exampleAwsEbsSnapshot.Id),
TargetName: pulumi.String("example"),
PreserveExistingData: pulumi.Bool(false),
DiskId: pulumi.Any(test.Id),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.storagegateway.StoredIscsiVolume;
import com.pulumi.aws.storagegateway.StoredIscsiVolumeArgs;
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 StoredIscsiVolume("example", StoredIscsiVolumeArgs.builder()
.gatewayArn(exampleAwsStoragegatewayCache.gatewayArn())
.networkInterfaceId(exampleAwsInstance.privateIp())
.snapshotId(exampleAwsEbsSnapshot.id())
.targetName("example")
.preserveExistingData(false)
.diskId(test.id())
.build());
}
}
resources:
example:
type: aws:storagegateway:StoredIscsiVolume
properties:
gatewayArn: ${exampleAwsStoragegatewayCache.gatewayArn}
networkInterfaceId: ${exampleAwsInstance.privateIp}
snapshotId: ${exampleAwsEbsSnapshot.id}
targetName: example
preserveExistingData: false
diskId: ${test.id}
Import
Using pulumi import
, import aws_storagegateway_stored_iscsi_volume
using the volume Amazon Resource Name (ARN). For example:
$ pulumi import aws:storagegateway/storedIscsiVolume:StoredIscsiVolume example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678
Properties
Whether mutual CHAP is enabled for the iSCSI target.
The Amazon Resource Name (ARN) of the gateway.
true
to use Amazon S3 server side encryption with your own AWS KMS key, or false
to use a key managed by Amazon S3. Optional.
The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
The port used to communicate with iSCSI targets.
Specify this field as true
if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.
The snapshot ID of the snapshot to restore as the new stored volumeE.g., snap-1122aabb
.
The name of the iSCSI target used by initiators to connect to the target and as a suffix for the target ARN. The target name must be unique across all volumes of a gateway.
A value that indicates whether a storage volume is attached to, detached from, or is in the process of detaching from a gateway.
The size of the data stored on the volume in bytes.
indicates the state of the storage volume.
indicates the type of the volume.