-
Notifications
You must be signed in to change notification settings - Fork 50
/
account.go
411 lines (371 loc) · 18.1 KB
/
account.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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package storage
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manage an Azure Storage Account.
type Account struct {
s *pulumi.ResourceState
}
// NewAccount registers a new resource with the given unique name, arguments, and options.
func NewAccount(ctx *pulumi.Context,
name string, args *AccountArgs, opts ...pulumi.ResourceOpt) (*Account, error) {
if args == nil || args.AccountReplicationType == nil {
return nil, errors.New("missing required argument 'AccountReplicationType'")
}
if args == nil || args.AccountTier == nil {
return nil, errors.New("missing required argument 'AccountTier'")
}
if args == nil || args.Location == nil {
return nil, errors.New("missing required argument 'Location'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["accessTier"] = nil
inputs["accountEncryptionSource"] = nil
inputs["accountKind"] = nil
inputs["accountReplicationType"] = nil
inputs["accountTier"] = nil
inputs["accountType"] = nil
inputs["customDomain"] = nil
inputs["enableBlobEncryption"] = nil
inputs["enableFileEncryption"] = nil
inputs["enableHttpsTrafficOnly"] = nil
inputs["identity"] = nil
inputs["location"] = nil
inputs["name"] = nil
inputs["networkRules"] = nil
inputs["resourceGroupName"] = nil
inputs["tags"] = nil
} else {
inputs["accessTier"] = args.AccessTier
inputs["accountEncryptionSource"] = args.AccountEncryptionSource
inputs["accountKind"] = args.AccountKind
inputs["accountReplicationType"] = args.AccountReplicationType
inputs["accountTier"] = args.AccountTier
inputs["accountType"] = args.AccountType
inputs["customDomain"] = args.CustomDomain
inputs["enableBlobEncryption"] = args.EnableBlobEncryption
inputs["enableFileEncryption"] = args.EnableFileEncryption
inputs["enableHttpsTrafficOnly"] = args.EnableHttpsTrafficOnly
inputs["identity"] = args.Identity
inputs["location"] = args.Location
inputs["name"] = args.Name
inputs["networkRules"] = args.NetworkRules
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["tags"] = args.Tags
}
inputs["primaryAccessKey"] = nil
inputs["primaryBlobConnectionString"] = nil
inputs["primaryBlobEndpoint"] = nil
inputs["primaryConnectionString"] = nil
inputs["primaryFileEndpoint"] = nil
inputs["primaryLocation"] = nil
inputs["primaryQueueEndpoint"] = nil
inputs["primaryTableEndpoint"] = nil
inputs["secondaryAccessKey"] = nil
inputs["secondaryBlobConnectionString"] = nil
inputs["secondaryBlobEndpoint"] = nil
inputs["secondaryConnectionString"] = nil
inputs["secondaryLocation"] = nil
inputs["secondaryQueueEndpoint"] = nil
inputs["secondaryTableEndpoint"] = nil
s, err := ctx.RegisterResource("azure:storage/account:Account", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &Account{s: s}, nil
}
// GetAccount gets an existing Account resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetAccount(ctx *pulumi.Context,
name string, id pulumi.ID, state *AccountState, opts ...pulumi.ResourceOpt) (*Account, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["accessTier"] = state.AccessTier
inputs["accountEncryptionSource"] = state.AccountEncryptionSource
inputs["accountKind"] = state.AccountKind
inputs["accountReplicationType"] = state.AccountReplicationType
inputs["accountTier"] = state.AccountTier
inputs["accountType"] = state.AccountType
inputs["customDomain"] = state.CustomDomain
inputs["enableBlobEncryption"] = state.EnableBlobEncryption
inputs["enableFileEncryption"] = state.EnableFileEncryption
inputs["enableHttpsTrafficOnly"] = state.EnableHttpsTrafficOnly
inputs["identity"] = state.Identity
inputs["location"] = state.Location
inputs["name"] = state.Name
inputs["networkRules"] = state.NetworkRules
inputs["primaryAccessKey"] = state.PrimaryAccessKey
inputs["primaryBlobConnectionString"] = state.PrimaryBlobConnectionString
inputs["primaryBlobEndpoint"] = state.PrimaryBlobEndpoint
inputs["primaryConnectionString"] = state.PrimaryConnectionString
inputs["primaryFileEndpoint"] = state.PrimaryFileEndpoint
inputs["primaryLocation"] = state.PrimaryLocation
inputs["primaryQueueEndpoint"] = state.PrimaryQueueEndpoint
inputs["primaryTableEndpoint"] = state.PrimaryTableEndpoint
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["secondaryAccessKey"] = state.SecondaryAccessKey
inputs["secondaryBlobConnectionString"] = state.SecondaryBlobConnectionString
inputs["secondaryBlobEndpoint"] = state.SecondaryBlobEndpoint
inputs["secondaryConnectionString"] = state.SecondaryConnectionString
inputs["secondaryLocation"] = state.SecondaryLocation
inputs["secondaryQueueEndpoint"] = state.SecondaryQueueEndpoint
inputs["secondaryTableEndpoint"] = state.SecondaryTableEndpoint
inputs["tags"] = state.Tags
}
s, err := ctx.ReadResource("azure:storage/account:Account", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &Account{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *Account) URN() *pulumi.URNOutput {
return r.s.URN
}
// ID is this resource's unique identifier assigned by its provider.
func (r *Account) ID() *pulumi.IDOutput {
return r.s.ID
}
// Defines the access tier for `BlobStorage` and `StorageV2` accounts. Valid options are `Hot` and `Cool`, defaults to `Hot`.
func (r *Account) AccessTier() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["accessTier"])
}
// The Encryption Source for this Storage Account. Possible values are `Microsoft.Keyvault` and `Microsoft.Storage`. Defaults to `Microsoft.Storage`.
func (r *Account) AccountEncryptionSource() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["accountEncryptionSource"])
}
// Defines the Kind of account. Valid options are `Storage`,
// `StorageV2` and `BlobStorage`. Changing this forces a new resource to be created.
// Defaults to `Storage`.
func (r *Account) AccountKind() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["accountKind"])
}
// Defines the type of replication to use for this storage account. Valid options are `LRS`, `GRS`, `RAGRS` and `ZRS`.
func (r *Account) AccountReplicationType() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["accountReplicationType"])
}
// Defines the Tier to use for this storage account. Valid options are `Standard` and `Premium`. Changing this forces a new resource to be created
func (r *Account) AccountTier() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["accountTier"])
}
func (r *Account) AccountType() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["accountType"])
}
// A `custom_domain` block as documented below.
func (r *Account) CustomDomain() *pulumi.Output {
return r.s.State["customDomain"]
}
// Boolean flag which controls if Encryption Services are enabled for Blob storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/) for more information. Defaults to `true`.
func (r *Account) EnableBlobEncryption() *pulumi.BoolOutput {
return (*pulumi.BoolOutput)(r.s.State["enableBlobEncryption"])
}
// Boolean flag which controls if Encryption Services are enabled for File storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/) for more information. Defaults to `true`.
func (r *Account) EnableFileEncryption() *pulumi.BoolOutput {
return (*pulumi.BoolOutput)(r.s.State["enableFileEncryption"])
}
// Boolean flag which forces HTTPS if enabled, see [here](https://docs.microsoft.com/en-us/azure/storage/storage-require-secure-transfer/)
// for more information.
func (r *Account) EnableHttpsTrafficOnly() *pulumi.BoolOutput {
return (*pulumi.BoolOutput)(r.s.State["enableHttpsTrafficOnly"])
}
// A Managed Service Identity block as defined below.
func (r *Account) Identity() *pulumi.Output {
return r.s.State["identity"]
}
// Specifies the supported Azure location where the
// resource exists. Changing this forces a new resource to be created.
func (r *Account) Location() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["location"])
}
// The Custom Domain Name to use for the Storage Account, which will be validated by Azure.
func (r *Account) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// A `network_rules` block as documented below.
func (r *Account) NetworkRules() *pulumi.Output {
return r.s.State["networkRules"]
}
// The primary access key for the storage account
func (r *Account) PrimaryAccessKey() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryAccessKey"])
}
// The connection string associated with the primary blob location
func (r *Account) PrimaryBlobConnectionString() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryBlobConnectionString"])
}
// The endpoint URL for blob storage in the primary location.
func (r *Account) PrimaryBlobEndpoint() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryBlobEndpoint"])
}
// The connection string associated with the primary location
func (r *Account) PrimaryConnectionString() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryConnectionString"])
}
// The endpoint URL for file storage in the primary location.
func (r *Account) PrimaryFileEndpoint() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryFileEndpoint"])
}
// The primary location of the storage account.
func (r *Account) PrimaryLocation() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryLocation"])
}
// The endpoint URL for queue storage in the primary location.
func (r *Account) PrimaryQueueEndpoint() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryQueueEndpoint"])
}
// The endpoint URL for table storage in the primary location.
func (r *Account) PrimaryTableEndpoint() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["primaryTableEndpoint"])
}
// The name of the resource group in which to
// create the storage account. Changing this forces a new resource to be created.
func (r *Account) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// The secondary access key for the storage account
func (r *Account) SecondaryAccessKey() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryAccessKey"])
}
// The connection string associated with the secondary blob location
func (r *Account) SecondaryBlobConnectionString() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryBlobConnectionString"])
}
// The endpoint URL for blob storage in the secondary location.
func (r *Account) SecondaryBlobEndpoint() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryBlobEndpoint"])
}
// The connection string associated with the secondary location
func (r *Account) SecondaryConnectionString() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryConnectionString"])
}
// The secondary location of the storage account.
func (r *Account) SecondaryLocation() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryLocation"])
}
// The endpoint URL for queue storage in the secondary location.
func (r *Account) SecondaryQueueEndpoint() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryQueueEndpoint"])
}
// The endpoint URL for table storage in the secondary location.
func (r *Account) SecondaryTableEndpoint() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["secondaryTableEndpoint"])
}
// A mapping of tags to assign to the resource.
func (r *Account) Tags() *pulumi.MapOutput {
return (*pulumi.MapOutput)(r.s.State["tags"])
}
// Input properties used for looking up and filtering Account resources.
type AccountState struct {
// Defines the access tier for `BlobStorage` and `StorageV2` accounts. Valid options are `Hot` and `Cool`, defaults to `Hot`.
AccessTier interface{}
// The Encryption Source for this Storage Account. Possible values are `Microsoft.Keyvault` and `Microsoft.Storage`. Defaults to `Microsoft.Storage`.
AccountEncryptionSource interface{}
// Defines the Kind of account. Valid options are `Storage`,
// `StorageV2` and `BlobStorage`. Changing this forces a new resource to be created.
// Defaults to `Storage`.
AccountKind interface{}
// Defines the type of replication to use for this storage account. Valid options are `LRS`, `GRS`, `RAGRS` and `ZRS`.
AccountReplicationType interface{}
// Defines the Tier to use for this storage account. Valid options are `Standard` and `Premium`. Changing this forces a new resource to be created
AccountTier interface{}
AccountType interface{}
// A `custom_domain` block as documented below.
CustomDomain interface{}
// Boolean flag which controls if Encryption Services are enabled for Blob storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/) for more information. Defaults to `true`.
EnableBlobEncryption interface{}
// Boolean flag which controls if Encryption Services are enabled for File storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/) for more information. Defaults to `true`.
EnableFileEncryption interface{}
// Boolean flag which forces HTTPS if enabled, see [here](https://docs.microsoft.com/en-us/azure/storage/storage-require-secure-transfer/)
// for more information.
EnableHttpsTrafficOnly interface{}
// A Managed Service Identity block as defined below.
Identity interface{}
// Specifies the supported Azure location where the
// resource exists. Changing this forces a new resource to be created.
Location interface{}
// The Custom Domain Name to use for the Storage Account, which will be validated by Azure.
Name interface{}
// A `network_rules` block as documented below.
NetworkRules interface{}
// The primary access key for the storage account
PrimaryAccessKey interface{}
// The connection string associated with the primary blob location
PrimaryBlobConnectionString interface{}
// The endpoint URL for blob storage in the primary location.
PrimaryBlobEndpoint interface{}
// The connection string associated with the primary location
PrimaryConnectionString interface{}
// The endpoint URL for file storage in the primary location.
PrimaryFileEndpoint interface{}
// The primary location of the storage account.
PrimaryLocation interface{}
// The endpoint URL for queue storage in the primary location.
PrimaryQueueEndpoint interface{}
// The endpoint URL for table storage in the primary location.
PrimaryTableEndpoint interface{}
// The name of the resource group in which to
// create the storage account. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// The secondary access key for the storage account
SecondaryAccessKey interface{}
// The connection string associated with the secondary blob location
SecondaryBlobConnectionString interface{}
// The endpoint URL for blob storage in the secondary location.
SecondaryBlobEndpoint interface{}
// The connection string associated with the secondary location
SecondaryConnectionString interface{}
// The secondary location of the storage account.
SecondaryLocation interface{}
// The endpoint URL for queue storage in the secondary location.
SecondaryQueueEndpoint interface{}
// The endpoint URL for table storage in the secondary location.
SecondaryTableEndpoint interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
}
// The set of arguments for constructing a Account resource.
type AccountArgs struct {
// Defines the access tier for `BlobStorage` and `StorageV2` accounts. Valid options are `Hot` and `Cool`, defaults to `Hot`.
AccessTier interface{}
// The Encryption Source for this Storage Account. Possible values are `Microsoft.Keyvault` and `Microsoft.Storage`. Defaults to `Microsoft.Storage`.
AccountEncryptionSource interface{}
// Defines the Kind of account. Valid options are `Storage`,
// `StorageV2` and `BlobStorage`. Changing this forces a new resource to be created.
// Defaults to `Storage`.
AccountKind interface{}
// Defines the type of replication to use for this storage account. Valid options are `LRS`, `GRS`, `RAGRS` and `ZRS`.
AccountReplicationType interface{}
// Defines the Tier to use for this storage account. Valid options are `Standard` and `Premium`. Changing this forces a new resource to be created
AccountTier interface{}
AccountType interface{}
// A `custom_domain` block as documented below.
CustomDomain interface{}
// Boolean flag which controls if Encryption Services are enabled for Blob storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/) for more information. Defaults to `true`.
EnableBlobEncryption interface{}
// Boolean flag which controls if Encryption Services are enabled for File storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/) for more information. Defaults to `true`.
EnableFileEncryption interface{}
// Boolean flag which forces HTTPS if enabled, see [here](https://docs.microsoft.com/en-us/azure/storage/storage-require-secure-transfer/)
// for more information.
EnableHttpsTrafficOnly interface{}
// A Managed Service Identity block as defined below.
Identity interface{}
// Specifies the supported Azure location where the
// resource exists. Changing this forces a new resource to be created.
Location interface{}
// The Custom Domain Name to use for the Storage Account, which will be validated by Azure.
Name interface{}
// A `network_rules` block as documented below.
NetworkRules interface{}
// The name of the resource group in which to
// create the storage account. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A mapping of tags to assign to the resource.
Tags interface{}
}