generated from pulumi/pulumi-tf-provider-boilerplate
/
securityPolicy.go
377 lines (320 loc) · 18.7 KB
/
securityPolicy.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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
// 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 datasafe
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 Security Policy resource in Oracle Cloud Infrastructure Data Safe service.
//
// Updates the security policy.
//
// ## Import
//
// SecurityPolicies can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import oci:DataSafe/securityPolicy:SecurityPolicy test_security_policy "id"
// ```
type SecurityPolicy struct {
pulumi.CustomResourceState
// (Updatable) The OCID of the compartment containing the security policy.
CompartmentId pulumi.StringOutput `pulumi:"compartmentId"`
// (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Operations.CostCenter": "42"}`
DefinedTags pulumi.MapOutput `pulumi:"definedTags"`
// (Updatable) The description of the security policy.
Description pulumi.StringOutput `pulumi:"description"`
// (Updatable) The display name of the security policy. The name does not have to be unique, and it is changeable.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Department": "Finance"}`
FreeformTags pulumi.MapOutput `pulumi:"freeformTags"`
// Details about the current state of the security policy in Data Safe.
LifecycleDetails pulumi.StringOutput `pulumi:"lifecycleDetails"`
// The OCID of the security policy resource.
//
// ** 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
SecurityPolicyId pulumi.StringOutput `pulumi:"securityPolicyId"`
// The current state of the security policy.
State pulumi.StringOutput `pulumi:"state"`
// System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: `{"orcl-cloud.free-tier-retained": "true"}`
SystemTags pulumi.MapOutput `pulumi:"systemTags"`
// The time that the security policy was created, in the format defined by RFC3339.
TimeCreated pulumi.StringOutput `pulumi:"timeCreated"`
// The last date and time the security policy was updated, in the format defined by RFC3339.
TimeUpdated pulumi.StringOutput `pulumi:"timeUpdated"`
}
// NewSecurityPolicy registers a new resource with the given unique name, arguments, and options.
func NewSecurityPolicy(ctx *pulumi.Context,
name string, args *SecurityPolicyArgs, opts ...pulumi.ResourceOption) (*SecurityPolicy, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SecurityPolicyId == nil {
return nil, errors.New("invalid value for required argument 'SecurityPolicyId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SecurityPolicy
err := ctx.RegisterResource("oci:DataSafe/securityPolicy:SecurityPolicy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSecurityPolicy gets an existing SecurityPolicy 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 GetSecurityPolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SecurityPolicyState, opts ...pulumi.ResourceOption) (*SecurityPolicy, error) {
var resource SecurityPolicy
err := ctx.ReadResource("oci:DataSafe/securityPolicy:SecurityPolicy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SecurityPolicy resources.
type securityPolicyState struct {
// (Updatable) The OCID of the compartment containing the security policy.
CompartmentId *string `pulumi:"compartmentId"`
// (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Operations.CostCenter": "42"}`
DefinedTags map[string]interface{} `pulumi:"definedTags"`
// (Updatable) The description of the security policy.
Description *string `pulumi:"description"`
// (Updatable) The display name of the security policy. The name does not have to be unique, and it is changeable.
DisplayName *string `pulumi:"displayName"`
// (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Department": "Finance"}`
FreeformTags map[string]interface{} `pulumi:"freeformTags"`
// Details about the current state of the security policy in Data Safe.
LifecycleDetails *string `pulumi:"lifecycleDetails"`
// The OCID of the security policy resource.
//
// ** 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
SecurityPolicyId *string `pulumi:"securityPolicyId"`
// The current state of the security policy.
State *string `pulumi:"state"`
// System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: `{"orcl-cloud.free-tier-retained": "true"}`
SystemTags map[string]interface{} `pulumi:"systemTags"`
// The time that the security policy was created, in the format defined by RFC3339.
TimeCreated *string `pulumi:"timeCreated"`
// The last date and time the security policy was updated, in the format defined by RFC3339.
TimeUpdated *string `pulumi:"timeUpdated"`
}
type SecurityPolicyState struct {
// (Updatable) The OCID of the compartment containing the security policy.
CompartmentId pulumi.StringPtrInput
// (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Operations.CostCenter": "42"}`
DefinedTags pulumi.MapInput
// (Updatable) The description of the security policy.
Description pulumi.StringPtrInput
// (Updatable) The display name of the security policy. The name does not have to be unique, and it is changeable.
DisplayName pulumi.StringPtrInput
// (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Department": "Finance"}`
FreeformTags pulumi.MapInput
// Details about the current state of the security policy in Data Safe.
LifecycleDetails pulumi.StringPtrInput
// The OCID of the security policy resource.
//
// ** 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
SecurityPolicyId pulumi.StringPtrInput
// The current state of the security policy.
State pulumi.StringPtrInput
// System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: `{"orcl-cloud.free-tier-retained": "true"}`
SystemTags pulumi.MapInput
// The time that the security policy was created, in the format defined by RFC3339.
TimeCreated pulumi.StringPtrInput
// The last date and time the security policy was updated, in the format defined by RFC3339.
TimeUpdated pulumi.StringPtrInput
}
func (SecurityPolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*securityPolicyState)(nil)).Elem()
}
type securityPolicyArgs struct {
// (Updatable) The OCID of the compartment containing the security policy.
CompartmentId *string `pulumi:"compartmentId"`
// (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Operations.CostCenter": "42"}`
DefinedTags map[string]interface{} `pulumi:"definedTags"`
// (Updatable) The description of the security policy.
Description *string `pulumi:"description"`
// (Updatable) The display name of the security policy. The name does not have to be unique, and it is changeable.
DisplayName *string `pulumi:"displayName"`
// (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Department": "Finance"}`
FreeformTags map[string]interface{} `pulumi:"freeformTags"`
// The OCID of the security policy resource.
//
// ** 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
SecurityPolicyId string `pulumi:"securityPolicyId"`
}
// The set of arguments for constructing a SecurityPolicy resource.
type SecurityPolicyArgs struct {
// (Updatable) The OCID of the compartment containing the security policy.
CompartmentId pulumi.StringPtrInput
// (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Operations.CostCenter": "42"}`
DefinedTags pulumi.MapInput
// (Updatable) The description of the security policy.
Description pulumi.StringPtrInput
// (Updatable) The display name of the security policy. The name does not have to be unique, and it is changeable.
DisplayName pulumi.StringPtrInput
// (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Department": "Finance"}`
FreeformTags pulumi.MapInput
// The OCID of the security policy resource.
//
// ** 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
SecurityPolicyId pulumi.StringInput
}
func (SecurityPolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*securityPolicyArgs)(nil)).Elem()
}
type SecurityPolicyInput interface {
pulumi.Input
ToSecurityPolicyOutput() SecurityPolicyOutput
ToSecurityPolicyOutputWithContext(ctx context.Context) SecurityPolicyOutput
}
func (*SecurityPolicy) ElementType() reflect.Type {
return reflect.TypeOf((**SecurityPolicy)(nil)).Elem()
}
func (i *SecurityPolicy) ToSecurityPolicyOutput() SecurityPolicyOutput {
return i.ToSecurityPolicyOutputWithContext(context.Background())
}
func (i *SecurityPolicy) ToSecurityPolicyOutputWithContext(ctx context.Context) SecurityPolicyOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecurityPolicyOutput)
}
// SecurityPolicyArrayInput is an input type that accepts SecurityPolicyArray and SecurityPolicyArrayOutput values.
// You can construct a concrete instance of `SecurityPolicyArrayInput` via:
//
// SecurityPolicyArray{ SecurityPolicyArgs{...} }
type SecurityPolicyArrayInput interface {
pulumi.Input
ToSecurityPolicyArrayOutput() SecurityPolicyArrayOutput
ToSecurityPolicyArrayOutputWithContext(context.Context) SecurityPolicyArrayOutput
}
type SecurityPolicyArray []SecurityPolicyInput
func (SecurityPolicyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SecurityPolicy)(nil)).Elem()
}
func (i SecurityPolicyArray) ToSecurityPolicyArrayOutput() SecurityPolicyArrayOutput {
return i.ToSecurityPolicyArrayOutputWithContext(context.Background())
}
func (i SecurityPolicyArray) ToSecurityPolicyArrayOutputWithContext(ctx context.Context) SecurityPolicyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecurityPolicyArrayOutput)
}
// SecurityPolicyMapInput is an input type that accepts SecurityPolicyMap and SecurityPolicyMapOutput values.
// You can construct a concrete instance of `SecurityPolicyMapInput` via:
//
// SecurityPolicyMap{ "key": SecurityPolicyArgs{...} }
type SecurityPolicyMapInput interface {
pulumi.Input
ToSecurityPolicyMapOutput() SecurityPolicyMapOutput
ToSecurityPolicyMapOutputWithContext(context.Context) SecurityPolicyMapOutput
}
type SecurityPolicyMap map[string]SecurityPolicyInput
func (SecurityPolicyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SecurityPolicy)(nil)).Elem()
}
func (i SecurityPolicyMap) ToSecurityPolicyMapOutput() SecurityPolicyMapOutput {
return i.ToSecurityPolicyMapOutputWithContext(context.Background())
}
func (i SecurityPolicyMap) ToSecurityPolicyMapOutputWithContext(ctx context.Context) SecurityPolicyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecurityPolicyMapOutput)
}
type SecurityPolicyOutput struct{ *pulumi.OutputState }
func (SecurityPolicyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SecurityPolicy)(nil)).Elem()
}
func (o SecurityPolicyOutput) ToSecurityPolicyOutput() SecurityPolicyOutput {
return o
}
func (o SecurityPolicyOutput) ToSecurityPolicyOutputWithContext(ctx context.Context) SecurityPolicyOutput {
return o
}
// (Updatable) The OCID of the compartment containing the security policy.
func (o SecurityPolicyOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.StringOutput { return v.CompartmentId }).(pulumi.StringOutput)
}
// (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Operations.CostCenter": "42"}`
func (o SecurityPolicyOutput) DefinedTags() pulumi.MapOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.MapOutput { return v.DefinedTags }).(pulumi.MapOutput)
}
// (Updatable) The description of the security policy.
func (o SecurityPolicyOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// (Updatable) The display name of the security policy. The name does not have to be unique, and it is changeable.
func (o SecurityPolicyOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) Example: `{"Department": "Finance"}`
func (o SecurityPolicyOutput) FreeformTags() pulumi.MapOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.MapOutput { return v.FreeformTags }).(pulumi.MapOutput)
}
// Details about the current state of the security policy in Data Safe.
func (o SecurityPolicyOutput) LifecycleDetails() pulumi.StringOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.StringOutput { return v.LifecycleDetails }).(pulumi.StringOutput)
}
// The OCID of the security policy resource.
//
// ** 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 SecurityPolicyOutput) SecurityPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.StringOutput { return v.SecurityPolicyId }).(pulumi.StringOutput)
}
// The current state of the security policy.
func (o SecurityPolicyOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: `{"orcl-cloud.free-tier-retained": "true"}`
func (o SecurityPolicyOutput) SystemTags() pulumi.MapOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.MapOutput { return v.SystemTags }).(pulumi.MapOutput)
}
// The time that the security policy was created, in the format defined by RFC3339.
func (o SecurityPolicyOutput) TimeCreated() pulumi.StringOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.StringOutput { return v.TimeCreated }).(pulumi.StringOutput)
}
// The last date and time the security policy was updated, in the format defined by RFC3339.
func (o SecurityPolicyOutput) TimeUpdated() pulumi.StringOutput {
return o.ApplyT(func(v *SecurityPolicy) pulumi.StringOutput { return v.TimeUpdated }).(pulumi.StringOutput)
}
type SecurityPolicyArrayOutput struct{ *pulumi.OutputState }
func (SecurityPolicyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SecurityPolicy)(nil)).Elem()
}
func (o SecurityPolicyArrayOutput) ToSecurityPolicyArrayOutput() SecurityPolicyArrayOutput {
return o
}
func (o SecurityPolicyArrayOutput) ToSecurityPolicyArrayOutputWithContext(ctx context.Context) SecurityPolicyArrayOutput {
return o
}
func (o SecurityPolicyArrayOutput) Index(i pulumi.IntInput) SecurityPolicyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SecurityPolicy {
return vs[0].([]*SecurityPolicy)[vs[1].(int)]
}).(SecurityPolicyOutput)
}
type SecurityPolicyMapOutput struct{ *pulumi.OutputState }
func (SecurityPolicyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SecurityPolicy)(nil)).Elem()
}
func (o SecurityPolicyMapOutput) ToSecurityPolicyMapOutput() SecurityPolicyMapOutput {
return o
}
func (o SecurityPolicyMapOutput) ToSecurityPolicyMapOutputWithContext(ctx context.Context) SecurityPolicyMapOutput {
return o
}
func (o SecurityPolicyMapOutput) MapIndex(k pulumi.StringInput) SecurityPolicyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SecurityPolicy {
return vs[0].(map[string]*SecurityPolicy)[vs[1].(string)]
}).(SecurityPolicyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SecurityPolicyInput)(nil)).Elem(), &SecurityPolicy{})
pulumi.RegisterInputType(reflect.TypeOf((*SecurityPolicyArrayInput)(nil)).Elem(), SecurityPolicyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SecurityPolicyMapInput)(nil)).Elem(), SecurityPolicyMap{})
pulumi.RegisterOutputType(SecurityPolicyOutput{})
pulumi.RegisterOutputType(SecurityPolicyArrayOutput{})
pulumi.RegisterOutputType(SecurityPolicyMapOutput{})
}