1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. getAuditing
MongoDB Atlas v3.30.0 published on Friday, Mar 21, 2025 by Pulumi

mongodbatlas.getAuditing

Explore with Pulumi AI

# Data Source: mongodbatlas.Auditing

mongodbatlas.Auditing describes a Auditing.

NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const testAuditing = new mongodbatlas.Auditing("test", {
    projectId: "<project-id>",
    auditFilter: "{ 'atype': 'authenticate', 'param': {   'user': 'auditAdmin',   'db': 'admin',   'mechanism': 'SCRAM-SHA-1' }}",
    auditAuthorizationSuccess: false,
    enabled: true,
});
const test = mongodbatlas.getAuditingOutput({
    projectId: testAuditing.id,
});
Copy
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test_auditing = mongodbatlas.Auditing("test",
    project_id="<project-id>",
    audit_filter="{ 'atype': 'authenticate', 'param': {   'user': 'auditAdmin',   'db': 'admin',   'mechanism': 'SCRAM-SHA-1' }}",
    audit_authorization_success=False,
    enabled=True)
test = mongodbatlas.get_auditing_output(project_id=test_auditing.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testAuditing, err := mongodbatlas.NewAuditing(ctx, "test", &mongodbatlas.AuditingArgs{
			ProjectId:                 pulumi.String("<project-id>"),
			AuditFilter:               pulumi.String("{ 'atype': 'authenticate', 'param': {   'user': 'auditAdmin',   'db': 'admin',   'mechanism': 'SCRAM-SHA-1' }}"),
			AuditAuthorizationSuccess: pulumi.Bool(false),
			Enabled:                   pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_ = mongodbatlas.LookupAuditingOutput(ctx, mongodbatlas.GetAuditingOutputArgs{
			ProjectId: testAuditing.ID(),
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var testAuditing = new Mongodbatlas.Auditing("test", new()
    {
        ProjectId = "<project-id>",
        AuditFilter = "{ 'atype': 'authenticate', 'param': {   'user': 'auditAdmin',   'db': 'admin',   'mechanism': 'SCRAM-SHA-1' }}",
        AuditAuthorizationSuccess = false,
        Enabled = true,
    });

    var test = Mongodbatlas.GetAuditing.Invoke(new()
    {
        ProjectId = testAuditing.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.Auditing;
import com.pulumi.mongodbatlas.AuditingArgs;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetAuditingArgs;
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) {
        var testAuditing = new Auditing("testAuditing", AuditingArgs.builder()
            .projectId("<project-id>")
            .auditFilter("{ 'atype': 'authenticate', 'param': {   'user': 'auditAdmin',   'db': 'admin',   'mechanism': 'SCRAM-SHA-1' }}")
            .auditAuthorizationSuccess(false)
            .enabled(true)
            .build());

        final var test = MongodbatlasFunctions.getAuditing(GetAuditingArgs.builder()
            .projectId(testAuditing.id())
            .build());

    }
}
Copy
resources:
  testAuditing:
    type: mongodbatlas:Auditing
    name: test
    properties:
      projectId: <project-id>
      auditFilter: '{ ''atype'': ''authenticate'', ''param'': {   ''user'': ''auditAdmin'',   ''db'': ''admin'',   ''mechanism'': ''SCRAM-SHA-1'' }}'
      auditAuthorizationSuccess: false
      enabled: true
variables:
  test:
    fn::invoke:
      function: mongodbatlas:getAuditing
      arguments:
        projectId: ${testAuditing.id}
Copy

Using getAuditing

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 getAuditing(args: GetAuditingArgs, opts?: InvokeOptions): Promise<GetAuditingResult>
function getAuditingOutput(args: GetAuditingOutputArgs, opts?: InvokeOptions): Output<GetAuditingResult>
Copy
def get_auditing(project_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetAuditingResult
def get_auditing_output(project_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetAuditingResult]
Copy
func LookupAuditing(ctx *Context, args *LookupAuditingArgs, opts ...InvokeOption) (*LookupAuditingResult, error)
func LookupAuditingOutput(ctx *Context, args *LookupAuditingOutputArgs, opts ...InvokeOption) LookupAuditingResultOutput
Copy

> Note: This function is named LookupAuditing in the Go SDK.

public static class GetAuditing 
{
    public static Task<GetAuditingResult> InvokeAsync(GetAuditingArgs args, InvokeOptions? opts = null)
    public static Output<GetAuditingResult> Invoke(GetAuditingInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAuditingResult> getAuditing(GetAuditingArgs args, InvokeOptions options)
public static Output<GetAuditingResult> getAuditing(GetAuditingArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: mongodbatlas:index/getAuditing:getAuditing
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ProjectId This property is required. string
The unique ID for the project.
ProjectId This property is required. string
The unique ID for the project.
projectId This property is required. String
The unique ID for the project.
projectId This property is required. string
The unique ID for the project.
project_id This property is required. str
The unique ID for the project.
projectId This property is required. String
The unique ID for the project.

getAuditing Result

The following output properties are available:

AuditAuthorizationSuccess bool
JSON-formatted audit filter used by the project
AuditFilter string
Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess
ConfigurationType string
Denotes the configuration method for the audit filter. Possible values are: NONE - auditing not configured for the project.m FILTER_BUILDER - auditing configured via Atlas UI filter builderm FILTER_JSON - auditing configured via Atlas custom filter or API.
Enabled bool
Denotes whether or not the project associated with the {GROUP-ID} has database auditing enabled.
Id string
The provider-assigned unique ID for this managed resource.
ProjectId string
AuditAuthorizationSuccess bool
JSON-formatted audit filter used by the project
AuditFilter string
Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess
ConfigurationType string
Denotes the configuration method for the audit filter. Possible values are: NONE - auditing not configured for the project.m FILTER_BUILDER - auditing configured via Atlas UI filter builderm FILTER_JSON - auditing configured via Atlas custom filter or API.
Enabled bool
Denotes whether or not the project associated with the {GROUP-ID} has database auditing enabled.
Id string
The provider-assigned unique ID for this managed resource.
ProjectId string
auditAuthorizationSuccess Boolean
JSON-formatted audit filter used by the project
auditFilter String
Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess
configurationType String
Denotes the configuration method for the audit filter. Possible values are: NONE - auditing not configured for the project.m FILTER_BUILDER - auditing configured via Atlas UI filter builderm FILTER_JSON - auditing configured via Atlas custom filter or API.
enabled Boolean
Denotes whether or not the project associated with the {GROUP-ID} has database auditing enabled.
id String
The provider-assigned unique ID for this managed resource.
projectId String
auditAuthorizationSuccess boolean
JSON-formatted audit filter used by the project
auditFilter string
Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess
configurationType string
Denotes the configuration method for the audit filter. Possible values are: NONE - auditing not configured for the project.m FILTER_BUILDER - auditing configured via Atlas UI filter builderm FILTER_JSON - auditing configured via Atlas custom filter or API.
enabled boolean
Denotes whether or not the project associated with the {GROUP-ID} has database auditing enabled.
id string
The provider-assigned unique ID for this managed resource.
projectId string
audit_authorization_success bool
JSON-formatted audit filter used by the project
audit_filter str
Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess
configuration_type str
Denotes the configuration method for the audit filter. Possible values are: NONE - auditing not configured for the project.m FILTER_BUILDER - auditing configured via Atlas UI filter builderm FILTER_JSON - auditing configured via Atlas custom filter or API.
enabled bool
Denotes whether or not the project associated with the {GROUP-ID} has database auditing enabled.
id str
The provider-assigned unique ID for this managed resource.
project_id str
auditAuthorizationSuccess Boolean
JSON-formatted audit filter used by the project
auditFilter String
Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess
configurationType String
Denotes the configuration method for the audit filter. Possible values are: NONE - auditing not configured for the project.m FILTER_BUILDER - auditing configured via Atlas UI filter builderm FILTER_JSON - auditing configured via Atlas custom filter or API.
enabled Boolean
Denotes whether or not the project associated with the {GROUP-ID} has database auditing enabled.
id String
The provider-assigned unique ID for this managed resource.
projectId String

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes
This Pulumi package is based on the mongodbatlas Terraform Provider.