CachesIscsiVolumeArgs

data class CachesIscsiVolumeArgs(val gatewayArn: Output<String>? = null, val kmsEncrypted: Output<Boolean>? = null, val kmsKey: Output<String>? = null, val networkInterfaceId: Output<String>? = null, val snapshotId: Output<String>? = null, val sourceVolumeArn: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val targetName: Output<String>? = null, val volumeSizeInBytes: Output<Int>? = null) : ConvertibleToJava<CachesIscsiVolumeArgs>

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 the aws.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 as UPLOAD BUFFER NOT CONFIGURED.

Example Usage

NOTE: These examples are referencing the aws.storagegateway.Cache resource gateway_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. via depends_on = [aws_storagegateway_cache&#46;example]) to ensure proper ordering.

Create Empty Cached iSCSI Volume

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.storagegateway.CachesIscsiVolume("example", {
gatewayArn: exampleAwsStoragegatewayCache.gatewayArn,
networkInterfaceId: exampleAwsInstance.privateIp,
targetName: "example",
volumeSizeInBytes: 5368709120,
});
import pulumi
import pulumi_aws as aws
example = aws.storagegateway.CachesIscsiVolume("example",
gateway_arn=example_aws_storagegateway_cache["gatewayArn"],
network_interface_id=example_aws_instance["privateIp"],
target_name="example",
volume_size_in_bytes=5368709120)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.StorageGateway.CachesIscsiVolume("example", new()
{
GatewayArn = exampleAwsStoragegatewayCache.GatewayArn,
NetworkInterfaceId = exampleAwsInstance.PrivateIp,
TargetName = "example",
VolumeSizeInBytes = 5368709120,
});
});
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.NewCachesIscsiVolume(ctx, "example", &storagegateway.CachesIscsiVolumeArgs{
GatewayArn: pulumi.Any(exampleAwsStoragegatewayCache.GatewayArn),
NetworkInterfaceId: pulumi.Any(exampleAwsInstance.PrivateIp),
TargetName: pulumi.String("example"),
VolumeSizeInBytes: pulumi.Int(5368709120),
})
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.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(exampleAwsStoragegatewayCache.gatewayArn())
.networkInterfaceId(exampleAwsInstance.privateIp())
.targetName("example")
.volumeSizeInBytes(5368709120)
.build());
}
}
resources:
example:
type: aws:storagegateway:CachesIscsiVolume
properties:
gatewayArn: ${exampleAwsStoragegatewayCache.gatewayArn}
networkInterfaceId: ${exampleAwsInstance.privateIp}
targetName: example
volumeSizeInBytes: 5.36870912e+09 # 5 GB

Create Cached iSCSI Volume From Snapshot

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.storagegateway.CachesIscsiVolume("example", {
gatewayArn: exampleAwsStoragegatewayCache.gatewayArn,
networkInterfaceId: exampleAwsInstance.privateIp,
snapshotId: exampleAwsEbsSnapshot.id,
targetName: "example",
volumeSizeInBytes: exampleAwsEbsSnapshot.volumeSize * 1024 * 1024 * 1024,
});
import pulumi
import pulumi_aws as aws
example = aws.storagegateway.CachesIscsiVolume("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",
volume_size_in_bytes=example_aws_ebs_snapshot["volumeSize"] * 1024 * 1024 * 1024)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.StorageGateway.CachesIscsiVolume("example", new()
{
GatewayArn = exampleAwsStoragegatewayCache.GatewayArn,
NetworkInterfaceId = exampleAwsInstance.PrivateIp,
SnapshotId = exampleAwsEbsSnapshot.Id,
TargetName = "example",
VolumeSizeInBytes = exampleAwsEbsSnapshot.VolumeSize * 1024 * 1024 * 1024,
});
});
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.NewCachesIscsiVolume(ctx, "example", &storagegateway.CachesIscsiVolumeArgs{
GatewayArn: pulumi.Any(exampleAwsStoragegatewayCache.GatewayArn),
NetworkInterfaceId: pulumi.Any(exampleAwsInstance.PrivateIp),
SnapshotId: pulumi.Any(exampleAwsEbsSnapshot.Id),
TargetName: pulumi.String("example"),
VolumeSizeInBytes: int(exampleAwsEbsSnapshot.VolumeSize * 1024 * 1024 * 1024),
})
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.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(exampleAwsStoragegatewayCache.gatewayArn())
.networkInterfaceId(exampleAwsInstance.privateIp())
.snapshotId(exampleAwsEbsSnapshot.id())
.targetName("example")
.volumeSizeInBytes(exampleAwsEbsSnapshot.volumeSize() * 1024 * 1024 * 1024)
.build());
}
}

