/
getVolume.go
240 lines (213 loc) · 15.1 KB
/
getVolume.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Specifies an Amazon Elastic Block Store (Amazon EBS) volume.
//
// When you use CFNlong to update an Amazon EBS volume that modifies ``Iops``, ``Size``, or ``VolumeType``, there is a cooldown period before another operation can occur. This can cause your stack to report being in ``UPDATE_IN_PROGRESS`` or ``UPDATE_ROLLBACK_IN_PROGRESS`` for long periods of time.
// Amazon EBS does not support sizing down an Amazon EBS volume. CFNlong does not attempt to modify an Amazon EBS volume to a smaller size on rollback.
// Some common scenarios when you might encounter a cooldown period for Amazon EBS include:
// + You successfully update an Amazon EBS volume and the update succeeds. When you attempt another update within the cooldown window, that update will be subject to a cooldown period.
// + You successfully update an Amazon EBS volume and the update succeeds but another change in your ``update-stack`` call fails. The rollback will be subject to a cooldown period.
//
// For more information on the coo
func LookupVolume(ctx *pulumi.Context, args *LookupVolumeArgs, opts ...pulumi.InvokeOption) (*LookupVolumeResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupVolumeResult
err := ctx.Invoke("aws-native:ec2:getVolume", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupVolumeArgs struct {
VolumeId string `pulumi:"volumeId"`
}
type LookupVolumeResult struct {
// Indicates whether the volume is auto-enabled for I/O operations. By default, Amazon EBS disables I/O to the volume from attached EC2 instances when it determines that a volume's data is potentially inconsistent. If the consistency of the volume is not a concern, and you prefer that the volume be made available immediately if it's impaired, you can configure the volume to automatically enable I/O.
AutoEnableIo *bool `pulumi:"autoEnableIo"`
// The ID of the Availability Zone in which to create the volume. For example, ``us-east-1a``.
AvailabilityZone *string `pulumi:"availabilityZone"`
// Indicates whether the volume should be encrypted. The effect of setting the encryption state to ``true`` depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see [Encryption by default](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) in the *Amazon Elastic Compute Cloud User Guide*.
// Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see [Supported instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances).
Encrypted *bool `pulumi:"encrypted"`
// The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and ``io2`` volumes, this represents the number of IOPS that are provisioned for the volume. For ``gp2`` volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.
// The following are the supported values for each volume type:
// + ``gp3``: 3,000 - 16,000 IOPS
// + ``io1``: 100 - 64,000 IOPS
// + ``io2``: 100 - 256,000 IOPS
//
// For ``io2`` volumes, you can achieve up to 256,000 IOPS on [instances built on the Nitro System](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). On other instances, you can achieve performance up to 32,000 IOPS.
// This parameter is required for ``io1`` and ``io2`` volumes. The default for ``gp3`` volumes is 3,000 IOPS. This parameter is not supported for ``gp2``, ``st1``, ``sc1``, or ``standard`` volumes.
Iops *int `pulumi:"iops"`
// The identifier of the kms-key-long to use for Amazon EBS encryption. If ``KmsKeyId`` is specified, the encrypted state must be ``true``.
// If you omit this property and your account is enabled for encryption by default, or *Encrypted* is set to ``true``, then the volume is encrypted using the default key specified for your account. If your account does not have a default key, then the volume is encrypted using the aws-managed-key.
// Alternatively, if you want to specify a different key, you can specify one of the following:
// + Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
// + Key alias. Specify the alias for the key, prefixed with ``alias/``. For example, for a key with the alias ``my_cmk``, use ``alias/my_cmk``. Or to specify the aws-managed-key, use ``alias/aws/ebs``.
// + Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
// + Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
KmsKeyId *string `pulumi:"kmsKeyId"`
// Indicates whether Amazon EBS Multi-Attach is enabled.
// CFNlong does not currently support updating a single-attach volume to be multi-attach enabled, updating a multi-attach enabled volume to be single-attach, or updating the size or number of I/O operations per second (IOPS) of a multi-attach enabled volume.
MultiAttachEnabled *bool `pulumi:"multiAttachEnabled"`
// The Amazon Resource Name (ARN) of the Outpost.
OutpostArn *string `pulumi:"outpostArn"`
// The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size.
// The following are the supported volumes sizes for each volume type:
// + ``gp2`` and ``gp3``: 1 - 16,384 GiB
// + ``io1``: 4 - 16,384 GiB
// + ``io2``: 4 - 65,536 GiB
// + ``st1`` and ``sc1``: 125 - 16,384 GiB
// + ``standard``: 1 - 1024 GiB
Size *int `pulumi:"size"`
// The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.
SnapshotId *string `pulumi:"snapshotId"`
// The tags to apply to the volume during creation.
Tags []aws.Tag `pulumi:"tags"`
// The throughput to provision for a volume, with a maximum of 1,000 MiB/s.
// This parameter is valid only for ``gp3`` volumes. The default value is 125.
// Valid Range: Minimum value of 125. Maximum value of 1000.
Throughput *int `pulumi:"throughput"`
VolumeId *string `pulumi:"volumeId"`
// The volume type. This parameter can be one of the following values:
// + General Purpose SSD: ``gp2`` | ``gp3``
// + Provisioned IOPS SSD: ``io1`` | ``io2``
// + Throughput Optimized HDD: ``st1``
// + Cold HDD: ``sc1``
// + Magnetic: ``standard``
//
// For more information, see [Amazon EBS volume types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) in the *Amazon Elastic Compute Cloud User Guide*.
// Default: ``gp2``
VolumeType *string `pulumi:"volumeType"`
}
func LookupVolumeOutput(ctx *pulumi.Context, args LookupVolumeOutputArgs, opts ...pulumi.InvokeOption) LookupVolumeResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupVolumeResult, error) {
args := v.(LookupVolumeArgs)
r, err := LookupVolume(ctx, &args, opts...)
var s LookupVolumeResult
if r != nil {
s = *r
}
return s, err
}).(LookupVolumeResultOutput)
}
type LookupVolumeOutputArgs struct {
VolumeId pulumi.StringInput `pulumi:"volumeId"`
}
func (LookupVolumeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVolumeArgs)(nil)).Elem()
}
type LookupVolumeResultOutput struct{ *pulumi.OutputState }
func (LookupVolumeResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVolumeResult)(nil)).Elem()
}
func (o LookupVolumeResultOutput) ToLookupVolumeResultOutput() LookupVolumeResultOutput {
return o
}
func (o LookupVolumeResultOutput) ToLookupVolumeResultOutputWithContext(ctx context.Context) LookupVolumeResultOutput {
return o
}
// Indicates whether the volume is auto-enabled for I/O operations. By default, Amazon EBS disables I/O to the volume from attached EC2 instances when it determines that a volume's data is potentially inconsistent. If the consistency of the volume is not a concern, and you prefer that the volume be made available immediately if it's impaired, you can configure the volume to automatically enable I/O.
func (o LookupVolumeResultOutput) AutoEnableIo() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *bool { return v.AutoEnableIo }).(pulumi.BoolPtrOutput)
}
// The ID of the Availability Zone in which to create the volume. For example, “us-east-1a“.
func (o LookupVolumeResultOutput) AvailabilityZone() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *string { return v.AvailabilityZone }).(pulumi.StringPtrOutput)
}
// Indicates whether the volume should be encrypted. The effect of setting the encryption state to “true“ depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see [Encryption by default](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) in the *Amazon Elastic Compute Cloud User Guide*.
//
// Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see [Supported instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances).
func (o LookupVolumeResultOutput) Encrypted() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *bool { return v.Encrypted }).(pulumi.BoolPtrOutput)
}
// The number of I/O operations per second (IOPS). For “gp3“, “io1“, and “io2“ volumes, this represents the number of IOPS that are provisioned for the volume. For “gp2“ volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.
//
// The following are the supported values for each volume type:
// + ``gp3``: 3,000 - 16,000 IOPS
// + ``io1``: 100 - 64,000 IOPS
// + ``io2``: 100 - 256,000 IOPS
//
// For ``io2`` volumes, you can achieve up to 256,000 IOPS on [instances built on the Nitro System](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). On other instances, you can achieve performance up to 32,000 IOPS.
// This parameter is required for ``io1`` and ``io2`` volumes. The default for ``gp3`` volumes is 3,000 IOPS. This parameter is not supported for ``gp2``, ``st1``, ``sc1``, or ``standard`` volumes.
func (o LookupVolumeResultOutput) Iops() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *int { return v.Iops }).(pulumi.IntPtrOutput)
}
// The identifier of the kms-key-long to use for Amazon EBS encryption. If “KmsKeyId“ is specified, the encrypted state must be “true“.
//
// If you omit this property and your account is enabled for encryption by default, or *Encrypted* is set to ``true``, then the volume is encrypted using the default key specified for your account. If your account does not have a default key, then the volume is encrypted using the aws-managed-key.
// Alternatively, if you want to specify a different key, you can specify one of the following:
// + Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
// + Key alias. Specify the alias for the key, prefixed with ``alias/``. For example, for a key with the alias ``my_cmk``, use ``alias/my_cmk``. Or to specify the aws-managed-key, use ``alias/aws/ebs``.
// + Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
// + Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
func (o LookupVolumeResultOutput) KmsKeyId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *string { return v.KmsKeyId }).(pulumi.StringPtrOutput)
}
// Indicates whether Amazon EBS Multi-Attach is enabled.
//
// CFNlong does not currently support updating a single-attach volume to be multi-attach enabled, updating a multi-attach enabled volume to be single-attach, or updating the size or number of I/O operations per second (IOPS) of a multi-attach enabled volume.
func (o LookupVolumeResultOutput) MultiAttachEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *bool { return v.MultiAttachEnabled }).(pulumi.BoolPtrOutput)
}
// The Amazon Resource Name (ARN) of the Outpost.
func (o LookupVolumeResultOutput) OutpostArn() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *string { return v.OutpostArn }).(pulumi.StringPtrOutput)
}
// The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size.
//
// The following are the supported volumes sizes for each volume type:
// + ``gp2`` and ``gp3``: 1 - 16,384 GiB
// + ``io1``: 4 - 16,384 GiB
// + ``io2``: 4 - 65,536 GiB
// + ``st1`` and ``sc1``: 125 - 16,384 GiB
// + ``standard``: 1 - 1024 GiB
func (o LookupVolumeResultOutput) Size() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *int { return v.Size }).(pulumi.IntPtrOutput)
}
// The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.
func (o LookupVolumeResultOutput) SnapshotId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *string { return v.SnapshotId }).(pulumi.StringPtrOutput)
}
// The tags to apply to the volume during creation.
func (o LookupVolumeResultOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v LookupVolumeResult) []aws.Tag { return v.Tags }).(aws.TagArrayOutput)
}
// The throughput to provision for a volume, with a maximum of 1,000 MiB/s.
//
// This parameter is valid only for ``gp3`` volumes. The default value is 125.
// Valid Range: Minimum value of 125. Maximum value of 1000.
func (o LookupVolumeResultOutput) Throughput() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *int { return v.Throughput }).(pulumi.IntPtrOutput)
}
func (o LookupVolumeResultOutput) VolumeId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *string { return v.VolumeId }).(pulumi.StringPtrOutput)
}
// The volume type. This parameter can be one of the following values:
//
// - General Purpose SSD: “gp2“ | “gp3“
//
// - Provisioned IOPS SSD: “io1“ | “io2“
//
// - Throughput Optimized HDD: “st1“
//
// - Cold HDD: “sc1“
//
// - Magnetic: “standard“
//
// For more information, see [Amazon EBS volume types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) in the *Amazon Elastic Compute Cloud User Guide*.
// Default: “gp2“
func (o LookupVolumeResultOutput) VolumeType() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVolumeResult) *string { return v.VolumeType }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupVolumeResultOutput{})
}