generated from pulumi/pulumi-tf-provider-boilerplate
/
getSecurityPolicyReports.go
212 lines (188 loc) · 10.6 KB
/
getSecurityPolicyReports.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
// 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"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides the list of Security Policy Reports in Oracle Cloud Infrastructure Data Safe service.
//
// Retrieves a list of all security policy reports in Data Safe.
//
// The ListSecurityPolicyReports operation returns only the security policy reports in the specified `compartmentId`.
//
// The parameter `accessLevel` specifies whether to return only those compartments for which the
// requestor has INSPECT permissions on at least one resource directly
// or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if
// Principal doesn't have access to even one of the child compartments. This is valid only when
// `compartmentIdInSubtree` is set to `true`.
//
// The parameter `compartmentIdInSubtree` applies when you perform ListSecurityPolicyReports on the
// `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned.
// To get a full list of all compartments and subcompartments in the tenancy (root compartment),
// set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/DataSafe"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := DataSafe.GetSecurityPolicyReports(ctx, &datasafe.GetSecurityPolicyReportsArgs{
// CompartmentId: compartmentId,
// AccessLevel: pulumi.StringRef(securityPolicyReportAccessLevel),
// CompartmentIdInSubtree: pulumi.BoolRef(securityPolicyReportCompartmentIdInSubtree),
// DisplayName: pulumi.StringRef(securityPolicyReportDisplayName),
// SecurityPolicyReportId: pulumi.StringRef(testSecurityPolicyReport.Id),
// State: pulumi.StringRef(securityPolicyReportState),
// TargetId: pulumi.StringRef(testTarget.Id),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetSecurityPolicyReports(ctx *pulumi.Context, args *GetSecurityPolicyReportsArgs, opts ...pulumi.InvokeOption) (*GetSecurityPolicyReportsResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetSecurityPolicyReportsResult
err := ctx.Invoke("oci:DataSafe/getSecurityPolicyReports:getSecurityPolicyReports", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSecurityPolicyReports.
type GetSecurityPolicyReportsArgs struct {
// Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
AccessLevel *string `pulumi:"accessLevel"`
// A filter to return only resources that match the specified compartment OCID.
CompartmentId string `pulumi:"compartmentId"`
// Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
CompartmentIdInSubtree *bool `pulumi:"compartmentIdInSubtree"`
// A filter to return only resources that match the specified display name.
DisplayName *string `pulumi:"displayName"`
Filters []GetSecurityPolicyReportsFilter `pulumi:"filters"`
// An optional filter to return only resources that match the specified OCID of the security policy report resource.
SecurityPolicyReportId *string `pulumi:"securityPolicyReportId"`
// The current state of the security policy report.
State *string `pulumi:"state"`
// A filter to return only items related to a specific target OCID.
TargetId *string `pulumi:"targetId"`
}
// A collection of values returned by getSecurityPolicyReports.
type GetSecurityPolicyReportsResult struct {
AccessLevel *string `pulumi:"accessLevel"`
// The OCID of the compartment that contains the security policy report.
CompartmentId string `pulumi:"compartmentId"`
CompartmentIdInSubtree *bool `pulumi:"compartmentIdInSubtree"`
// The display name of the security policy report.
DisplayName *string `pulumi:"displayName"`
Filters []GetSecurityPolicyReportsFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The list of security_policy_report_collection.
SecurityPolicyReportCollections []GetSecurityPolicyReportsSecurityPolicyReportCollection `pulumi:"securityPolicyReportCollections"`
SecurityPolicyReportId *string `pulumi:"securityPolicyReportId"`
// The current state of the security policy report.
State *string `pulumi:"state"`
// The OCID of the of the target database.
TargetId *string `pulumi:"targetId"`
}
func GetSecurityPolicyReportsOutput(ctx *pulumi.Context, args GetSecurityPolicyReportsOutputArgs, opts ...pulumi.InvokeOption) GetSecurityPolicyReportsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetSecurityPolicyReportsResult, error) {
args := v.(GetSecurityPolicyReportsArgs)
r, err := GetSecurityPolicyReports(ctx, &args, opts...)
var s GetSecurityPolicyReportsResult
if r != nil {
s = *r
}
return s, err
}).(GetSecurityPolicyReportsResultOutput)
}
// A collection of arguments for invoking getSecurityPolicyReports.
type GetSecurityPolicyReportsOutputArgs struct {
// Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
AccessLevel pulumi.StringPtrInput `pulumi:"accessLevel"`
// A filter to return only resources that match the specified compartment OCID.
CompartmentId pulumi.StringInput `pulumi:"compartmentId"`
// Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
CompartmentIdInSubtree pulumi.BoolPtrInput `pulumi:"compartmentIdInSubtree"`
// A filter to return only resources that match the specified display name.
DisplayName pulumi.StringPtrInput `pulumi:"displayName"`
Filters GetSecurityPolicyReportsFilterArrayInput `pulumi:"filters"`
// An optional filter to return only resources that match the specified OCID of the security policy report resource.
SecurityPolicyReportId pulumi.StringPtrInput `pulumi:"securityPolicyReportId"`
// The current state of the security policy report.
State pulumi.StringPtrInput `pulumi:"state"`
// A filter to return only items related to a specific target OCID.
TargetId pulumi.StringPtrInput `pulumi:"targetId"`
}
func (GetSecurityPolicyReportsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetSecurityPolicyReportsArgs)(nil)).Elem()
}
// A collection of values returned by getSecurityPolicyReports.
type GetSecurityPolicyReportsResultOutput struct{ *pulumi.OutputState }
func (GetSecurityPolicyReportsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetSecurityPolicyReportsResult)(nil)).Elem()
}
func (o GetSecurityPolicyReportsResultOutput) ToGetSecurityPolicyReportsResultOutput() GetSecurityPolicyReportsResultOutput {
return o
}
func (o GetSecurityPolicyReportsResultOutput) ToGetSecurityPolicyReportsResultOutputWithContext(ctx context.Context) GetSecurityPolicyReportsResultOutput {
return o
}
func (o GetSecurityPolicyReportsResultOutput) AccessLevel() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) *string { return v.AccessLevel }).(pulumi.StringPtrOutput)
}
// The OCID of the compartment that contains the security policy report.
func (o GetSecurityPolicyReportsResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
func (o GetSecurityPolicyReportsResultOutput) CompartmentIdInSubtree() pulumi.BoolPtrOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) *bool { return v.CompartmentIdInSubtree }).(pulumi.BoolPtrOutput)
}
// The display name of the security policy report.
func (o GetSecurityPolicyReportsResultOutput) DisplayName() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) *string { return v.DisplayName }).(pulumi.StringPtrOutput)
}
func (o GetSecurityPolicyReportsResultOutput) Filters() GetSecurityPolicyReportsFilterArrayOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) []GetSecurityPolicyReportsFilter { return v.Filters }).(GetSecurityPolicyReportsFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetSecurityPolicyReportsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) string { return v.Id }).(pulumi.StringOutput)
}
// The list of security_policy_report_collection.
func (o GetSecurityPolicyReportsResultOutput) SecurityPolicyReportCollections() GetSecurityPolicyReportsSecurityPolicyReportCollectionArrayOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) []GetSecurityPolicyReportsSecurityPolicyReportCollection {
return v.SecurityPolicyReportCollections
}).(GetSecurityPolicyReportsSecurityPolicyReportCollectionArrayOutput)
}
func (o GetSecurityPolicyReportsResultOutput) SecurityPolicyReportId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) *string { return v.SecurityPolicyReportId }).(pulumi.StringPtrOutput)
}
// The current state of the security policy report.
func (o GetSecurityPolicyReportsResultOutput) State() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) *string { return v.State }).(pulumi.StringPtrOutput)
}
// The OCID of the of the target database.
func (o GetSecurityPolicyReportsResultOutput) TargetId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecurityPolicyReportsResult) *string { return v.TargetId }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetSecurityPolicyReportsResultOutput{})
}