Create Cached iSCSI Volume From Source Volume

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.storagegateway.CachesIscsiVolume("example", {
gatewayArn: exampleAwsStoragegatewayCache.gatewayArn,
networkInterfaceId: exampleAwsInstance.privateIp,
sourceVolumeArn: existing.arn,
targetName: "example",
volumeSizeInBytes: existing.volumeSizeInBytes,
});
import pulumi
import pulumi_aws as aws
example = aws.storagegateway.CachesIscsiVolume("example",
gateway_arn=example_aws_storagegateway_cache["gatewayArn"],
network_interface_id=example_aws_instance["privateIp"],
source_volume_arn=existing["arn"],
target_name="example",
volume_size_in_bytes=existing["volumeSizeInBytes"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.StorageGateway.CachesIscsiVolume("example", new()
{
GatewayArn = exampleAwsStoragegatewayCache.GatewayArn,
NetworkInterfaceId = exampleAwsInstance.PrivateIp,
SourceVolumeArn = existing.Arn,
TargetName = "example",
VolumeSizeInBytes = existing.VolumeSizeInBytes,
});
});
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.NewCachesIscsiVolume(ctx, "example", &storagegateway.CachesIscsiVolumeArgs{
GatewayArn: pulumi.Any(exampleAwsStoragegatewayCache.GatewayArn),
NetworkInterfaceId: pulumi.Any(exampleAwsInstance.PrivateIp),
SourceVolumeArn: pulumi.Any(existing.Arn),
TargetName: pulumi.String("example"),
VolumeSizeInBytes: pulumi.Any(existing.VolumeSizeInBytes),
})
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.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(exampleAwsStoragegatewayCache.gatewayArn())
.networkInterfaceId(exampleAwsInstance.privateIp())
.sourceVolumeArn(existing.arn())
.targetName("example")
.volumeSizeInBytes(existing.volumeSizeInBytes())
.build());
}
}
resources:
example:
type: aws:storagegateway:CachesIscsiVolume
properties:
gatewayArn: ${exampleAwsStoragegatewayCache.gatewayArn}
networkInterfaceId: ${exampleAwsInstance.privateIp}
sourceVolumeArn: ${existing.arn}
targetName: example
volumeSizeInBytes: ${existing.volumeSizeInBytes}

Import

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

$ pulumi import aws:storagegateway/cachesIscsiVolume:CachesIscsiVolume example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678

Constructors

Link copied to clipboard
constructor(gatewayArn: Output<String>? = null, kmsEncrypted: Output<Boolean>? = null, kmsKey: Output<String>? = null, networkInterfaceId: Output<String>? = null, snapshotId: Output<String>? = null, sourceVolumeArn: Output<String>? = null, tags: Output<Map<String, String>>? = null, targetName: Output<String>? = null, volumeSizeInBytes: Output<Int>? = null)

Properties

Link copied to clipboard
val gatewayArn: Output<String>? = null

The Amazon Resource Name (ARN) of the gateway.

Link copied to clipboard
val kmsEncrypted: Output<Boolean>? = null

Set to true to use Amazon S3 server side encryption with your own AWS KMS key, or false to use a key managed by Amazon S3.

Link copied to clipboard
val kmsKey: Output<String>? = null

The Amazon Resource Name (ARN) of the AWS KMS key used for Amazon S3 server side encryption. Is required when kms_encrypted is set.

Link copied to clipboard
val networkInterfaceId: Output<String>? = null

The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.

Link copied to clipboard
val snapshotId: Output<String>? = null

The snapshot ID of the snapshot to restore as the new cached volumeE.g., snap-1122aabb.

Link copied to clipboard
val sourceVolumeArn: Output<String>? = null

The ARN for an existing volume. Specifying this ARN makes the new volume into an exact copy of the specified existing volume's latest recovery point. The volume_size_in_bytes value for this new volume must be equal to or larger than the size of the existing volume, in bytes.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val targetName: Output<String>? = null

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.

Link copied to clipboard
val volumeSizeInBytes: Output<Int>? = null

The size of the volume in bytes.

Functions

Link copied to clipboard
open override fun toJava(): CachesIscsiVolumeArgs