/
smbFileShare.go
226 lines (213 loc) · 14.2 KB
/
smbFileShare.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
// *** 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 storagegateway
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an AWS Storage Gateway SMB File Share.
type SmbFileShare struct {
pulumi.CustomResourceState
// Amazon Resource Name (ARN) of the SMB File Share.
Arn pulumi.StringOutput `pulumi:"arn"`
// The authentication method that users use to access the file share. Defaults to `ActiveDirectory`. Valid values: `ActiveDirectory`, `GuestAccess`.
Authentication pulumi.StringPtrOutput `pulumi:"authentication"`
// The default storage class for objects put into an Amazon S3 bucket by the file gateway. Defaults to `S3_STANDARD`. Valid values: `S3_STANDARD`, `S3_STANDARD_IA`, `S3_ONEZONE_IA`.
DefaultStorageClass pulumi.StringPtrOutput `pulumi:"defaultStorageClass"`
// ID of the SMB File Share.
FileshareId pulumi.StringOutput `pulumi:"fileshareId"`
// Amazon Resource Name (ARN) of the file gateway.
GatewayArn pulumi.StringOutput `pulumi:"gatewayArn"`
// Boolean value that enables guessing of the MIME type for uploaded objects based on file extensions. Defaults to `true`.
GuessMimeTypeEnabled pulumi.BoolPtrOutput `pulumi:"guessMimeTypeEnabled"`
// A list of users in the Active Directory that are not allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
InvalidUserLists pulumi.StringArrayOutput `pulumi:"invalidUserLists"`
// Boolean value if `true` to use Amazon S3 server side encryption with your own AWS KMS key, or `false` to use a key managed by Amazon S3. Defaults to `false`.
KmsEncrypted pulumi.BoolPtrOutput `pulumi:"kmsEncrypted"`
// Amazon Resource Name (ARN) for KMS key used for Amazon S3 server side encryption. This value can only be set when `kmsEncrypted` is true.
KmsKeyArn pulumi.StringPtrOutput `pulumi:"kmsKeyArn"`
// The ARN of the backed storage used for storing file data.
LocationArn pulumi.StringOutput `pulumi:"locationArn"`
// Access Control List permission for S3 bucket objects. Defaults to `private`.
ObjectAcl pulumi.StringPtrOutput `pulumi:"objectAcl"`
// Boolean to indicate write status of file share. File share does not accept writes if `true`. Defaults to `false`.
ReadOnly pulumi.BoolPtrOutput `pulumi:"readOnly"`
// Boolean who pays the cost of the request and the data download from the Amazon S3 bucket. Set this value to `true` if you want the requester to pay instead of the bucket owner. Defaults to `false`.
RequesterPays pulumi.BoolPtrOutput `pulumi:"requesterPays"`
// The ARN of the AWS Identity and Access Management (IAM) role that a file gateway assumes when it accesses the underlying storage.
RoleArn pulumi.StringOutput `pulumi:"roleArn"`
// Key-value mapping of resource tags
Tags pulumi.MapOutput `pulumi:"tags"`
// A list of users in the Active Directory that are allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
ValidUserLists pulumi.StringArrayOutput `pulumi:"validUserLists"`
}
// NewSmbFileShare registers a new resource with the given unique name, arguments, and options.
func NewSmbFileShare(ctx *pulumi.Context,
name string, args *SmbFileShareArgs, opts ...pulumi.ResourceOption) (*SmbFileShare, error) {
if args == nil || args.GatewayArn == nil {
return nil, errors.New("missing required argument 'GatewayArn'")
}
if args == nil || args.LocationArn == nil {
return nil, errors.New("missing required argument 'LocationArn'")
}
if args == nil || args.RoleArn == nil {
return nil, errors.New("missing required argument 'RoleArn'")
}
if args == nil {
args = &SmbFileShareArgs{}
}
var resource SmbFileShare
err := ctx.RegisterResource("aws:storagegateway/smbFileShare:SmbFileShare", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSmbFileShare gets an existing SmbFileShare 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 GetSmbFileShare(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SmbFileShareState, opts ...pulumi.ResourceOption) (*SmbFileShare, error) {
var resource SmbFileShare
err := ctx.ReadResource("aws:storagegateway/smbFileShare:SmbFileShare", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SmbFileShare resources.
type smbFileShareState struct {
// Amazon Resource Name (ARN) of the SMB File Share.
Arn *string `pulumi:"arn"`
// The authentication method that users use to access the file share. Defaults to `ActiveDirectory`. Valid values: `ActiveDirectory`, `GuestAccess`.
Authentication *string `pulumi:"authentication"`
// The default storage class for objects put into an Amazon S3 bucket by the file gateway. Defaults to `S3_STANDARD`. Valid values: `S3_STANDARD`, `S3_STANDARD_IA`, `S3_ONEZONE_IA`.
DefaultStorageClass *string `pulumi:"defaultStorageClass"`
// ID of the SMB File Share.
FileshareId *string `pulumi:"fileshareId"`
// Amazon Resource Name (ARN) of the file gateway.
GatewayArn *string `pulumi:"gatewayArn"`
// Boolean value that enables guessing of the MIME type for uploaded objects based on file extensions. Defaults to `true`.
GuessMimeTypeEnabled *bool `pulumi:"guessMimeTypeEnabled"`
// A list of users in the Active Directory that are not allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
InvalidUserLists []string `pulumi:"invalidUserLists"`
// Boolean value if `true` to use Amazon S3 server side encryption with your own AWS KMS key, or `false` to use a key managed by Amazon S3. Defaults to `false`.
KmsEncrypted *bool `pulumi:"kmsEncrypted"`
// Amazon Resource Name (ARN) for KMS key used for Amazon S3 server side encryption. This value can only be set when `kmsEncrypted` is true.
KmsKeyArn *string `pulumi:"kmsKeyArn"`
// The ARN of the backed storage used for storing file data.
LocationArn *string `pulumi:"locationArn"`
// Access Control List permission for S3 bucket objects. Defaults to `private`.
ObjectAcl *string `pulumi:"objectAcl"`
// Boolean to indicate write status of file share. File share does not accept writes if `true`. Defaults to `false`.
ReadOnly *bool `pulumi:"readOnly"`
// Boolean who pays the cost of the request and the data download from the Amazon S3 bucket. Set this value to `true` if you want the requester to pay instead of the bucket owner. Defaults to `false`.
RequesterPays *bool `pulumi:"requesterPays"`
// The ARN of the AWS Identity and Access Management (IAM) role that a file gateway assumes when it accesses the underlying storage.
RoleArn *string `pulumi:"roleArn"`
// Key-value mapping of resource tags
Tags map[string]interface{} `pulumi:"tags"`
// A list of users in the Active Directory that are allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
ValidUserLists []string `pulumi:"validUserLists"`
}
type SmbFileShareState struct {
// Amazon Resource Name (ARN) of the SMB File Share.
Arn pulumi.StringPtrInput
// The authentication method that users use to access the file share. Defaults to `ActiveDirectory`. Valid values: `ActiveDirectory`, `GuestAccess`.
Authentication pulumi.StringPtrInput
// The default storage class for objects put into an Amazon S3 bucket by the file gateway. Defaults to `S3_STANDARD`. Valid values: `S3_STANDARD`, `S3_STANDARD_IA`, `S3_ONEZONE_IA`.
DefaultStorageClass pulumi.StringPtrInput
// ID of the SMB File Share.
FileshareId pulumi.StringPtrInput
// Amazon Resource Name (ARN) of the file gateway.
GatewayArn pulumi.StringPtrInput
// Boolean value that enables guessing of the MIME type for uploaded objects based on file extensions. Defaults to `true`.
GuessMimeTypeEnabled pulumi.BoolPtrInput
// A list of users in the Active Directory that are not allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
InvalidUserLists pulumi.StringArrayInput
// Boolean value if `true` to use Amazon S3 server side encryption with your own AWS KMS key, or `false` to use a key managed by Amazon S3. Defaults to `false`.
KmsEncrypted pulumi.BoolPtrInput
// Amazon Resource Name (ARN) for KMS key used for Amazon S3 server side encryption. This value can only be set when `kmsEncrypted` is true.
KmsKeyArn pulumi.StringPtrInput
// The ARN of the backed storage used for storing file data.
LocationArn pulumi.StringPtrInput
// Access Control List permission for S3 bucket objects. Defaults to `private`.
ObjectAcl pulumi.StringPtrInput
// Boolean to indicate write status of file share. File share does not accept writes if `true`. Defaults to `false`.
ReadOnly pulumi.BoolPtrInput
// Boolean who pays the cost of the request and the data download from the Amazon S3 bucket. Set this value to `true` if you want the requester to pay instead of the bucket owner. Defaults to `false`.
RequesterPays pulumi.BoolPtrInput
// The ARN of the AWS Identity and Access Management (IAM) role that a file gateway assumes when it accesses the underlying storage.
RoleArn pulumi.StringPtrInput
// Key-value mapping of resource tags
Tags pulumi.MapInput
// A list of users in the Active Directory that are allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
ValidUserLists pulumi.StringArrayInput
}
func (SmbFileShareState) ElementType() reflect.Type {
return reflect.TypeOf((*smbFileShareState)(nil)).Elem()
}
type smbFileShareArgs struct {
// The authentication method that users use to access the file share. Defaults to `ActiveDirectory`. Valid values: `ActiveDirectory`, `GuestAccess`.
Authentication *string `pulumi:"authentication"`
// The default storage class for objects put into an Amazon S3 bucket by the file gateway. Defaults to `S3_STANDARD`. Valid values: `S3_STANDARD`, `S3_STANDARD_IA`, `S3_ONEZONE_IA`.
DefaultStorageClass *string `pulumi:"defaultStorageClass"`
// Amazon Resource Name (ARN) of the file gateway.
GatewayArn string `pulumi:"gatewayArn"`
// Boolean value that enables guessing of the MIME type for uploaded objects based on file extensions. Defaults to `true`.
GuessMimeTypeEnabled *bool `pulumi:"guessMimeTypeEnabled"`
// A list of users in the Active Directory that are not allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
InvalidUserLists []string `pulumi:"invalidUserLists"`
// Boolean value if `true` to use Amazon S3 server side encryption with your own AWS KMS key, or `false` to use a key managed by Amazon S3. Defaults to `false`.
KmsEncrypted *bool `pulumi:"kmsEncrypted"`
// Amazon Resource Name (ARN) for KMS key used for Amazon S3 server side encryption. This value can only be set when `kmsEncrypted` is true.
KmsKeyArn *string `pulumi:"kmsKeyArn"`
// The ARN of the backed storage used for storing file data.
LocationArn string `pulumi:"locationArn"`
// Access Control List permission for S3 bucket objects. Defaults to `private`.
ObjectAcl *string `pulumi:"objectAcl"`
// Boolean to indicate write status of file share. File share does not accept writes if `true`. Defaults to `false`.
ReadOnly *bool `pulumi:"readOnly"`
// Boolean who pays the cost of the request and the data download from the Amazon S3 bucket. Set this value to `true` if you want the requester to pay instead of the bucket owner. Defaults to `false`.
RequesterPays *bool `pulumi:"requesterPays"`
// The ARN of the AWS Identity and Access Management (IAM) role that a file gateway assumes when it accesses the underlying storage.
RoleArn string `pulumi:"roleArn"`
// Key-value mapping of resource tags
Tags map[string]interface{} `pulumi:"tags"`
// A list of users in the Active Directory that are allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
ValidUserLists []string `pulumi:"validUserLists"`
}
// The set of arguments for constructing a SmbFileShare resource.
type SmbFileShareArgs struct {
// The authentication method that users use to access the file share. Defaults to `ActiveDirectory`. Valid values: `ActiveDirectory`, `GuestAccess`.
Authentication pulumi.StringPtrInput
// The default storage class for objects put into an Amazon S3 bucket by the file gateway. Defaults to `S3_STANDARD`. Valid values: `S3_STANDARD`, `S3_STANDARD_IA`, `S3_ONEZONE_IA`.
DefaultStorageClass pulumi.StringPtrInput
// Amazon Resource Name (ARN) of the file gateway.
GatewayArn pulumi.StringInput
// Boolean value that enables guessing of the MIME type for uploaded objects based on file extensions. Defaults to `true`.
GuessMimeTypeEnabled pulumi.BoolPtrInput
// A list of users in the Active Directory that are not allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
InvalidUserLists pulumi.StringArrayInput
// Boolean value if `true` to use Amazon S3 server side encryption with your own AWS KMS key, or `false` to use a key managed by Amazon S3. Defaults to `false`.
KmsEncrypted pulumi.BoolPtrInput
// Amazon Resource Name (ARN) for KMS key used for Amazon S3 server side encryption. This value can only be set when `kmsEncrypted` is true.
KmsKeyArn pulumi.StringPtrInput
// The ARN of the backed storage used for storing file data.
LocationArn pulumi.StringInput
// Access Control List permission for S3 bucket objects. Defaults to `private`.
ObjectAcl pulumi.StringPtrInput
// Boolean to indicate write status of file share. File share does not accept writes if `true`. Defaults to `false`.
ReadOnly pulumi.BoolPtrInput
// Boolean who pays the cost of the request and the data download from the Amazon S3 bucket. Set this value to `true` if you want the requester to pay instead of the bucket owner. Defaults to `false`.
RequesterPays pulumi.BoolPtrInput
// The ARN of the AWS Identity and Access Management (IAM) role that a file gateway assumes when it accesses the underlying storage.
RoleArn pulumi.StringInput
// Key-value mapping of resource tags
Tags pulumi.MapInput
// A list of users in the Active Directory that are allowed to access the file share. Only valid if `authentication` is set to `ActiveDirectory`.
ValidUserLists pulumi.StringArrayInput
}
func (SmbFileShareArgs) ElementType() reflect.Type {
return reflect.TypeOf((*smbFileShareArgs)(nil)).Elem()
}