/
detector.go
229 lines (193 loc) · 8.27 KB
/
detector.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
// 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 frauddetector
import (
"context"
"reflect"
"errors"
"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"
)
// A resource schema for a Detector in Amazon Fraud Detector.
type Detector struct {
pulumi.CustomResourceState
// The ARN of the detector.
Arn pulumi.StringOutput `pulumi:"arn"`
// The models to associate with this detector.
AssociatedModels DetectorModelArrayOutput `pulumi:"associatedModels"`
// The time when the detector was created.
CreatedTime pulumi.StringOutput `pulumi:"createdTime"`
// The description of the detector.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The ID of the detector
DetectorId pulumi.StringOutput `pulumi:"detectorId"`
// The active version ID of the detector
DetectorVersionId pulumi.StringOutput `pulumi:"detectorVersionId"`
// The desired detector version status for the detector
DetectorVersionStatus DetectorVersionStatusPtrOutput `pulumi:"detectorVersionStatus"`
// The event type to associate this detector with.
EventType DetectorEventTypeOutput `pulumi:"eventType"`
// The time when the detector was last updated.
LastUpdatedTime pulumi.StringOutput `pulumi:"lastUpdatedTime"`
RuleExecutionMode DetectorRuleExecutionModePtrOutput `pulumi:"ruleExecutionMode"`
Rules DetectorRuleArrayOutput `pulumi:"rules"`
// Tags associated with this detector.
Tags aws.TagArrayOutput `pulumi:"tags"`
}
// NewDetector registers a new resource with the given unique name, arguments, and options.
func NewDetector(ctx *pulumi.Context,
name string, args *DetectorArgs, opts ...pulumi.ResourceOption) (*Detector, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DetectorId == nil {
return nil, errors.New("invalid value for required argument 'DetectorId'")
}
if args.EventType == nil {
return nil, errors.New("invalid value for required argument 'EventType'")
}
if args.Rules == nil {
return nil, errors.New("invalid value for required argument 'Rules'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"detectorId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Detector
err := ctx.RegisterResource("aws-native:frauddetector:Detector", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDetector gets an existing Detector 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 GetDetector(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DetectorState, opts ...pulumi.ResourceOption) (*Detector, error) {
var resource Detector
err := ctx.ReadResource("aws-native:frauddetector:Detector", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Detector resources.
type detectorState struct {
}
type DetectorState struct {
}
func (DetectorState) ElementType() reflect.Type {
return reflect.TypeOf((*detectorState)(nil)).Elem()
}
type detectorArgs struct {
// The models to associate with this detector.
AssociatedModels []DetectorModel `pulumi:"associatedModels"`
// The description of the detector.
Description *string `pulumi:"description"`
// The ID of the detector
DetectorId string `pulumi:"detectorId"`
// The desired detector version status for the detector
DetectorVersionStatus *DetectorVersionStatus `pulumi:"detectorVersionStatus"`
// The event type to associate this detector with.
EventType DetectorEventType `pulumi:"eventType"`
RuleExecutionMode *DetectorRuleExecutionMode `pulumi:"ruleExecutionMode"`
Rules []DetectorRule `pulumi:"rules"`
// Tags associated with this detector.
Tags []aws.Tag `pulumi:"tags"`
}
// The set of arguments for constructing a Detector resource.
type DetectorArgs struct {
// The models to associate with this detector.
AssociatedModels DetectorModelArrayInput
// The description of the detector.
Description pulumi.StringPtrInput
// The ID of the detector
DetectorId pulumi.StringInput
// The desired detector version status for the detector
DetectorVersionStatus DetectorVersionStatusPtrInput
// The event type to associate this detector with.
EventType DetectorEventTypeInput
RuleExecutionMode DetectorRuleExecutionModePtrInput
Rules DetectorRuleArrayInput
// Tags associated with this detector.
Tags aws.TagArrayInput
}
func (DetectorArgs) ElementType() reflect.Type {
return reflect.TypeOf((*detectorArgs)(nil)).Elem()
}
type DetectorInput interface {
pulumi.Input
ToDetectorOutput() DetectorOutput
ToDetectorOutputWithContext(ctx context.Context) DetectorOutput
}
func (*Detector) ElementType() reflect.Type {
return reflect.TypeOf((**Detector)(nil)).Elem()
}
func (i *Detector) ToDetectorOutput() DetectorOutput {
return i.ToDetectorOutputWithContext(context.Background())
}
func (i *Detector) ToDetectorOutputWithContext(ctx context.Context) DetectorOutput {
return pulumi.ToOutputWithContext(ctx, i).(DetectorOutput)
}
type DetectorOutput struct{ *pulumi.OutputState }
func (DetectorOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Detector)(nil)).Elem()
}
func (o DetectorOutput) ToDetectorOutput() DetectorOutput {
return o
}
func (o DetectorOutput) ToDetectorOutputWithContext(ctx context.Context) DetectorOutput {
return o
}
// The ARN of the detector.
func (o DetectorOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *Detector) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// The models to associate with this detector.
func (o DetectorOutput) AssociatedModels() DetectorModelArrayOutput {
return o.ApplyT(func(v *Detector) DetectorModelArrayOutput { return v.AssociatedModels }).(DetectorModelArrayOutput)
}
// The time when the detector was created.
func (o DetectorOutput) CreatedTime() pulumi.StringOutput {
return o.ApplyT(func(v *Detector) pulumi.StringOutput { return v.CreatedTime }).(pulumi.StringOutput)
}
// The description of the detector.
func (o DetectorOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The ID of the detector
func (o DetectorOutput) DetectorId() pulumi.StringOutput {
return o.ApplyT(func(v *Detector) pulumi.StringOutput { return v.DetectorId }).(pulumi.StringOutput)
}
// The active version ID of the detector
func (o DetectorOutput) DetectorVersionId() pulumi.StringOutput {
return o.ApplyT(func(v *Detector) pulumi.StringOutput { return v.DetectorVersionId }).(pulumi.StringOutput)
}
// The desired detector version status for the detector
func (o DetectorOutput) DetectorVersionStatus() DetectorVersionStatusPtrOutput {
return o.ApplyT(func(v *Detector) DetectorVersionStatusPtrOutput { return v.DetectorVersionStatus }).(DetectorVersionStatusPtrOutput)
}
// The event type to associate this detector with.
func (o DetectorOutput) EventType() DetectorEventTypeOutput {
return o.ApplyT(func(v *Detector) DetectorEventTypeOutput { return v.EventType }).(DetectorEventTypeOutput)
}
// The time when the detector was last updated.
func (o DetectorOutput) LastUpdatedTime() pulumi.StringOutput {
return o.ApplyT(func(v *Detector) pulumi.StringOutput { return v.LastUpdatedTime }).(pulumi.StringOutput)
}
func (o DetectorOutput) RuleExecutionMode() DetectorRuleExecutionModePtrOutput {
return o.ApplyT(func(v *Detector) DetectorRuleExecutionModePtrOutput { return v.RuleExecutionMode }).(DetectorRuleExecutionModePtrOutput)
}
func (o DetectorOutput) Rules() DetectorRuleArrayOutput {
return o.ApplyT(func(v *Detector) DetectorRuleArrayOutput { return v.Rules }).(DetectorRuleArrayOutput)
}
// Tags associated with this detector.
func (o DetectorOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v *Detector) aws.TagArrayOutput { return v.Tags }).(aws.TagArrayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DetectorInput)(nil)).Elem(), &Detector{})
pulumi.RegisterOutputType(DetectorOutput{})
}