generated from pulumi/pulumi-tf-provider-boilerplate
/
getSecurityAssessmentSecurityFeatureAnalytics.go
170 lines (149 loc) · 9.79 KB
/
getSecurityAssessmentSecurityFeatureAnalytics.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
// 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 Assessment Security Feature Analytics in Oracle Cloud Infrastructure Data Safe service.
//
// Gets a list of Database security feature usage aggregated details in the specified compartment. This provides information about the
// overall security controls, by returning the counting number of the target databases using the security features.
//
// When you perform the ListSecurityFeatureAnalytics operation, if the parameter compartmentIdInSubtree is set to "true," and if the
// parameter accessLevel is set to ACCESSIBLE, then the operation returns statistics from the compartments in which the requestor has INSPECT
// permissions on at least one resource, directly or indirectly (in subcompartments). If the operation is performed at the
// root compartment and the requestor does not have access to at least one subcompartment of the compartment specified by
// compartmentId, then "Not Authorized" is returned.
//
// ## 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.GetSecurityAssessmentSecurityFeatureAnalytics(ctx, &datasafe.GetSecurityAssessmentSecurityFeatureAnalyticsArgs{
// CompartmentId: compartmentId,
// AccessLevel: pulumi.StringRef(securityAssessmentSecurityFeatureAnalyticAccessLevel),
// CompartmentIdInSubtree: pulumi.BoolRef(securityAssessmentSecurityFeatureAnalyticCompartmentIdInSubtree),
// TargetId: pulumi.StringRef(testTarget.Id),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetSecurityAssessmentSecurityFeatureAnalytics(ctx *pulumi.Context, args *GetSecurityAssessmentSecurityFeatureAnalyticsArgs, opts ...pulumi.InvokeOption) (*GetSecurityAssessmentSecurityFeatureAnalyticsResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetSecurityAssessmentSecurityFeatureAnalyticsResult
err := ctx.Invoke("oci:DataSafe/getSecurityAssessmentSecurityFeatureAnalytics:getSecurityAssessmentSecurityFeatureAnalytics", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSecurityAssessmentSecurityFeatureAnalytics.
type GetSecurityAssessmentSecurityFeatureAnalyticsArgs 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"`
Filters []GetSecurityAssessmentSecurityFeatureAnalyticsFilter `pulumi:"filters"`
// A filter to return only items related to a specific target OCID.
TargetId *string `pulumi:"targetId"`
}
// A collection of values returned by getSecurityAssessmentSecurityFeatureAnalytics.
type GetSecurityAssessmentSecurityFeatureAnalyticsResult struct {
AccessLevel *string `pulumi:"accessLevel"`
CompartmentId string `pulumi:"compartmentId"`
CompartmentIdInSubtree *bool `pulumi:"compartmentIdInSubtree"`
Filters []GetSecurityAssessmentSecurityFeatureAnalyticsFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The list of security_feature_analytics_collection.
SecurityFeatureAnalyticsCollections []GetSecurityAssessmentSecurityFeatureAnalyticsSecurityFeatureAnalyticsCollection `pulumi:"securityFeatureAnalyticsCollections"`
TargetId *string `pulumi:"targetId"`
}
func GetSecurityAssessmentSecurityFeatureAnalyticsOutput(ctx *pulumi.Context, args GetSecurityAssessmentSecurityFeatureAnalyticsOutputArgs, opts ...pulumi.InvokeOption) GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetSecurityAssessmentSecurityFeatureAnalyticsResult, error) {
args := v.(GetSecurityAssessmentSecurityFeatureAnalyticsArgs)
r, err := GetSecurityAssessmentSecurityFeatureAnalytics(ctx, &args, opts...)
var s GetSecurityAssessmentSecurityFeatureAnalyticsResult
if r != nil {
s = *r
}
return s, err
}).(GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput)
}
// A collection of arguments for invoking getSecurityAssessmentSecurityFeatureAnalytics.
type GetSecurityAssessmentSecurityFeatureAnalyticsOutputArgs 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"`
Filters GetSecurityAssessmentSecurityFeatureAnalyticsFilterArrayInput `pulumi:"filters"`
// A filter to return only items related to a specific target OCID.
TargetId pulumi.StringPtrInput `pulumi:"targetId"`
}
func (GetSecurityAssessmentSecurityFeatureAnalyticsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetSecurityAssessmentSecurityFeatureAnalyticsArgs)(nil)).Elem()
}
// A collection of values returned by getSecurityAssessmentSecurityFeatureAnalytics.
type GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput struct{ *pulumi.OutputState }
func (GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetSecurityAssessmentSecurityFeatureAnalyticsResult)(nil)).Elem()
}
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) ToGetSecurityAssessmentSecurityFeatureAnalyticsResultOutput() GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput {
return o
}
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) ToGetSecurityAssessmentSecurityFeatureAnalyticsResultOutputWithContext(ctx context.Context) GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput {
return o
}
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) AccessLevel() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecurityAssessmentSecurityFeatureAnalyticsResult) *string { return v.AccessLevel }).(pulumi.StringPtrOutput)
}
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v GetSecurityAssessmentSecurityFeatureAnalyticsResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) CompartmentIdInSubtree() pulumi.BoolPtrOutput {
return o.ApplyT(func(v GetSecurityAssessmentSecurityFeatureAnalyticsResult) *bool { return v.CompartmentIdInSubtree }).(pulumi.BoolPtrOutput)
}
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) Filters() GetSecurityAssessmentSecurityFeatureAnalyticsFilterArrayOutput {
return o.ApplyT(func(v GetSecurityAssessmentSecurityFeatureAnalyticsResult) []GetSecurityAssessmentSecurityFeatureAnalyticsFilter {
return v.Filters
}).(GetSecurityAssessmentSecurityFeatureAnalyticsFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetSecurityAssessmentSecurityFeatureAnalyticsResult) string { return v.Id }).(pulumi.StringOutput)
}
// The list of security_feature_analytics_collection.
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) SecurityFeatureAnalyticsCollections() GetSecurityAssessmentSecurityFeatureAnalyticsSecurityFeatureAnalyticsCollectionArrayOutput {
return o.ApplyT(func(v GetSecurityAssessmentSecurityFeatureAnalyticsResult) []GetSecurityAssessmentSecurityFeatureAnalyticsSecurityFeatureAnalyticsCollection {
return v.SecurityFeatureAnalyticsCollections
}).(GetSecurityAssessmentSecurityFeatureAnalyticsSecurityFeatureAnalyticsCollectionArrayOutput)
}
func (o GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput) TargetId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecurityAssessmentSecurityFeatureAnalyticsResult) *string { return v.TargetId }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetSecurityAssessmentSecurityFeatureAnalyticsResultOutput{})
}