/
detectorFeature.go
313 lines (263 loc) · 12.3 KB
/
detectorFeature.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package guardduty
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to manage a single Amazon GuardDuty [detector feature](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-features-activation-model.html#guardduty-features).
//
// > **NOTE:** Deleting this resource does not disable the detector feature, the resource in simply removed from state instead.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/guardduty"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := guardduty.NewDetector(ctx, "example", &guardduty.DetectorArgs{
// Enable: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// _, err = guardduty.NewDetectorFeature(ctx, "eks_runtime_monitoring", &guardduty.DetectorFeatureArgs{
// DetectorId: example.ID(),
// Name: pulumi.String("EKS_RUNTIME_MONITORING"),
// Status: pulumi.String("ENABLED"),
// AdditionalConfigurations: guardduty.DetectorFeatureAdditionalConfigurationArray{
// &guardduty.DetectorFeatureAdditionalConfigurationArgs{
// Name: pulumi.String("EKS_ADDON_MANAGEMENT"),
// Status: pulumi.String("ENABLED"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
type DetectorFeature struct {
pulumi.CustomResourceState
// Additional feature configuration block. See below.
AdditionalConfigurations DetectorFeatureAdditionalConfigurationArrayOutput `pulumi:"additionalConfigurations"`
// Amazon GuardDuty detector ID.
DetectorId pulumi.StringOutput `pulumi:"detectorId"`
// The name of the detector feature. Refer to the [AWS Documentation](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DetectorFeatureConfiguration.html) for the current list of supported values.
Name pulumi.StringOutput `pulumi:"name"`
// The status of the detector feature. Valid values: `ENABLED`, `DISABLED`.
Status pulumi.StringOutput `pulumi:"status"`
}
// NewDetectorFeature registers a new resource with the given unique name, arguments, and options.
func NewDetectorFeature(ctx *pulumi.Context,
name string, args *DetectorFeatureArgs, opts ...pulumi.ResourceOption) (*DetectorFeature, 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.Status == nil {
return nil, errors.New("invalid value for required argument 'Status'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DetectorFeature
err := ctx.RegisterResource("aws:guardduty/detectorFeature:DetectorFeature", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDetectorFeature gets an existing DetectorFeature 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 GetDetectorFeature(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DetectorFeatureState, opts ...pulumi.ResourceOption) (*DetectorFeature, error) {
var resource DetectorFeature
err := ctx.ReadResource("aws:guardduty/detectorFeature:DetectorFeature", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DetectorFeature resources.
type detectorFeatureState struct {
// Additional feature configuration block. See below.
AdditionalConfigurations []DetectorFeatureAdditionalConfiguration `pulumi:"additionalConfigurations"`
// Amazon GuardDuty detector ID.
DetectorId *string `pulumi:"detectorId"`
// The name of the detector feature. Refer to the [AWS Documentation](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DetectorFeatureConfiguration.html) for the current list of supported values.
Name *string `pulumi:"name"`
// The status of the detector feature. Valid values: `ENABLED`, `DISABLED`.
Status *string `pulumi:"status"`
}
type DetectorFeatureState struct {
// Additional feature configuration block. See below.
AdditionalConfigurations DetectorFeatureAdditionalConfigurationArrayInput
// Amazon GuardDuty detector ID.
DetectorId pulumi.StringPtrInput
// The name of the detector feature. Refer to the [AWS Documentation](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DetectorFeatureConfiguration.html) for the current list of supported values.
Name pulumi.StringPtrInput
// The status of the detector feature. Valid values: `ENABLED`, `DISABLED`.
Status pulumi.StringPtrInput
}
func (DetectorFeatureState) ElementType() reflect.Type {
return reflect.TypeOf((*detectorFeatureState)(nil)).Elem()
}
type detectorFeatureArgs struct {
// Additional feature configuration block. See below.
AdditionalConfigurations []DetectorFeatureAdditionalConfiguration `pulumi:"additionalConfigurations"`
// Amazon GuardDuty detector ID.
DetectorId string `pulumi:"detectorId"`
// The name of the detector feature. Refer to the [AWS Documentation](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DetectorFeatureConfiguration.html) for the current list of supported values.
Name *string `pulumi:"name"`
// The status of the detector feature. Valid values: `ENABLED`, `DISABLED`.
Status string `pulumi:"status"`
}
// The set of arguments for constructing a DetectorFeature resource.
type DetectorFeatureArgs struct {
// Additional feature configuration block. See below.
AdditionalConfigurations DetectorFeatureAdditionalConfigurationArrayInput
// Amazon GuardDuty detector ID.
DetectorId pulumi.StringInput
// The name of the detector feature. Refer to the [AWS Documentation](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DetectorFeatureConfiguration.html) for the current list of supported values.
Name pulumi.StringPtrInput
// The status of the detector feature. Valid values: `ENABLED`, `DISABLED`.
Status pulumi.StringInput
}
func (DetectorFeatureArgs) ElementType() reflect.Type {
return reflect.TypeOf((*detectorFeatureArgs)(nil)).Elem()
}
type DetectorFeatureInput interface {
pulumi.Input
ToDetectorFeatureOutput() DetectorFeatureOutput
ToDetectorFeatureOutputWithContext(ctx context.Context) DetectorFeatureOutput
}
func (*DetectorFeature) ElementType() reflect.Type {
return reflect.TypeOf((**DetectorFeature)(nil)).Elem()
}
func (i *DetectorFeature) ToDetectorFeatureOutput() DetectorFeatureOutput {
return i.ToDetectorFeatureOutputWithContext(context.Background())
}
func (i *DetectorFeature) ToDetectorFeatureOutputWithContext(ctx context.Context) DetectorFeatureOutput {
return pulumi.ToOutputWithContext(ctx, i).(DetectorFeatureOutput)
}
// DetectorFeatureArrayInput is an input type that accepts DetectorFeatureArray and DetectorFeatureArrayOutput values.
// You can construct a concrete instance of `DetectorFeatureArrayInput` via:
//
// DetectorFeatureArray{ DetectorFeatureArgs{...} }
type DetectorFeatureArrayInput interface {
pulumi.Input
ToDetectorFeatureArrayOutput() DetectorFeatureArrayOutput
ToDetectorFeatureArrayOutputWithContext(context.Context) DetectorFeatureArrayOutput
}
type DetectorFeatureArray []DetectorFeatureInput
func (DetectorFeatureArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DetectorFeature)(nil)).Elem()
}
func (i DetectorFeatureArray) ToDetectorFeatureArrayOutput() DetectorFeatureArrayOutput {
return i.ToDetectorFeatureArrayOutputWithContext(context.Background())
}
func (i DetectorFeatureArray) ToDetectorFeatureArrayOutputWithContext(ctx context.Context) DetectorFeatureArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DetectorFeatureArrayOutput)
}
// DetectorFeatureMapInput is an input type that accepts DetectorFeatureMap and DetectorFeatureMapOutput values.
// You can construct a concrete instance of `DetectorFeatureMapInput` via:
//
// DetectorFeatureMap{ "key": DetectorFeatureArgs{...} }
type DetectorFeatureMapInput interface {
pulumi.Input
ToDetectorFeatureMapOutput() DetectorFeatureMapOutput
ToDetectorFeatureMapOutputWithContext(context.Context) DetectorFeatureMapOutput
}
type DetectorFeatureMap map[string]DetectorFeatureInput
func (DetectorFeatureMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DetectorFeature)(nil)).Elem()
}
func (i DetectorFeatureMap) ToDetectorFeatureMapOutput() DetectorFeatureMapOutput {
return i.ToDetectorFeatureMapOutputWithContext(context.Background())
}
func (i DetectorFeatureMap) ToDetectorFeatureMapOutputWithContext(ctx context.Context) DetectorFeatureMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DetectorFeatureMapOutput)
}
type DetectorFeatureOutput struct{ *pulumi.OutputState }
func (DetectorFeatureOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DetectorFeature)(nil)).Elem()
}
func (o DetectorFeatureOutput) ToDetectorFeatureOutput() DetectorFeatureOutput {
return o
}
func (o DetectorFeatureOutput) ToDetectorFeatureOutputWithContext(ctx context.Context) DetectorFeatureOutput {
return o
}
// Additional feature configuration block. See below.
func (o DetectorFeatureOutput) AdditionalConfigurations() DetectorFeatureAdditionalConfigurationArrayOutput {
return o.ApplyT(func(v *DetectorFeature) DetectorFeatureAdditionalConfigurationArrayOutput {
return v.AdditionalConfigurations
}).(DetectorFeatureAdditionalConfigurationArrayOutput)
}
// Amazon GuardDuty detector ID.
func (o DetectorFeatureOutput) DetectorId() pulumi.StringOutput {
return o.ApplyT(func(v *DetectorFeature) pulumi.StringOutput { return v.DetectorId }).(pulumi.StringOutput)
}
// The name of the detector feature. Refer to the [AWS Documentation](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DetectorFeatureConfiguration.html) for the current list of supported values.
func (o DetectorFeatureOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DetectorFeature) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The status of the detector feature. Valid values: `ENABLED`, `DISABLED`.
func (o DetectorFeatureOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *DetectorFeature) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
type DetectorFeatureArrayOutput struct{ *pulumi.OutputState }
func (DetectorFeatureArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DetectorFeature)(nil)).Elem()
}
func (o DetectorFeatureArrayOutput) ToDetectorFeatureArrayOutput() DetectorFeatureArrayOutput {
return o
}
func (o DetectorFeatureArrayOutput) ToDetectorFeatureArrayOutputWithContext(ctx context.Context) DetectorFeatureArrayOutput {
return o
}
func (o DetectorFeatureArrayOutput) Index(i pulumi.IntInput) DetectorFeatureOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DetectorFeature {
return vs[0].([]*DetectorFeature)[vs[1].(int)]
}).(DetectorFeatureOutput)
}
type DetectorFeatureMapOutput struct{ *pulumi.OutputState }
func (DetectorFeatureMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DetectorFeature)(nil)).Elem()
}
func (o DetectorFeatureMapOutput) ToDetectorFeatureMapOutput() DetectorFeatureMapOutput {
return o
}
func (o DetectorFeatureMapOutput) ToDetectorFeatureMapOutputWithContext(ctx context.Context) DetectorFeatureMapOutput {
return o
}
func (o DetectorFeatureMapOutput) MapIndex(k pulumi.StringInput) DetectorFeatureOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DetectorFeature {
return vs[0].(map[string]*DetectorFeature)[vs[1].(string)]
}).(DetectorFeatureOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DetectorFeatureInput)(nil)).Elem(), &DetectorFeature{})
pulumi.RegisterInputType(reflect.TypeOf((*DetectorFeatureArrayInput)(nil)).Elem(), DetectorFeatureArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DetectorFeatureMapInput)(nil)).Elem(), DetectorFeatureMap{})
pulumi.RegisterOutputType(DetectorFeatureOutput{})
pulumi.RegisterOutputType(DetectorFeatureArrayOutput{})
pulumi.RegisterOutputType(DetectorFeatureMapOutput{})
}