Oracle Cloud Infrastructure

v0.5.0 published on Monday, Sep 12, 2022 by Pulumi

getAuditTrailAnalytic

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

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testAuditTrailAnalytic = Oci.DataSafe.GetAuditTrailAnalytic.Invoke(new()
    {
        CompartmentId = @var.Compartment_id,
        AccessLevel = @var.Audit_trail_analytic_access_level,
        CompartmentIdInSubtree = @var.Audit_trail_analytic_compartment_id_in_subtree,
        GroupBies = @var.Audit_trail_analytic_group_by,
        TargetId = oci_cloud_guard_target.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:          _var.Compartment_id,
			AccessLevel:            pulumi.StringRef(_var.Audit_trail_analytic_access_level),
			CompartmentIdInSubtree: pulumi.BoolRef(_var.Audit_trail_analytic_compartment_id_in_subtree),
			GroupBies:              _var.Audit_trail_analytic_group_by,
			TargetId:               pulumi.StringRef(oci_cloud_guard_target.Test_target.Id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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(var_.compartment_id())
            .accessLevel(var_.audit_trail_analytic_access_level())
            .compartmentIdInSubtree(var_.audit_trail_analytic_compartment_id_in_subtree())
            .groupBies(var_.audit_trail_analytic_group_by())
            .targetId(oci_cloud_guard_target.test_target().id())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_audit_trail_analytic = oci.DataSafe.get_audit_trail_analytic(compartment_id=var["compartment_id"],
    access_level=var["audit_trail_analytic_access_level"],
    compartment_id_in_subtree=var["audit_trail_analytic_compartment_id_in_subtree"],
    group_bies=var["audit_trail_analytic_group_by"],
    target_id=oci_cloud_guard_target["test_target"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testAuditTrailAnalytic = oci.DataSafe.getAuditTrailAnalytic({
    compartmentId: _var.compartment_id,
    accessLevel: _var.audit_trail_analytic_access_level,
    compartmentIdInSubtree: _var.audit_trail_analytic_compartment_id_in_subtree,
    groupBies: _var.audit_trail_analytic_group_by,
    targetId: oci_cloud_guard_target.test_target.id,
});
variables:
  testAuditTrailAnalytic:
    Fn::Invoke:
      Function: oci:DataSafe:getAuditTrailAnalytic
      Arguments:
        compartmentId: ${var.compartment_id}
        accessLevel: ${var.audit_trail_analytic_access_level}
        compartmentIdInSubtree: ${var.audit_trail_analytic_compartment_id_in_subtree}
        groupBies: ${var.audit_trail_analytic_group_by}
        targetId: ${oci_cloud_guard_target.test_target.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:

CompartmentId string

A filter to return only resources that match the specified compartment OCID.

AccessLevel 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.

CompartmentIdInSubtree bool

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.

GroupBies List<string>

The group by parameter for summarize operation on audit trail.

TargetId string

A filter to return only items related to a specific target OCID.

CompartmentId string

A filter to return only resources that match the specified compartment OCID.

AccessLevel 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.

CompartmentIdInSubtree bool

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.

GroupBies []string

The group by parameter for summarize operation on audit trail.

TargetId string

A filter to return only items related to a specific target OCID.

compartmentId String

A filter to return only resources that match the specified compartment OCID.

accessLevel 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.

compartmentIdInSubtree Boolean

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.

groupBies List<String>

The group by parameter for summarize operation on audit trail.

targetId String

A filter to return only items related to a specific target OCID.

compartmentId string

A filter to return only resources that match the specified compartment OCID.

accessLevel 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.

compartmentIdInSubtree boolean

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.

groupBies string[]

The group by parameter for summarize operation on audit trail.

targetId 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_in_subtree bool

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.

compartmentId String

A filter to return only resources that match the specified compartment OCID.

accessLevel 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.

compartmentIdInSubtree Boolean

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.

groupBies List<String>

The group by parameter for summarize operation on audit trail.

targetId String

A filter to return only items related to a specific target OCID.

getAuditTrailAnalytic Result

The following output properties are available:

CompartmentId string
Id string

The provider-assigned unique ID for this managed resource.

Items List<GetAuditTrailAnalyticItem>

Array of audit trail aggregration data.

AccessLevel string
CompartmentIdInSubtree bool
GroupBies List<string>
TargetId string

The OCID of the Data Safe target for which the audit trail is created.

CompartmentId string
Id string

The provider-assigned unique ID for this managed resource.

Items []GetAuditTrailAnalyticItem

Array of audit trail aggregration data.

AccessLevel string
CompartmentIdInSubtree bool
GroupBies []string
TargetId string

The OCID of the Data Safe target for which the audit trail is created.

compartmentId String
id String

The provider-assigned unique ID for this managed resource.

items List<GetAuditTrailAnalyticItem>

Array of audit trail aggregration data.

accessLevel String
compartmentIdInSubtree Boolean
groupBies List<String>
targetId String

The OCID of the Data Safe target for which the audit trail is created.

compartmentId string
id string

The provider-assigned unique ID for this managed resource.

items GetAuditTrailAnalyticItem[]

Array of audit trail aggregration data.

accessLevel string
compartmentIdInSubtree boolean
groupBies string[]
targetId 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 GetAuditTrailAnalyticItem]

Array of audit trail aggregration data.

access_level str
compartment_id_in_subtree bool
group_bies Sequence[str]
target_id str

The OCID of the Data Safe target for which the audit trail is created.

compartmentId String
id String

The provider-assigned unique ID for this managed resource.

items List<Property Map>

Array of audit trail aggregration data.

accessLevel String
compartmentIdInSubtree Boolean
groupBies List<String>
targetId 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<GetAuditTrailAnalyticItemDimension>

Details of aggregation dimensions used for summarizing audit trails.

Count string

Total count of aggregated metric.

Dimensions []GetAuditTrailAnalyticItemDimension

Details of aggregation dimensions used for summarizing audit trails.

count String

Total count of aggregated metric.

dimensions List<GetAuditTrailAnalyticItemDimension>

Details of aggregation dimensions used for summarizing audit trails.

count string

Total count of aggregated metric.

dimensions GetAuditTrailAnalyticItemDimension[]

Details of aggregation dimensions used for summarizing audit trails.

count str

Total count of aggregated metric.

dimensions GetAuditTrailAnalyticItemDimension]

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..

TargetId 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..

TargetId 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..

targetId 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..

targetId 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..

targetId String

A filter to return only items related to a specific target OCID.

Package Details

Repository
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.