/
nfsLocation.go
312 lines (266 loc) · 12.5 KB
/
nfsLocation.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
// *** 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 datasync
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an NFS Location within AWS DataSync.
//
// > **NOTE:** The DataSync Agents must be available before creating this resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/datasync"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := datasync.NewNfsLocation(ctx, "example", &datasync.NfsLocationArgs{
// ServerHostname: pulumi.String("nfs.example.com"),
// Subdirectory: pulumi.String("/exported/path"),
// OnPremConfig: &datasync.NfsLocationOnPremConfigArgs{
// AgentArns: pulumi.StringArray{
// pulumi.Any(aws_datasync_agent.Example.Arn),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// `aws_datasync_location_nfs` can be imported by using the DataSync Task Amazon Resource Name (ARN), e.g.,
//
// ```sh
// $ pulumi import aws:datasync/nfsLocation:NfsLocation example arn:aws:datasync:us-east-1:123456789012:location/loc-12345678901234567
// ```
type NfsLocation struct {
pulumi.CustomResourceState
// Amazon Resource Name (ARN) of the DataSync Location.
Arn pulumi.StringOutput `pulumi:"arn"`
// Configuration block containing mount options used by DataSync to access the NFS Server.
MountOptions NfsLocationMountOptionsPtrOutput `pulumi:"mountOptions"`
// Configuration block containing information for connecting to the NFS File System.
OnPremConfig NfsLocationOnPremConfigOutput `pulumi:"onPremConfig"`
// Specifies the IP address or DNS name of the NFS server. The DataSync Agent(s) use this to mount the NFS server.
ServerHostname pulumi.StringOutput `pulumi:"serverHostname"`
// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
Subdirectory pulumi.StringOutput `pulumi:"subdirectory"`
// Key-value pairs of resource tags to assign to the DataSync Location. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
Uri pulumi.StringOutput `pulumi:"uri"`
}
// NewNfsLocation registers a new resource with the given unique name, arguments, and options.
func NewNfsLocation(ctx *pulumi.Context,
name string, args *NfsLocationArgs, opts ...pulumi.ResourceOption) (*NfsLocation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.OnPremConfig == nil {
return nil, errors.New("invalid value for required argument 'OnPremConfig'")
}
if args.ServerHostname == nil {
return nil, errors.New("invalid value for required argument 'ServerHostname'")
}
if args.Subdirectory == nil {
return nil, errors.New("invalid value for required argument 'Subdirectory'")
}
var resource NfsLocation
err := ctx.RegisterResource("aws:datasync/nfsLocation:NfsLocation", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetNfsLocation gets an existing NfsLocation 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 GetNfsLocation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NfsLocationState, opts ...pulumi.ResourceOption) (*NfsLocation, error) {
var resource NfsLocation
err := ctx.ReadResource("aws:datasync/nfsLocation:NfsLocation", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering NfsLocation resources.
type nfsLocationState struct {
// Amazon Resource Name (ARN) of the DataSync Location.
Arn *string `pulumi:"arn"`
// Configuration block containing mount options used by DataSync to access the NFS Server.
MountOptions *NfsLocationMountOptions `pulumi:"mountOptions"`
// Configuration block containing information for connecting to the NFS File System.
OnPremConfig *NfsLocationOnPremConfig `pulumi:"onPremConfig"`
// Specifies the IP address or DNS name of the NFS server. The DataSync Agent(s) use this to mount the NFS server.
ServerHostname *string `pulumi:"serverHostname"`
// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
Subdirectory *string `pulumi:"subdirectory"`
// Key-value pairs of resource tags to assign to the DataSync Location. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll map[string]string `pulumi:"tagsAll"`
Uri *string `pulumi:"uri"`
}
type NfsLocationState struct {
// Amazon Resource Name (ARN) of the DataSync Location.
Arn pulumi.StringPtrInput
// Configuration block containing mount options used by DataSync to access the NFS Server.
MountOptions NfsLocationMountOptionsPtrInput
// Configuration block containing information for connecting to the NFS File System.
OnPremConfig NfsLocationOnPremConfigPtrInput
// Specifies the IP address or DNS name of the NFS server. The DataSync Agent(s) use this to mount the NFS server.
ServerHostname pulumi.StringPtrInput
// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
Subdirectory pulumi.StringPtrInput
// Key-value pairs of resource tags to assign to the DataSync Location. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapInput
Uri pulumi.StringPtrInput
}
func (NfsLocationState) ElementType() reflect.Type {
return reflect.TypeOf((*nfsLocationState)(nil)).Elem()
}
type nfsLocationArgs struct {
// Configuration block containing mount options used by DataSync to access the NFS Server.
MountOptions *NfsLocationMountOptions `pulumi:"mountOptions"`
// Configuration block containing information for connecting to the NFS File System.
OnPremConfig NfsLocationOnPremConfig `pulumi:"onPremConfig"`
// Specifies the IP address or DNS name of the NFS server. The DataSync Agent(s) use this to mount the NFS server.
ServerHostname string `pulumi:"serverHostname"`
// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
Subdirectory string `pulumi:"subdirectory"`
// Key-value pairs of resource tags to assign to the DataSync Location. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a NfsLocation resource.
type NfsLocationArgs struct {
// Configuration block containing mount options used by DataSync to access the NFS Server.
MountOptions NfsLocationMountOptionsPtrInput
// Configuration block containing information for connecting to the NFS File System.
OnPremConfig NfsLocationOnPremConfigInput
// Specifies the IP address or DNS name of the NFS server. The DataSync Agent(s) use this to mount the NFS server.
ServerHostname pulumi.StringInput
// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
Subdirectory pulumi.StringInput
// Key-value pairs of resource tags to assign to the DataSync Location. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (NfsLocationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*nfsLocationArgs)(nil)).Elem()
}
type NfsLocationInput interface {
pulumi.Input
ToNfsLocationOutput() NfsLocationOutput
ToNfsLocationOutputWithContext(ctx context.Context) NfsLocationOutput
}
func (*NfsLocation) ElementType() reflect.Type {
return reflect.TypeOf((**NfsLocation)(nil)).Elem()
}
func (i *NfsLocation) ToNfsLocationOutput() NfsLocationOutput {
return i.ToNfsLocationOutputWithContext(context.Background())
}
func (i *NfsLocation) ToNfsLocationOutputWithContext(ctx context.Context) NfsLocationOutput {
return pulumi.ToOutputWithContext(ctx, i).(NfsLocationOutput)
}
// NfsLocationArrayInput is an input type that accepts NfsLocationArray and NfsLocationArrayOutput values.
// You can construct a concrete instance of `NfsLocationArrayInput` via:
//
// NfsLocationArray{ NfsLocationArgs{...} }
type NfsLocationArrayInput interface {
pulumi.Input
ToNfsLocationArrayOutput() NfsLocationArrayOutput
ToNfsLocationArrayOutputWithContext(context.Context) NfsLocationArrayOutput
}
type NfsLocationArray []NfsLocationInput
func (NfsLocationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NfsLocation)(nil)).Elem()
}
func (i NfsLocationArray) ToNfsLocationArrayOutput() NfsLocationArrayOutput {
return i.ToNfsLocationArrayOutputWithContext(context.Background())
}
func (i NfsLocationArray) ToNfsLocationArrayOutputWithContext(ctx context.Context) NfsLocationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(NfsLocationArrayOutput)
}
// NfsLocationMapInput is an input type that accepts NfsLocationMap and NfsLocationMapOutput values.
// You can construct a concrete instance of `NfsLocationMapInput` via:
//
// NfsLocationMap{ "key": NfsLocationArgs{...} }
type NfsLocationMapInput interface {
pulumi.Input
ToNfsLocationMapOutput() NfsLocationMapOutput
ToNfsLocationMapOutputWithContext(context.Context) NfsLocationMapOutput
}
type NfsLocationMap map[string]NfsLocationInput
func (NfsLocationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NfsLocation)(nil)).Elem()
}
func (i NfsLocationMap) ToNfsLocationMapOutput() NfsLocationMapOutput {
return i.ToNfsLocationMapOutputWithContext(context.Background())
}
func (i NfsLocationMap) ToNfsLocationMapOutputWithContext(ctx context.Context) NfsLocationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(NfsLocationMapOutput)
}
type NfsLocationOutput struct{ *pulumi.OutputState }
func (NfsLocationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**NfsLocation)(nil)).Elem()
}
func (o NfsLocationOutput) ToNfsLocationOutput() NfsLocationOutput {
return o
}
func (o NfsLocationOutput) ToNfsLocationOutputWithContext(ctx context.Context) NfsLocationOutput {
return o
}
type NfsLocationArrayOutput struct{ *pulumi.OutputState }
func (NfsLocationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NfsLocation)(nil)).Elem()
}
func (o NfsLocationArrayOutput) ToNfsLocationArrayOutput() NfsLocationArrayOutput {
return o
}
func (o NfsLocationArrayOutput) ToNfsLocationArrayOutputWithContext(ctx context.Context) NfsLocationArrayOutput {
return o
}
func (o NfsLocationArrayOutput) Index(i pulumi.IntInput) NfsLocationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NfsLocation {
return vs[0].([]*NfsLocation)[vs[1].(int)]
}).(NfsLocationOutput)
}
type NfsLocationMapOutput struct{ *pulumi.OutputState }
func (NfsLocationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NfsLocation)(nil)).Elem()
}
func (o NfsLocationMapOutput) ToNfsLocationMapOutput() NfsLocationMapOutput {
return o
}
func (o NfsLocationMapOutput) ToNfsLocationMapOutputWithContext(ctx context.Context) NfsLocationMapOutput {
return o
}
func (o NfsLocationMapOutput) MapIndex(k pulumi.StringInput) NfsLocationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NfsLocation {
return vs[0].(map[string]*NfsLocation)[vs[1].(string)]
}).(NfsLocationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*NfsLocationInput)(nil)).Elem(), &NfsLocation{})
pulumi.RegisterInputType(reflect.TypeOf((*NfsLocationArrayInput)(nil)).Elem(), NfsLocationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*NfsLocationMapInput)(nil)).Elem(), NfsLocationMap{})
pulumi.RegisterOutputType(NfsLocationOutput{})
pulumi.RegisterOutputType(NfsLocationArrayOutput{})
pulumi.RegisterOutputType(NfsLocationMapOutput{})
}