generated from pulumi/pulumi-tf-provider-boilerplate
/
configuration.go
286 lines (238 loc) · 10.1 KB
/
configuration.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
// 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 audit
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This resource provides the Configuration resource in Oracle Cloud Infrastructure Audit service.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/Audit"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Audit.NewConfiguration(ctx, "test_configuration", &Audit.ConfigurationArgs{
// CompartmentId: pulumi.Any(tenancyOcid),
// RetentionPeriodDays: pulumi.Any(configurationRetentionPeriodDays),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Import is not supported for this resource.
type Configuration struct {
pulumi.CustomResourceState
// ID of the root compartment (tenancy)
CompartmentId pulumi.StringOutput `pulumi:"compartmentId"`
// (Updatable) The retention period setting, specified in days. The minimum is 90, the maximum 365. Example: `90`
//
// ** IMPORTANT **
// Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
RetentionPeriodDays pulumi.IntOutput `pulumi:"retentionPeriodDays"`
}
// NewConfiguration registers a new resource with the given unique name, arguments, and options.
func NewConfiguration(ctx *pulumi.Context,
name string, args *ConfigurationArgs, opts ...pulumi.ResourceOption) (*Configuration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CompartmentId == nil {
return nil, errors.New("invalid value for required argument 'CompartmentId'")
}
if args.RetentionPeriodDays == nil {
return nil, errors.New("invalid value for required argument 'RetentionPeriodDays'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Configuration
err := ctx.RegisterResource("oci:Audit/configuration:Configuration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetConfiguration gets an existing Configuration 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 GetConfiguration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ConfigurationState, opts ...pulumi.ResourceOption) (*Configuration, error) {
var resource Configuration
err := ctx.ReadResource("oci:Audit/configuration:Configuration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Configuration resources.
type configurationState struct {
// ID of the root compartment (tenancy)
CompartmentId *string `pulumi:"compartmentId"`
// (Updatable) The retention period setting, specified in days. The minimum is 90, the maximum 365. Example: `90`
//
// ** IMPORTANT **
// Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
RetentionPeriodDays *int `pulumi:"retentionPeriodDays"`
}
type ConfigurationState struct {
// ID of the root compartment (tenancy)
CompartmentId pulumi.StringPtrInput
// (Updatable) The retention period setting, specified in days. The minimum is 90, the maximum 365. Example: `90`
//
// ** IMPORTANT **
// Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
RetentionPeriodDays pulumi.IntPtrInput
}
func (ConfigurationState) ElementType() reflect.Type {
return reflect.TypeOf((*configurationState)(nil)).Elem()
}
type configurationArgs struct {
// ID of the root compartment (tenancy)
CompartmentId string `pulumi:"compartmentId"`
// (Updatable) The retention period setting, specified in days. The minimum is 90, the maximum 365. Example: `90`
//
// ** IMPORTANT **
// Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
RetentionPeriodDays int `pulumi:"retentionPeriodDays"`
}
// The set of arguments for constructing a Configuration resource.
type ConfigurationArgs struct {
// ID of the root compartment (tenancy)
CompartmentId pulumi.StringInput
// (Updatable) The retention period setting, specified in days. The minimum is 90, the maximum 365. Example: `90`
//
// ** IMPORTANT **
// Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
RetentionPeriodDays pulumi.IntInput
}
func (ConfigurationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*configurationArgs)(nil)).Elem()
}
type ConfigurationInput interface {
pulumi.Input
ToConfigurationOutput() ConfigurationOutput
ToConfigurationOutputWithContext(ctx context.Context) ConfigurationOutput
}
func (*Configuration) ElementType() reflect.Type {
return reflect.TypeOf((**Configuration)(nil)).Elem()
}
func (i *Configuration) ToConfigurationOutput() ConfigurationOutput {
return i.ToConfigurationOutputWithContext(context.Background())
}
func (i *Configuration) ToConfigurationOutputWithContext(ctx context.Context) ConfigurationOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConfigurationOutput)
}
// ConfigurationArrayInput is an input type that accepts ConfigurationArray and ConfigurationArrayOutput values.
// You can construct a concrete instance of `ConfigurationArrayInput` via:
//
// ConfigurationArray{ ConfigurationArgs{...} }
type ConfigurationArrayInput interface {
pulumi.Input
ToConfigurationArrayOutput() ConfigurationArrayOutput
ToConfigurationArrayOutputWithContext(context.Context) ConfigurationArrayOutput
}
type ConfigurationArray []ConfigurationInput
func (ConfigurationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Configuration)(nil)).Elem()
}
func (i ConfigurationArray) ToConfigurationArrayOutput() ConfigurationArrayOutput {
return i.ToConfigurationArrayOutputWithContext(context.Background())
}
func (i ConfigurationArray) ToConfigurationArrayOutputWithContext(ctx context.Context) ConfigurationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConfigurationArrayOutput)
}
// ConfigurationMapInput is an input type that accepts ConfigurationMap and ConfigurationMapOutput values.
// You can construct a concrete instance of `ConfigurationMapInput` via:
//
// ConfigurationMap{ "key": ConfigurationArgs{...} }
type ConfigurationMapInput interface {
pulumi.Input
ToConfigurationMapOutput() ConfigurationMapOutput
ToConfigurationMapOutputWithContext(context.Context) ConfigurationMapOutput
}
type ConfigurationMap map[string]ConfigurationInput
func (ConfigurationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Configuration)(nil)).Elem()
}
func (i ConfigurationMap) ToConfigurationMapOutput() ConfigurationMapOutput {
return i.ToConfigurationMapOutputWithContext(context.Background())
}
func (i ConfigurationMap) ToConfigurationMapOutputWithContext(ctx context.Context) ConfigurationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConfigurationMapOutput)
}
type ConfigurationOutput struct{ *pulumi.OutputState }
func (ConfigurationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Configuration)(nil)).Elem()
}
func (o ConfigurationOutput) ToConfigurationOutput() ConfigurationOutput {
return o
}
func (o ConfigurationOutput) ToConfigurationOutputWithContext(ctx context.Context) ConfigurationOutput {
return o
}
// ID of the root compartment (tenancy)
func (o ConfigurationOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v *Configuration) pulumi.StringOutput { return v.CompartmentId }).(pulumi.StringOutput)
}
// (Updatable) The retention period setting, specified in days. The minimum is 90, the maximum 365. Example: `90`
//
// ** IMPORTANT **
// Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
func (o ConfigurationOutput) RetentionPeriodDays() pulumi.IntOutput {
return o.ApplyT(func(v *Configuration) pulumi.IntOutput { return v.RetentionPeriodDays }).(pulumi.IntOutput)
}
type ConfigurationArrayOutput struct{ *pulumi.OutputState }
func (ConfigurationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Configuration)(nil)).Elem()
}
func (o ConfigurationArrayOutput) ToConfigurationArrayOutput() ConfigurationArrayOutput {
return o
}
func (o ConfigurationArrayOutput) ToConfigurationArrayOutputWithContext(ctx context.Context) ConfigurationArrayOutput {
return o
}
func (o ConfigurationArrayOutput) Index(i pulumi.IntInput) ConfigurationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Configuration {
return vs[0].([]*Configuration)[vs[1].(int)]
}).(ConfigurationOutput)
}
type ConfigurationMapOutput struct{ *pulumi.OutputState }
func (ConfigurationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Configuration)(nil)).Elem()
}
func (o ConfigurationMapOutput) ToConfigurationMapOutput() ConfigurationMapOutput {
return o
}
func (o ConfigurationMapOutput) ToConfigurationMapOutputWithContext(ctx context.Context) ConfigurationMapOutput {
return o
}
func (o ConfigurationMapOutput) MapIndex(k pulumi.StringInput) ConfigurationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Configuration {
return vs[0].(map[string]*Configuration)[vs[1].(string)]
}).(ConfigurationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationInput)(nil)).Elem(), &Configuration{})
pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationArrayInput)(nil)).Elem(), ConfigurationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationMapInput)(nil)).Elem(), ConfigurationMap{})
pulumi.RegisterOutputType(ConfigurationOutput{})
pulumi.RegisterOutputType(ConfigurationArrayOutput{})
pulumi.RegisterOutputType(ConfigurationMapOutput{})
}