oci.DataSafe.getAuditTrailAnalytic
Explore with Pulumi AI
This data source provides details about a specific Audit Trail Analytic resource in Oracle Cloud Infrastructure Data Safe service.
Gets a list of audit trail aggregated details . A audit trail aggregation helps understand the overall state of trails. As an example, it helps understand how many trails are running or stopped. It is especially useful to create dashboards or to support analytics.
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 AuditTrailAnalytics 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
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testAuditTrailAnalytic = oci.DataSafe.getAuditTrailAnalytic({
compartmentId: compartmentId,
accessLevel: auditTrailAnalyticAccessLevel,
compartmentIdInSubtree: auditTrailAnalyticCompartmentIdInSubtree,
groupBies: auditTrailAnalyticGroupBy,
targetId: testTarget.id,
});
import pulumi
import pulumi_oci as oci
test_audit_trail_analytic = oci.DataSafe.get_audit_trail_analytic(compartment_id=compartment_id,
access_level=audit_trail_analytic_access_level,
compartment_id_in_subtree=audit_trail_analytic_compartment_id_in_subtree,
group_bies=audit_trail_analytic_group_by,
target_id=test_target["id"])
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.GetAuditTrailAnalytic(ctx, &datasafe.GetAuditTrailAnalyticArgs{
CompartmentId: compartmentId,
AccessLevel: pulumi.StringRef(auditTrailAnalyticAccessLevel),
CompartmentIdInSubtree: pulumi.BoolRef(auditTrailAnalyticCompartmentIdInSubtree),
GroupBies: auditTrailAnalyticGroupBy,
TargetId: pulumi.StringRef(testTarget.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testAuditTrailAnalytic = Oci.DataSafe.GetAuditTrailAnalytic.Invoke(new()
{
CompartmentId = compartmentId,
AccessLevel = auditTrailAnalyticAccessLevel,
CompartmentIdInSubtree = auditTrailAnalyticCompartmentIdInSubtree,
GroupBies = auditTrailAnalyticGroupBy,
TargetId = testTarget.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DataSafe.DataSafeFunctions;
import com.pulumi.oci.DataSafe.inputs.GetAuditTrailAnalyticArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var testAuditTrailAnalytic = DataSafeFunctions.getAuditTrailAnalytic(GetAuditTrailAnalyticArgs.builder()
.compartmentId(compartmentId)
.accessLevel(auditTrailAnalyticAccessLevel)
.compartmentIdInSubtree(auditTrailAnalyticCompartmentIdInSubtree)
.groupBies(auditTrailAnalyticGroupBy)
.targetId(testTarget.id())
.build());
}
}
variables:
testAuditTrailAnalytic:
fn::invoke:
Function: oci:DataSafe:getAuditTrailAnalytic
Arguments:
compartmentId: ${compartmentId}
accessLevel: ${auditTrailAnalyticAccessLevel}
compartmentIdInSubtree: ${auditTrailAnalyticCompartmentIdInSubtree}
groupBies: ${auditTrailAnalyticGroupBy}
targetId: ${testTarget.id}
Using getAuditTrailAnalytic
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAuditTrailAnalytic(args: GetAuditTrailAnalyticArgs, opts?: InvokeOptions): Promise<GetAuditTrailAnalyticResult>
function getAuditTrailAnalyticOutput(args: GetAuditTrailAnalyticOutputArgs, opts?: InvokeOptions): Output<GetAuditTrailAnalyticResult>
def get_audit_trail_analytic(access_level: Optional[str] = None,
compartment_id: Optional[str] = None,
compartment_id_in_subtree: Optional[bool] = None,
group_bies: Optional[Sequence[str]] = None,
target_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAuditTrailAnalyticResult
def get_audit_trail_analytic_output(access_level: Optional[pulumi.Input[str]] = None,
compartment_id: Optional[pulumi.Input[str]] = None,
compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
group_bies: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
target_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAuditTrailAnalyticResult]
func GetAuditTrailAnalytic(ctx *Context, args *GetAuditTrailAnalyticArgs, opts ...InvokeOption) (*GetAuditTrailAnalyticResult, error)
func GetAuditTrailAnalyticOutput(ctx *Context, args *GetAuditTrailAnalyticOutputArgs, opts ...InvokeOption) GetAuditTrailAnalyticResultOutput
> Note: This function is named GetAuditTrailAnalytic
in the Go SDK.
public static class GetAuditTrailAnalytic
{
public static Task<GetAuditTrailAnalyticResult> InvokeAsync(GetAuditTrailAnalyticArgs args, InvokeOptions? opts = null)
public static Output<GetAuditTrailAnalyticResult> Invoke(GetAuditTrailAnalyticInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAuditTrailAnalyticResult> getAuditTrailAnalytic(GetAuditTrailAnalyticArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:DataSafe/getAuditTrailAnalytic:getAuditTrailAnalytic
arguments:
# arguments dictionary
The following arguments are supported:
- Compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- Access
Level string - 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.
- Compartment
Id boolIn Subtree - 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.
- Group
Bies List<string> - The group by parameter for summarize operation on audit trail.
- Target
Id string - A filter to return only items related to a specific target OCID.
- Compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- Access
Level string - 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.
- Compartment
Id boolIn Subtree - 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.
- Group
Bies []string - The group by parameter for summarize operation on audit trail.
- Target
Id string - A filter to return only items related to a specific target OCID.
- compartment
Id String - A filter to return only resources that match the specified compartment OCID.
- access
Level String - 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.
- compartment
Id BooleanIn Subtree - 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.
- group
Bies List<String> - The group by parameter for summarize operation on audit trail.
- target
Id String - A filter to return only items related to a specific target OCID.
- compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- access
Level string - 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.
- compartment
Id booleanIn Subtree - 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.
- group
Bies string[] - The group by parameter for summarize operation on audit trail.
- target
Id string - A filter to return only items related to a specific target OCID.
- compartment_
id str - A filter to return only resources that match the specified compartment OCID.
- access_
level str - 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.
- compartment_
id_ boolin_ subtree - 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.
- group_
bies Sequence[str] - The group by parameter for summarize operation on audit trail.
- target_
id str - A filter to return only items related to a specific target OCID.
- compartment
Id String - A filter to return only resources that match the specified compartment OCID.
- access
Level String - 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.
- compartment
Id BooleanIn Subtree - 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.
- group
Bies List<String> - The group by parameter for summarize operation on audit trail.
- target
Id String - A filter to return only items related to a specific target OCID.
getAuditTrailAnalytic Result
The following output properties are available:
- Compartment
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Items
List<Get
Audit Trail Analytic Item> - Array of audit trail aggregration data.
- Access
Level string - Compartment
Id boolIn Subtree - Group
Bies List<string> - Target
Id string - The OCID of the Data Safe target for which the audit trail is created.
- Compartment
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Items
[]Get
Audit Trail Analytic Item - Array of audit trail aggregration data.
- Access
Level string - Compartment
Id boolIn Subtree - Group
Bies []string - Target
Id string - The OCID of the Data Safe target for which the audit trail is created.
- compartment
Id String - id String
- The provider-assigned unique ID for this managed resource.
- items
List<Get
Audit Trail Analytic Item> - Array of audit trail aggregration data.
- access
Level String - compartment
Id BooleanIn Subtree - group
Bies List<String> - target
Id String - The OCID of the Data Safe target for which the audit trail is created.
- compartment
Id string - id string
- The provider-assigned unique ID for this managed resource.
- items
Get
Audit Trail Analytic Item[] - Array of audit trail aggregration data.
- access
Level string - compartment
Id booleanIn Subtree - group
Bies string[] - target
Id string - The OCID of the Data Safe target for which the audit trail is created.
- compartment_
id str - id str
- The provider-assigned unique ID for this managed resource.
- items
Sequence[datasafe.
Get Audit Trail Analytic Item] - Array of audit trail aggregration data.
- access_
level str - compartment_
id_ boolin_ subtree - group_
bies Sequence[str] - target_
id str - The OCID of the Data Safe target for which the audit trail is created.
- compartment
Id String - id String
- The provider-assigned unique ID for this managed resource.
- items List<Property Map>
- Array of audit trail aggregration data.
- access
Level String - compartment
Id BooleanIn Subtree - group
Bies List<String> - target
Id String - The OCID of the Data Safe target for which the audit trail is created.
Supporting Types
GetAuditTrailAnalyticItem
- Count string
- Total count of aggregated metric.
- Dimensions
List<Get
Audit Trail Analytic Item Dimension> - Details of aggregation dimensions used for summarizing audit trails.
- Count string
- Total count of aggregated metric.
- Dimensions
[]Get
Audit Trail Analytic Item Dimension - Details of aggregation dimensions used for summarizing audit trails.
- count String
- Total count of aggregated metric.
- dimensions
List<Get
Audit Trail Analytic Item Dimension> - Details of aggregation dimensions used for summarizing audit trails.
- count string
- Total count of aggregated metric.
- dimensions
Get
Audit Trail Analytic Item Dimension[] - Details of aggregation dimensions used for summarizing audit trails.
- count str
- Total count of aggregated metric.
- dimensions
Sequence[datasafe.
Get Audit Trail Analytic Item Dimension] - Details of aggregation dimensions used for summarizing audit trails.
- count String
- Total count of aggregated metric.
- dimensions List<Property Map>
- Details of aggregation dimensions used for summarizing audit trails.
GetAuditTrailAnalyticItemDimension
- Location string
- The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
- State string
- The current state of the audit trail.
- Status string
- The current sub-state of the audit trail..
- Target
Id string - A filter to return only items related to a specific target OCID.
- Location string
- The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
- State string
- The current state of the audit trail.
- Status string
- The current sub-state of the audit trail..
- Target
Id string - A filter to return only items related to a specific target OCID.
- location String
- The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
- state String
- The current state of the audit trail.
- status String
- The current sub-state of the audit trail..
- target
Id String - A filter to return only items related to a specific target OCID.
- location string
- The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
- state string
- The current state of the audit trail.
- status string
- The current sub-state of the audit trail..
- target
Id string - A filter to return only items related to a specific target OCID.
- location str
- The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
- state str
- The current state of the audit trail.
- status str
- The current sub-state of the audit trail..
- target_
id str - A filter to return only items related to a specific target OCID.
- location String
- The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
- state String
- The current state of the audit trail.
- status String
- The current sub-state of the audit trail..
- target
Id String - A filter to return only items related to a specific target OCID.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.