-
Notifications
You must be signed in to change notification settings - Fork 151
/
patchGroup.go
318 lines (257 loc) · 9.64 KB
/
patchGroup.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
314
315
316
317
318
// *** 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 ssm
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an SSM Patch Group resource
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ssm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// production, err := ssm.NewPatchBaseline(ctx, "production", &ssm.PatchBaselineArgs{
// ApprovedPatches: pulumi.StringArray{
// pulumi.String("KB123456"),
// },
// })
// if err != nil {
// return err
// }
// _, err = ssm.NewPatchGroup(ctx, "patchgroup", &ssm.PatchGroupArgs{
// BaselineId: production.ID(),
// PatchGroup: pulumi.String("patch-group-name"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type PatchGroup struct {
pulumi.CustomResourceState
// The ID of the patch baseline to register the patch group with.
BaselineId pulumi.StringOutput `pulumi:"baselineId"`
// The name of the patch group that should be registered with the patch baseline.
PatchGroup pulumi.StringOutput `pulumi:"patchGroup"`
}
// NewPatchGroup registers a new resource with the given unique name, arguments, and options.
func NewPatchGroup(ctx *pulumi.Context,
name string, args *PatchGroupArgs, opts ...pulumi.ResourceOption) (*PatchGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.BaselineId == nil {
return nil, errors.New("invalid value for required argument 'BaselineId'")
}
if args.PatchGroup == nil {
return nil, errors.New("invalid value for required argument 'PatchGroup'")
}
var resource PatchGroup
err := ctx.RegisterResource("aws:ssm/patchGroup:PatchGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPatchGroup gets an existing PatchGroup 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 GetPatchGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PatchGroupState, opts ...pulumi.ResourceOption) (*PatchGroup, error) {
var resource PatchGroup
err := ctx.ReadResource("aws:ssm/patchGroup:PatchGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PatchGroup resources.
type patchGroupState struct {
// The ID of the patch baseline to register the patch group with.
BaselineId *string `pulumi:"baselineId"`
// The name of the patch group that should be registered with the patch baseline.
PatchGroup *string `pulumi:"patchGroup"`
}
type PatchGroupState struct {
// The ID of the patch baseline to register the patch group with.
BaselineId pulumi.StringPtrInput
// The name of the patch group that should be registered with the patch baseline.
PatchGroup pulumi.StringPtrInput
}
func (PatchGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*patchGroupState)(nil)).Elem()
}
type patchGroupArgs struct {
// The ID of the patch baseline to register the patch group with.
BaselineId string `pulumi:"baselineId"`
// The name of the patch group that should be registered with the patch baseline.
PatchGroup string `pulumi:"patchGroup"`
}
// The set of arguments for constructing a PatchGroup resource.
type PatchGroupArgs struct {
// The ID of the patch baseline to register the patch group with.
BaselineId pulumi.StringInput
// The name of the patch group that should be registered with the patch baseline.
PatchGroup pulumi.StringInput
}
func (PatchGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*patchGroupArgs)(nil)).Elem()
}
type PatchGroupInput interface {
pulumi.Input
ToPatchGroupOutput() PatchGroupOutput
ToPatchGroupOutputWithContext(ctx context.Context) PatchGroupOutput
}
func (*PatchGroup) ElementType() reflect.Type {
return reflect.TypeOf((*PatchGroup)(nil))
}
func (i *PatchGroup) ToPatchGroupOutput() PatchGroupOutput {
return i.ToPatchGroupOutputWithContext(context.Background())
}
func (i *PatchGroup) ToPatchGroupOutputWithContext(ctx context.Context) PatchGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(PatchGroupOutput)
}
func (i *PatchGroup) ToPatchGroupPtrOutput() PatchGroupPtrOutput {
return i.ToPatchGroupPtrOutputWithContext(context.Background())
}
func (i *PatchGroup) ToPatchGroupPtrOutputWithContext(ctx context.Context) PatchGroupPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(PatchGroupPtrOutput)
}
type PatchGroupPtrInput interface {
pulumi.Input
ToPatchGroupPtrOutput() PatchGroupPtrOutput
ToPatchGroupPtrOutputWithContext(ctx context.Context) PatchGroupPtrOutput
}
type patchGroupPtrType PatchGroupArgs
func (*patchGroupPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**PatchGroup)(nil))
}
func (i *patchGroupPtrType) ToPatchGroupPtrOutput() PatchGroupPtrOutput {
return i.ToPatchGroupPtrOutputWithContext(context.Background())
}
func (i *patchGroupPtrType) ToPatchGroupPtrOutputWithContext(ctx context.Context) PatchGroupPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(PatchGroupPtrOutput)
}
// PatchGroupArrayInput is an input type that accepts PatchGroupArray and PatchGroupArrayOutput values.
// You can construct a concrete instance of `PatchGroupArrayInput` via:
//
// PatchGroupArray{ PatchGroupArgs{...} }
type PatchGroupArrayInput interface {
pulumi.Input
ToPatchGroupArrayOutput() PatchGroupArrayOutput
ToPatchGroupArrayOutputWithContext(context.Context) PatchGroupArrayOutput
}
type PatchGroupArray []PatchGroupInput
func (PatchGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PatchGroup)(nil)).Elem()
}
func (i PatchGroupArray) ToPatchGroupArrayOutput() PatchGroupArrayOutput {
return i.ToPatchGroupArrayOutputWithContext(context.Background())
}
func (i PatchGroupArray) ToPatchGroupArrayOutputWithContext(ctx context.Context) PatchGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PatchGroupArrayOutput)
}
// PatchGroupMapInput is an input type that accepts PatchGroupMap and PatchGroupMapOutput values.
// You can construct a concrete instance of `PatchGroupMapInput` via:
//
// PatchGroupMap{ "key": PatchGroupArgs{...} }
type PatchGroupMapInput interface {
pulumi.Input
ToPatchGroupMapOutput() PatchGroupMapOutput
ToPatchGroupMapOutputWithContext(context.Context) PatchGroupMapOutput
}
type PatchGroupMap map[string]PatchGroupInput
func (PatchGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PatchGroup)(nil)).Elem()
}
func (i PatchGroupMap) ToPatchGroupMapOutput() PatchGroupMapOutput {
return i.ToPatchGroupMapOutputWithContext(context.Background())
}
func (i PatchGroupMap) ToPatchGroupMapOutputWithContext(ctx context.Context) PatchGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PatchGroupMapOutput)
}
type PatchGroupOutput struct{ *pulumi.OutputState }
func (PatchGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((*PatchGroup)(nil))
}
func (o PatchGroupOutput) ToPatchGroupOutput() PatchGroupOutput {
return o
}
func (o PatchGroupOutput) ToPatchGroupOutputWithContext(ctx context.Context) PatchGroupOutput {
return o
}
func (o PatchGroupOutput) ToPatchGroupPtrOutput() PatchGroupPtrOutput {
return o.ToPatchGroupPtrOutputWithContext(context.Background())
}
func (o PatchGroupOutput) ToPatchGroupPtrOutputWithContext(ctx context.Context) PatchGroupPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v PatchGroup) *PatchGroup {
return &v
}).(PatchGroupPtrOutput)
}
type PatchGroupPtrOutput struct{ *pulumi.OutputState }
func (PatchGroupPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PatchGroup)(nil))
}
func (o PatchGroupPtrOutput) ToPatchGroupPtrOutput() PatchGroupPtrOutput {
return o
}
func (o PatchGroupPtrOutput) ToPatchGroupPtrOutputWithContext(ctx context.Context) PatchGroupPtrOutput {
return o
}
func (o PatchGroupPtrOutput) Elem() PatchGroupOutput {
return o.ApplyT(func(v *PatchGroup) PatchGroup {
if v != nil {
return *v
}
var ret PatchGroup
return ret
}).(PatchGroupOutput)
}
type PatchGroupArrayOutput struct{ *pulumi.OutputState }
func (PatchGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]PatchGroup)(nil))
}
func (o PatchGroupArrayOutput) ToPatchGroupArrayOutput() PatchGroupArrayOutput {
return o
}
func (o PatchGroupArrayOutput) ToPatchGroupArrayOutputWithContext(ctx context.Context) PatchGroupArrayOutput {
return o
}
func (o PatchGroupArrayOutput) Index(i pulumi.IntInput) PatchGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) PatchGroup {
return vs[0].([]PatchGroup)[vs[1].(int)]
}).(PatchGroupOutput)
}
type PatchGroupMapOutput struct{ *pulumi.OutputState }
func (PatchGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]PatchGroup)(nil))
}
func (o PatchGroupMapOutput) ToPatchGroupMapOutput() PatchGroupMapOutput {
return o
}
func (o PatchGroupMapOutput) ToPatchGroupMapOutputWithContext(ctx context.Context) PatchGroupMapOutput {
return o
}
func (o PatchGroupMapOutput) MapIndex(k pulumi.StringInput) PatchGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) PatchGroup {
return vs[0].(map[string]PatchGroup)[vs[1].(string)]
}).(PatchGroupOutput)
}
func init() {
pulumi.RegisterOutputType(PatchGroupOutput{})
pulumi.RegisterOutputType(PatchGroupPtrOutput{})
pulumi.RegisterOutputType(PatchGroupArrayOutput{})
pulumi.RegisterOutputType(PatchGroupMapOutput{})
}