CachesIscsiVolume
Manages an AWS Storage Gateway cached iSCSI volume.
NOTE: The gateway must have cache added (e.g. via the
aws.storagegateway.Cacheresource) 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.UploadBufferresource) 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
Create Empty Cached iSCSI Volume
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.StorageGateway.CachesIscsiVolume("example", new Aws.StorageGateway.CachesIscsiVolumeArgs
{
GatewayArn = aws_storagegateway_cache.Example.Gateway_arn,
NetworkInterfaceId = aws_instance.Example.Private_ip,
TargetName = "example",
VolumeSizeInBytes = 5368709120,
});
// 5 GB
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/storagegateway"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storagegateway.NewCachesIscsiVolume(ctx, "example", &storagegateway.CachesIscsiVolumeArgs{
GatewayArn: pulumi.String(aws_storagegateway_cache.Example.Gateway_arn),
NetworkInterfaceId: pulumi.String(aws_instance.Example.Private_ip),
TargetName: pulumi.String("example"),
VolumeSizeInBytes: pulumi.Int(5368709120),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.storagegateway.CachesIscsiVolume("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 GBimport * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.storagegateway.CachesIscsiVolume("example", {
gatewayArn: aws_storagegateway_cache_example.gatewayArn,
networkInterfaceId: aws_instance_example.privateIp,
targetName: "example",
volumeSizeInBytes: 5368709120, // 5 GB
});Create Cached iSCSI Volume From Snapshot
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.StorageGateway.CachesIscsiVolume("example", new Aws.StorageGateway.CachesIscsiVolumeArgs
{
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,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/storagegateway"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storagegateway.NewCachesIscsiVolume(ctx, "example", &storagegateway.CachesIscsiVolumeArgs{
GatewayArn: pulumi.String(aws_storagegateway_cache.Example.Gateway_arn),
NetworkInterfaceId: pulumi.String(aws_instance.Example.Private_ip),
SnapshotId: pulumi.String(aws_ebs_snapshot.Example.Id),
TargetName: pulumi.String("example"),
VolumeSizeInBytes: pulumi.Int(aws_ebs_snapshot.Example.Volume_size * 1024 * 1024 * 1024),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.storagegateway.CachesIscsiVolume("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)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.storagegateway.CachesIscsiVolume("example", {
gatewayArn: aws_storagegateway_cache_example.gatewayArn,
networkInterfaceId: aws_instance_example.privateIp,
snapshotId: aws_ebs_snapshot_example.id,
targetName: "example",
volumeSizeInBytes: aws_ebs_snapshot_example.volumeSize.apply(volumeSize => (((volumeSize * 1024) * 1024) * 1024)),
});Create Cached iSCSI Volume From Source Volume
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.StorageGateway.CachesIscsiVolume("example", new Aws.StorageGateway.CachesIscsiVolumeArgs
{
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,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/storagegateway"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storagegateway.NewCachesIscsiVolume(ctx, "example", &storagegateway.CachesIscsiVolumeArgs{
GatewayArn: pulumi.String(aws_storagegateway_cache.Example.Gateway_arn),
NetworkInterfaceId: pulumi.String(aws_instance.Example.Private_ip),
SourceVolumeArn: pulumi.String(aws_storagegateway_cached_iscsi_volume.Existing.Arn),
TargetName: pulumi.String("example"),
VolumeSizeInBytes: pulumi.String(aws_storagegateway_cached_iscsi_volume.Existing.Volume_size_in_bytes),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.storagegateway.CachesIscsiVolume("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"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.storagegateway.CachesIscsiVolume("example", {
gatewayArn: aws_storagegateway_cache_example.gatewayArn,
networkInterfaceId: aws_instance_example.privateIp,
sourceVolumeArn: aws_storagegateway_cached_iscsi_volume_existing.arn,
targetName: "example",
volumeSizeInBytes: aws_storagegateway_cached_iscsi_volume_existing.volumeSizeInBytes,
});Create a CachesIscsiVolume Resource
new CachesIscsiVolume(name: string, args: CachesIscsiVolumeArgs, opts?: CustomResourceOptions);def CachesIscsiVolume(resource_name, opts=None, gateway_arn=None, network_interface_id=None, snapshot_id=None, source_volume_arn=None, tags=None, target_name=None, volume_size_in_bytes=None, __props__=None);func NewCachesIscsiVolume(ctx *Context, name string, args CachesIscsiVolumeArgs, opts ...ResourceOption) (*CachesIscsiVolume, error)public CachesIscsiVolume(string name, CachesIscsiVolumeArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args CachesIscsiVolumeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CachesIscsiVolumeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CachesIscsiVolumeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
CachesIscsiVolume Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The CachesIscsiVolume resource accepts the following input properties:
- Gateway
Arn string The Amazon Resource Name (ARN) of the gateway.
- Network
Interface stringId The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
- Target
Name string 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.
- Volume
Size intIn Bytes The size of the volume in bytes.
- Snapshot
Id string The snapshot ID of the snapshot to restore as the new cached volume. e.g.
snap-1122aabb.- Source
Volume stringArn 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_bytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes.- Dictionary<string, string>
Key-value map of resource tags
- Gateway
Arn string The Amazon Resource Name (ARN) of the gateway.
- Network
Interface stringId The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
- Target
Name string 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.
- Volume
Size intIn Bytes The size of the volume in bytes.
- Snapshot
Id string The snapshot ID of the snapshot to restore as the new cached volume. e.g.
snap-1122aabb.- Source
Volume stringArn 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_bytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes.- map[string]string
Key-value map of resource tags
- gateway
Arn string The Amazon Resource Name (ARN) of the gateway.
- network
Interface stringId The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
- target
Name string 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.
- volume
Size numberIn Bytes The size of the volume in bytes.
- snapshot
Id string The snapshot ID of the snapshot to restore as the new cached volume. e.g.
snap-1122aabb.- source
Volume stringArn 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_bytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes.- {[key: string]: string}
Key-value map of resource tags
- gateway_
arn str The Amazon Resource Name (ARN) of the gateway.
- network_
interface_ strid The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
- target_
name str 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.
- volume_
size_ floatin_ bytes The size of the volume in bytes.
- snapshot_
id str The snapshot ID of the snapshot to restore as the new cached volume. e.g.
snap-1122aabb.- source_
volume_ strarn 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_bytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes.- Dict[str, str]
Key-value map of resource tags
Outputs
All input properties are implicitly available as output properties. Additionally, the CachesIscsiVolume resource produces the following output properties:
- Arn string
Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- Chap
Enabled bool Whether mutual CHAP is enabled for the iSCSI target.
- Id string
- The provider-assigned unique ID for this managed resource.
- Lun
Number int Logical disk number.
- Network
Interface intPort The port used to communicate with iSCSI targets.
- Target
Arn string Target Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/target/iqn.1997-05.com.amazon:TargetName.- Volume
Arn string Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- Volume
Id string Volume ID, e.g.
vol-12345678.
- Arn string
Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- Chap
Enabled bool Whether mutual CHAP is enabled for the iSCSI target.
- Id string
- The provider-assigned unique ID for this managed resource.
- Lun
Number int Logical disk number.
- Network
Interface intPort The port used to communicate with iSCSI targets.
- Target
Arn string Target Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/target/iqn.1997-05.com.amazon:TargetName.- Volume
Arn string Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- Volume
Id string Volume ID, e.g.
vol-12345678.
- arn string
Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- chap
Enabled boolean Whether mutual CHAP is enabled for the iSCSI target.
- id string
- The provider-assigned unique ID for this managed resource.
- lun
Number number Logical disk number.
- network
Interface numberPort The port used to communicate with iSCSI targets.
- target
Arn string Target Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/target/iqn.1997-05.com.amazon:TargetName.- volume
Arn string Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- volume
Id string Volume ID, e.g.
vol-12345678.
- arn str
Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- chap_
enabled bool Whether mutual CHAP is enabled for the iSCSI target.
- id str
- The provider-assigned unique ID for this managed resource.
- lun_
number float Logical disk number.
- network_
interface_ floatport The port used to communicate with iSCSI targets.
- target_
arn str Target Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/target/iqn.1997-05.com.amazon:TargetName.- volume_
arn str Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- volume_
id str Volume ID, e.g.
vol-12345678.
Look up an Existing CachesIscsiVolume Resource
Get an existing CachesIscsiVolume resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CachesIscsiVolumeState, opts?: CustomResourceOptions): CachesIscsiVolumestatic get(resource_name, id, opts=None, arn=None, chap_enabled=None, gateway_arn=None, lun_number=None, network_interface_id=None, network_interface_port=None, snapshot_id=None, source_volume_arn=None, tags=None, target_arn=None, target_name=None, volume_arn=None, volume_id=None, volume_size_in_bytes=None, __props__=None);func GetCachesIscsiVolume(ctx *Context, name string, id IDInput, state *CachesIscsiVolumeState, opts ...ResourceOption) (*CachesIscsiVolume, error)public static CachesIscsiVolume Get(string name, Input<string> id, CachesIscsiVolumeState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Arn string
Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- Chap
Enabled bool Whether mutual CHAP is enabled for the iSCSI target.
- Gateway
Arn string The Amazon Resource Name (ARN) of the gateway.
- Lun
Number int Logical disk number.
- Network
Interface stringId The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
- Network
Interface intPort The port used to communicate with iSCSI targets.
- Snapshot
Id string The snapshot ID of the snapshot to restore as the new cached volume. e.g.
snap-1122aabb.- Source
Volume stringArn 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_bytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes.- Dictionary<string, string>
Key-value map of resource tags
- Target
Arn string Target Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/target/iqn.1997-05.com.amazon:TargetName.- Target
Name string 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.
- Volume
Arn string Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- Volume
Id string Volume ID, e.g.
vol-12345678.- Volume
Size intIn Bytes The size of the volume in bytes.
- Arn string
Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- Chap
Enabled bool Whether mutual CHAP is enabled for the iSCSI target.
- Gateway
Arn string The Amazon Resource Name (ARN) of the gateway.
- Lun
Number int Logical disk number.
- Network
Interface stringId The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
- Network
Interface intPort The port used to communicate with iSCSI targets.
- Snapshot
Id string The snapshot ID of the snapshot to restore as the new cached volume. e.g.
snap-1122aabb.- Source
Volume stringArn 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_bytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes.- map[string]string
Key-value map of resource tags
- Target
Arn string Target Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/target/iqn.1997-05.com.amazon:TargetName.- Target
Name string 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.
- Volume
Arn string Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- Volume
Id string Volume ID, e.g.
vol-12345678.- Volume
Size intIn Bytes The size of the volume in bytes.
- arn string
Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- chap
Enabled boolean Whether mutual CHAP is enabled for the iSCSI target.
- gateway
Arn string The Amazon Resource Name (ARN) of the gateway.
- lun
Number number Logical disk number.
- network
Interface stringId The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
- network
Interface numberPort The port used to communicate with iSCSI targets.
- snapshot
Id string The snapshot ID of the snapshot to restore as the new cached volume. e.g.
snap-1122aabb.- source
Volume stringArn 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_bytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes.- {[key: string]: string}
Key-value map of resource tags
- target
Arn string Target Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/target/iqn.1997-05.com.amazon:TargetName.- target
Name string 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.
- volume
Arn string Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- volume
Id string Volume ID, e.g.
vol-12345678.- volume
Size numberIn Bytes The size of the volume in bytes.
- arn str
Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- chap_
enabled bool Whether mutual CHAP is enabled for the iSCSI target.
- gateway_
arn str The Amazon Resource Name (ARN) of the gateway.
- lun_
number float Logical disk number.
- network_
interface_ strid The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted.
- network_
interface_ floatport The port used to communicate with iSCSI targets.
- snapshot_
id str The snapshot ID of the snapshot to restore as the new cached volume. e.g.
snap-1122aabb.- source_
volume_ strarn 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_bytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes.- Dict[str, str]
Key-value map of resource tags
- target_
arn str Target Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/target/iqn.1997-05.com.amazon:TargetName.- target_
name str 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.
- volume_
arn str Volume Amazon Resource Name (ARN), e.g.
arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678.- volume_
id str Volume ID, e.g.
vol-12345678.- volume_
size_ floatin_ bytes The size of the volume in bytes.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.