mongodbatlas.Auditing
Explore with Pulumi AI
# Resource: mongodbatlas.Auditing
mongodbatlas.Auditing
provides an Auditing resource. This allows auditing to be created.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.Auditing("test", {
projectId: "<project-id>",
auditFilter: "{ 'atype': 'authenticate', 'param': { 'user': 'auditAdmin', 'db': 'admin', 'mechanism': 'SCRAM-SHA-1' }}",
auditAuthorizationSuccess: false,
enabled: true,
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = 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)
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 {
_, 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
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var test = new Mongodbatlas.Auditing("test", new()
{
ProjectId = "<project-id>",
AuditFilter = "{ 'atype': 'authenticate', 'param': { 'user': 'auditAdmin', 'db': 'admin', 'mechanism': 'SCRAM-SHA-1' }}",
AuditAuthorizationSuccess = false,
Enabled = true,
});
});
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 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 test = new Auditing("test", AuditingArgs.builder()
.projectId("<project-id>")
.auditFilter("{ 'atype': 'authenticate', 'param': { 'user': 'auditAdmin', 'db': 'admin', 'mechanism': 'SCRAM-SHA-1' }}")
.auditAuthorizationSuccess(false)
.enabled(true)
.build());
}
}
resources:
test:
type: mongodbatlas:Auditing
properties:
projectId: <project-id>
auditFilter: '{ ''atype'': ''authenticate'', ''param'': { ''user'': ''auditAdmin'', ''db'': ''admin'', ''mechanism'': ''SCRAM-SHA-1'' }}'
auditAuthorizationSuccess: false
enabled: true
Create Auditing Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Auditing(name: string, args: AuditingArgs, opts?: CustomResourceOptions);
@overload
def Auditing(resource_name: str,
args: AuditingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Auditing(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
audit_authorization_success: Optional[bool] = None,
audit_filter: Optional[str] = None,
enabled: Optional[bool] = None)
func NewAuditing(ctx *Context, name string, args AuditingArgs, opts ...ResourceOption) (*Auditing, error)
public Auditing(string name, AuditingArgs args, CustomResourceOptions? opts = null)
public Auditing(String name, AuditingArgs args)
public Auditing(String name, AuditingArgs args, CustomResourceOptions options)
type: mongodbatlas:Auditing
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AuditingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AuditingArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AuditingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AuditingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AuditingArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var auditingResource = new Mongodbatlas.Auditing("auditingResource", new()
{
ProjectId = "string",
AuditAuthorizationSuccess = false,
AuditFilter = "string",
Enabled = false,
});
example, err := mongodbatlas.NewAuditing(ctx, "auditingResource", &mongodbatlas.AuditingArgs{
ProjectId: pulumi.String("string"),
AuditAuthorizationSuccess: pulumi.Bool(false),
AuditFilter: pulumi.String("string"),
Enabled: pulumi.Bool(false),
})
var auditingResource = new Auditing("auditingResource", AuditingArgs.builder()
.projectId("string")
.auditAuthorizationSuccess(false)
.auditFilter("string")
.enabled(false)
.build());
auditing_resource = mongodbatlas.Auditing("auditingResource",
project_id="string",
audit_authorization_success=False,
audit_filter="string",
enabled=False)
const auditingResource = new mongodbatlas.Auditing("auditingResource", {
projectId: "string",
auditAuthorizationSuccess: false,
auditFilter: "string",
enabled: false,
});
type: mongodbatlas:Auditing
properties:
auditAuthorizationSuccess: false
auditFilter: string
enabled: false
projectId: string
Auditing Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Auditing resource accepts the following input properties:
- Project
Id string - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- bool
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- Audit
Filter string - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- Enabled bool
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- Project
Id string - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- bool
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- Audit
Filter string - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- Enabled bool
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- project
Id String - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- Boolean
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- audit
Filter String - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- enabled Boolean
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- project
Id string - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- boolean
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- audit
Filter string - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- enabled boolean
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- project_
id str - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- bool
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- audit_
filter str - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- enabled bool
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- project
Id String - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- Boolean
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- audit
Filter String - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- enabled Boolean
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
Outputs
All input properties are implicitly available as output properties. Additionally, the Auditing resource produces the following output properties:
- Configuration
Type string - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- Id string
- The provider-assigned unique ID for this managed resource.
- Configuration
Type string - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- Id string
- The provider-assigned unique ID for this managed resource.
- configuration
Type String - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- id String
- The provider-assigned unique ID for this managed resource.
- configuration
Type string - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- id string
- The provider-assigned unique ID for this managed resource.
- configuration_
type str - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- id str
- The provider-assigned unique ID for this managed resource.
- configuration
Type String - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Auditing Resource
Get an existing Auditing resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AuditingState, opts?: CustomResourceOptions): Auditing
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
audit_authorization_success: Optional[bool] = None,
audit_filter: Optional[str] = None,
configuration_type: Optional[str] = None,
enabled: Optional[bool] = None,
project_id: Optional[str] = None) -> Auditing
func GetAuditing(ctx *Context, name string, id IDInput, state *AuditingState, opts ...ResourceOption) (*Auditing, error)
public static Auditing Get(string name, Input<string> id, AuditingState? state, CustomResourceOptions? opts = null)
public static Auditing get(String name, Output<String> id, AuditingState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- bool
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- Audit
Filter string - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- Configuration
Type string - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- Enabled bool
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- Project
Id string - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- bool
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- Audit
Filter string - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- Configuration
Type string - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- Enabled bool
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- Project
Id string - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- Boolean
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- audit
Filter String - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- configuration
Type String - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- enabled Boolean
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- project
Id String - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- boolean
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- audit
Filter string - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- configuration
Type string - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- enabled boolean
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- project
Id string - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- bool
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- audit_
filter str - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- configuration_
type str - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- enabled bool
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- project_
id str - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
- Boolean
- Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess. Warning! Enabling Audit authorization successes can severely impact cluster performance. Enable this option with caution.
- audit
Filter String - JSON-formatted audit filter. For complete documentation on custom auditing filters, see Configure Audit Filters.
- configuration
Type String - Denotes the configuration method for the audit filter. Possible values are:
- NONE - auditing not configured for the project.
- FILTER_BUILDER - auditing configured via Atlas UI filter builder.
- FILTER_JSON - auditing configured via Atlas custom filter or API.
- enabled Boolean
Denotes whether or not the project associated with the {project_id} has database auditing enabled. Defaults to false.
NOTE: Auditing created by API Keys must belong to an existing organization.
- project
Id String - The unique ID for the project to configure auditing. Note: When changing this value to a different project_id it will delete the current audit settings for the original project that was assigned to.
Import
Auditing must be imported using auditing ID, e.g.
$ pulumi import mongodbatlas:index/auditing:Auditing my_auditing 5d09d6a59ccf6445652a444a
For more information see: MongoDB Atlas API Reference.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlas
Terraform Provider.