/
task.go
137 lines (124 loc) · 6.58 KB
/
task.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
// *** 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 (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an AWS DataSync Task, which represents a configuration for synchronization. Starting an execution of these DataSync Tasks (actually synchronizing files) is performed outside of this resource.
type Task struct {
pulumi.CustomResourceState
// Amazon Resource Name (ARN) of the DataSync Task.
Arn pulumi.StringOutput `pulumi:"arn"`
// Amazon Resource Name (ARN) of the CloudWatch Log Group that is used to monitor and log events in the sync task.
CloudwatchLogGroupArn pulumi.StringPtrOutput `pulumi:"cloudwatchLogGroupArn"`
// Amazon Resource Name (ARN) of destination DataSync Location.
DestinationLocationArn pulumi.StringOutput `pulumi:"destinationLocationArn"`
// Name of the DataSync Task.
Name pulumi.StringOutput `pulumi:"name"`
// Configuration block containing option that controls the default behavior when you start an execution of this DataSync Task. For each individual task execution, you can override these options by specifying an overriding configuration in those executions.
Options TaskOptionsPtrOutput `pulumi:"options"`
// Amazon Resource Name (ARN) of source DataSync Location.
SourceLocationArn pulumi.StringOutput `pulumi:"sourceLocationArn"`
// Key-value pairs of resource tags to assign to the DataSync Task.
Tags pulumi.MapOutput `pulumi:"tags"`
}
// NewTask registers a new resource with the given unique name, arguments, and options.
func NewTask(ctx *pulumi.Context,
name string, args *TaskArgs, opts ...pulumi.ResourceOption) (*Task, error) {
if args == nil || args.DestinationLocationArn == nil {
return nil, errors.New("missing required argument 'DestinationLocationArn'")
}
if args == nil || args.SourceLocationArn == nil {
return nil, errors.New("missing required argument 'SourceLocationArn'")
}
if args == nil {
args = &TaskArgs{}
}
var resource Task
err := ctx.RegisterResource("aws:datasync/task:Task", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTask gets an existing Task 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 GetTask(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TaskState, opts ...pulumi.ResourceOption) (*Task, error) {
var resource Task
err := ctx.ReadResource("aws:datasync/task:Task", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Task resources.
type taskState struct {
// Amazon Resource Name (ARN) of the DataSync Task.
Arn *string `pulumi:"arn"`
// Amazon Resource Name (ARN) of the CloudWatch Log Group that is used to monitor and log events in the sync task.
CloudwatchLogGroupArn *string `pulumi:"cloudwatchLogGroupArn"`
// Amazon Resource Name (ARN) of destination DataSync Location.
DestinationLocationArn *string `pulumi:"destinationLocationArn"`
// Name of the DataSync Task.
Name *string `pulumi:"name"`
// Configuration block containing option that controls the default behavior when you start an execution of this DataSync Task. For each individual task execution, you can override these options by specifying an overriding configuration in those executions.
Options *TaskOptions `pulumi:"options"`
// Amazon Resource Name (ARN) of source DataSync Location.
SourceLocationArn *string `pulumi:"sourceLocationArn"`
// Key-value pairs of resource tags to assign to the DataSync Task.
Tags map[string]interface{} `pulumi:"tags"`
}
type TaskState struct {
// Amazon Resource Name (ARN) of the DataSync Task.
Arn pulumi.StringPtrInput
// Amazon Resource Name (ARN) of the CloudWatch Log Group that is used to monitor and log events in the sync task.
CloudwatchLogGroupArn pulumi.StringPtrInput
// Amazon Resource Name (ARN) of destination DataSync Location.
DestinationLocationArn pulumi.StringPtrInput
// Name of the DataSync Task.
Name pulumi.StringPtrInput
// Configuration block containing option that controls the default behavior when you start an execution of this DataSync Task. For each individual task execution, you can override these options by specifying an overriding configuration in those executions.
Options TaskOptionsPtrInput
// Amazon Resource Name (ARN) of source DataSync Location.
SourceLocationArn pulumi.StringPtrInput
// Key-value pairs of resource tags to assign to the DataSync Task.
Tags pulumi.MapInput
}
func (TaskState) ElementType() reflect.Type {
return reflect.TypeOf((*taskState)(nil)).Elem()
}
type taskArgs struct {
// Amazon Resource Name (ARN) of the CloudWatch Log Group that is used to monitor and log events in the sync task.
CloudwatchLogGroupArn *string `pulumi:"cloudwatchLogGroupArn"`
// Amazon Resource Name (ARN) of destination DataSync Location.
DestinationLocationArn string `pulumi:"destinationLocationArn"`
// Name of the DataSync Task.
Name *string `pulumi:"name"`
// Configuration block containing option that controls the default behavior when you start an execution of this DataSync Task. For each individual task execution, you can override these options by specifying an overriding configuration in those executions.
Options *TaskOptions `pulumi:"options"`
// Amazon Resource Name (ARN) of source DataSync Location.
SourceLocationArn string `pulumi:"sourceLocationArn"`
// Key-value pairs of resource tags to assign to the DataSync Task.
Tags map[string]interface{} `pulumi:"tags"`
}
// The set of arguments for constructing a Task resource.
type TaskArgs struct {
// Amazon Resource Name (ARN) of the CloudWatch Log Group that is used to monitor and log events in the sync task.
CloudwatchLogGroupArn pulumi.StringPtrInput
// Amazon Resource Name (ARN) of destination DataSync Location.
DestinationLocationArn pulumi.StringInput
// Name of the DataSync Task.
Name pulumi.StringPtrInput
// Configuration block containing option that controls the default behavior when you start an execution of this DataSync Task. For each individual task execution, you can override these options by specifying an overriding configuration in those executions.
Options TaskOptionsPtrInput
// Amazon Resource Name (ARN) of source DataSync Location.
SourceLocationArn pulumi.StringInput
// Key-value pairs of resource tags to assign to the DataSync Task.
Tags pulumi.MapInput
}
func (TaskArgs) ElementType() reflect.Type {
return reflect.TypeOf((*taskArgs)(nil)).Elem()
}