published on Monday, Jun 15, 2026 by tencentcloudstack
published on Monday, Jun 15, 2026 by tencentcloudstack
Provides a resource to create a MongoDB audit log file
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.MongodbAuditLogFile("example", {
instanceId: "cmgo-5aqo4yf7",
startTime: "2026-06-01 10:29:20",
endTime: "2026-06-01 10:39:20",
order: "ASC",
orderBy: "timestamp",
filter: {
hosts: ["10.0.0.1"],
users: ["admin"],
execTime: 100,
affectRows: 10,
atypes: [
"insert",
"update",
],
results: ["ok"],
params: ["keyword"],
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.MongodbAuditLogFile("example",
instance_id="cmgo-5aqo4yf7",
start_time="2026-06-01 10:29:20",
end_time="2026-06-01 10:39:20",
order="ASC",
order_by="timestamp",
filter={
"hosts": ["10.0.0.1"],
"users": ["admin"],
"exec_time": 100,
"affect_rows": 10,
"atypes": [
"insert",
"update",
],
"results": ["ok"],
"params": ["keyword"],
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewMongodbAuditLogFile(ctx, "example", &tencentcloud.MongodbAuditLogFileArgs{
InstanceId: pulumi.String("cmgo-5aqo4yf7"),
StartTime: pulumi.String("2026-06-01 10:29:20"),
EndTime: pulumi.String("2026-06-01 10:39:20"),
Order: pulumi.String("ASC"),
OrderBy: pulumi.String("timestamp"),
Filter: &tencentcloud.MongodbAuditLogFileFilterArgs{
Hosts: pulumi.StringArray{
pulumi.String("10.0.0.1"),
},
Users: pulumi.StringArray{
pulumi.String("admin"),
},
ExecTime: pulumi.Float64(100),
AffectRows: pulumi.Float64(10),
Atypes: pulumi.StringArray{
pulumi.String("insert"),
pulumi.String("update"),
},
Results: pulumi.StringArray{
pulumi.String("ok"),
},
Params: pulumi.StringArray{
pulumi.String("keyword"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.MongodbAuditLogFile("example", new()
{
InstanceId = "cmgo-5aqo4yf7",
StartTime = "2026-06-01 10:29:20",
EndTime = "2026-06-01 10:39:20",
Order = "ASC",
OrderBy = "timestamp",
Filter = new Tencentcloud.Inputs.MongodbAuditLogFileFilterArgs
{
Hosts = new[]
{
"10.0.0.1",
},
Users = new[]
{
"admin",
},
ExecTime = 100,
AffectRows = 10,
Atypes = new[]
{
"insert",
"update",
},
Results = new[]
{
"ok",
},
Params = new[]
{
"keyword",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.MongodbAuditLogFile;
import com.pulumi.tencentcloud.MongodbAuditLogFileArgs;
import com.pulumi.tencentcloud.inputs.MongodbAuditLogFileFilterArgs;
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 example = new MongodbAuditLogFile("example", MongodbAuditLogFileArgs.builder()
.instanceId("cmgo-5aqo4yf7")
.startTime("2026-06-01 10:29:20")
.endTime("2026-06-01 10:39:20")
.order("ASC")
.orderBy("timestamp")
.filter(MongodbAuditLogFileFilterArgs.builder()
.hosts("10.0.0.1")
.users("admin")
.execTime(100.0)
.affectRows(10.0)
.atypes(
"insert",
"update")
.results("ok")
.params("keyword")
.build())
.build());
}
}
resources:
example:
type: tencentcloud:MongodbAuditLogFile
properties:
instanceId: cmgo-5aqo4yf7
startTime: 2026-06-01 10:29:20
endTime: 2026-06-01 10:39:20
order: ASC
orderBy: timestamp
filter:
hosts:
- 10.0.0.1
users:
- admin
execTime: 100
affectRows: 10
atypes:
- insert
- update
results:
- ok
params:
- keyword
Example coming soon!
Create MongodbAuditLogFile Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MongodbAuditLogFile(name: string, args: MongodbAuditLogFileArgs, opts?: CustomResourceOptions);@overload
def MongodbAuditLogFile(resource_name: str,
args: MongodbAuditLogFileArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MongodbAuditLogFile(resource_name: str,
opts: Optional[ResourceOptions] = None,
end_time: Optional[str] = None,
instance_id: Optional[str] = None,
start_time: Optional[str] = None,
filter: Optional[MongodbAuditLogFileFilterArgs] = None,
mongodb_audit_log_file_id: Optional[str] = None,
order: Optional[str] = None,
order_by: Optional[str] = None)func NewMongodbAuditLogFile(ctx *Context, name string, args MongodbAuditLogFileArgs, opts ...ResourceOption) (*MongodbAuditLogFile, error)public MongodbAuditLogFile(string name, MongodbAuditLogFileArgs args, CustomResourceOptions? opts = null)
public MongodbAuditLogFile(String name, MongodbAuditLogFileArgs args)
public MongodbAuditLogFile(String name, MongodbAuditLogFileArgs args, CustomResourceOptions options)
type: tencentcloud:MongodbAuditLogFile
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "tencentcloud_mongodbauditlogfile" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args MongodbAuditLogFileArgs
- 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 MongodbAuditLogFileArgs
- 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 MongodbAuditLogFileArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MongodbAuditLogFileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MongodbAuditLogFileArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
MongodbAuditLogFile Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MongodbAuditLogFile resource accepts the following input properties:
- End
Time string - End time, format: "2021-07-12 10:39:20".
- Instance
Id string - Instance ID, the format is: cmgo-xfts****.
- Start
Time string - Start time, format: "2021-07-12 10:29:20".
- Filter
Mongodb
Audit Log File Filter - Filter conditions.
- Mongodb
Audit stringLog File Id - ID of the resource.
- Order string
- Sort order. Valid values:
ASC,DESC. - Order
By string - Sort field. Valid values:
timestamp,affectRows,execTime.
- End
Time string - End time, format: "2021-07-12 10:39:20".
- Instance
Id string - Instance ID, the format is: cmgo-xfts****.
- Start
Time string - Start time, format: "2021-07-12 10:29:20".
- Filter
Mongodb
Audit Log File Filter Args - Filter conditions.
- Mongodb
Audit stringLog File Id - ID of the resource.
- Order string
- Sort order. Valid values:
ASC,DESC. - Order
By string - Sort field. Valid values:
timestamp,affectRows,execTime.
- end_
time string - End time, format: "2021-07-12 10:39:20".
- instance_
id string - Instance ID, the format is: cmgo-xfts****.
- start_
time string - Start time, format: "2021-07-12 10:29:20".
- filter object
- Filter conditions.
- mongodb_
audit_ stringlog_ file_ id - ID of the resource.
- order string
- Sort order. Valid values:
ASC,DESC. - order_
by string - Sort field. Valid values:
timestamp,affectRows,execTime.
- end
Time String - End time, format: "2021-07-12 10:39:20".
- instance
Id String - Instance ID, the format is: cmgo-xfts****.
- start
Time String - Start time, format: "2021-07-12 10:29:20".
- filter
Mongodb
Audit Log File Filter - Filter conditions.
- mongodb
Audit StringLog File Id - ID of the resource.
- order String
- Sort order. Valid values:
ASC,DESC. - order
By String - Sort field. Valid values:
timestamp,affectRows,execTime.
- end
Time string - End time, format: "2021-07-12 10:39:20".
- instance
Id string - Instance ID, the format is: cmgo-xfts****.
- start
Time string - Start time, format: "2021-07-12 10:29:20".
- filter
Mongodb
Audit Log File Filter - Filter conditions.
- mongodb
Audit stringLog File Id - ID of the resource.
- order string
- Sort order. Valid values:
ASC,DESC. - order
By string - Sort field. Valid values:
timestamp,affectRows,execTime.
- end_
time str - End time, format: "2021-07-12 10:39:20".
- instance_
id str - Instance ID, the format is: cmgo-xfts****.
- start_
time str - Start time, format: "2021-07-12 10:29:20".
- filter
Mongodb
Audit Log File Filter Args - Filter conditions.
- mongodb_
audit_ strlog_ file_ id - ID of the resource.
- order str
- Sort order. Valid values:
ASC,DESC. - order_
by str - Sort field. Valid values:
timestamp,affectRows,execTime.
- end
Time String - End time, format: "2021-07-12 10:39:20".
- instance
Id String - Instance ID, the format is: cmgo-xfts****.
- start
Time String - Start time, format: "2021-07-12 10:29:20".
- filter Property Map
- Filter conditions.
- mongodb
Audit StringLog File Id - ID of the resource.
- order String
- Sort order. Valid values:
ASC,DESC. - order
By String - Sort field. Valid values:
timestamp,affectRows,execTime.
Outputs
All input properties are implicitly available as output properties. Additionally, the MongodbAuditLogFile resource produces the following output properties:
- File
Name string - File name.
- Id string
- The provider-assigned unique ID for this managed resource.
- Items
List<Mongodb
Audit Log File Item> - Audit log file details.
- File
Name string - File name.
- Id string
- The provider-assigned unique ID for this managed resource.
- Items
[]Mongodb
Audit Log File Item - Audit log file details.
- file_
name string - File name.
- id string
- The provider-assigned unique ID for this managed resource.
- items list(object)
- Audit log file details.
- file
Name String - File name.
- id String
- The provider-assigned unique ID for this managed resource.
- items
List<Mongodb
Audit Log File Item> - Audit log file details.
- file
Name string - File name.
- id string
- The provider-assigned unique ID for this managed resource.
- items
Mongodb
Audit Log File Item[] - Audit log file details.
- file_
name str - File name.
- id str
- The provider-assigned unique ID for this managed resource.
- items
Sequence[Mongodb
Audit Log File Item] - Audit log file details.
- file
Name String - File name.
- id String
- The provider-assigned unique ID for this managed resource.
- items List<Property Map>
- Audit log file details.
Look up Existing MongodbAuditLogFile Resource
Get an existing MongodbAuditLogFile 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?: MongodbAuditLogFileState, opts?: CustomResourceOptions): MongodbAuditLogFile@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
end_time: Optional[str] = None,
file_name: Optional[str] = None,
filter: Optional[MongodbAuditLogFileFilterArgs] = None,
instance_id: Optional[str] = None,
items: Optional[Sequence[MongodbAuditLogFileItemArgs]] = None,
mongodb_audit_log_file_id: Optional[str] = None,
order: Optional[str] = None,
order_by: Optional[str] = None,
start_time: Optional[str] = None) -> MongodbAuditLogFilefunc GetMongodbAuditLogFile(ctx *Context, name string, id IDInput, state *MongodbAuditLogFileState, opts ...ResourceOption) (*MongodbAuditLogFile, error)public static MongodbAuditLogFile Get(string name, Input<string> id, MongodbAuditLogFileState? state, CustomResourceOptions? opts = null)public static MongodbAuditLogFile get(String name, Output<String> id, MongodbAuditLogFileState state, CustomResourceOptions options)resources: _: type: tencentcloud:MongodbAuditLogFile get: id: ${id}import {
to = tencentcloud_mongodbauditlogfile.example
id = "${id}"
}
- 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.
- End
Time string - End time, format: "2021-07-12 10:39:20".
- File
Name string - File name.
- Filter
Mongodb
Audit Log File Filter - Filter conditions.
- Instance
Id string - Instance ID, the format is: cmgo-xfts****.
- Items
List<Mongodb
Audit Log File Item> - Audit log file details.
- Mongodb
Audit stringLog File Id - ID of the resource.
- Order string
- Sort order. Valid values:
ASC,DESC. - Order
By string - Sort field. Valid values:
timestamp,affectRows,execTime. - Start
Time string - Start time, format: "2021-07-12 10:29:20".
- End
Time string - End time, format: "2021-07-12 10:39:20".
- File
Name string - File name.
- Filter
Mongodb
Audit Log File Filter Args - Filter conditions.
- Instance
Id string - Instance ID, the format is: cmgo-xfts****.
- Items
[]Mongodb
Audit Log File Item Args - Audit log file details.
- Mongodb
Audit stringLog File Id - ID of the resource.
- Order string
- Sort order. Valid values:
ASC,DESC. - Order
By string - Sort field. Valid values:
timestamp,affectRows,execTime. - Start
Time string - Start time, format: "2021-07-12 10:29:20".
- end_
time string - End time, format: "2021-07-12 10:39:20".
- file_
name string - File name.
- filter object
- Filter conditions.
- instance_
id string - Instance ID, the format is: cmgo-xfts****.
- items list(object)
- Audit log file details.
- mongodb_
audit_ stringlog_ file_ id - ID of the resource.
- order string
- Sort order. Valid values:
ASC,DESC. - order_
by string - Sort field. Valid values:
timestamp,affectRows,execTime. - start_
time string - Start time, format: "2021-07-12 10:29:20".
- end
Time String - End time, format: "2021-07-12 10:39:20".
- file
Name String - File name.
- filter
Mongodb
Audit Log File Filter - Filter conditions.
- instance
Id String - Instance ID, the format is: cmgo-xfts****.
- items
List<Mongodb
Audit Log File Item> - Audit log file details.
- mongodb
Audit StringLog File Id - ID of the resource.
- order String
- Sort order. Valid values:
ASC,DESC. - order
By String - Sort field. Valid values:
timestamp,affectRows,execTime. - start
Time String - Start time, format: "2021-07-12 10:29:20".
- end
Time string - End time, format: "2021-07-12 10:39:20".
- file
Name string - File name.
- filter
Mongodb
Audit Log File Filter - Filter conditions.
- instance
Id string - Instance ID, the format is: cmgo-xfts****.
- items
Mongodb
Audit Log File Item[] - Audit log file details.
- mongodb
Audit stringLog File Id - ID of the resource.
- order string
- Sort order. Valid values:
ASC,DESC. - order
By string - Sort field. Valid values:
timestamp,affectRows,execTime. - start
Time string - Start time, format: "2021-07-12 10:29:20".
- end_
time str - End time, format: "2021-07-12 10:39:20".
- file_
name str - File name.
- filter
Mongodb
Audit Log File Filter Args - Filter conditions.
- instance_
id str - Instance ID, the format is: cmgo-xfts****.
- items
Sequence[Mongodb
Audit Log File Item Args] - Audit log file details.
- mongodb_
audit_ strlog_ file_ id - ID of the resource.
- order str
- Sort order. Valid values:
ASC,DESC. - order_
by str - Sort field. Valid values:
timestamp,affectRows,execTime. - start_
time str - Start time, format: "2021-07-12 10:29:20".
- end
Time String - End time, format: "2021-07-12 10:39:20".
- file
Name String - File name.
- filter Property Map
- Filter conditions.
- instance
Id String - Instance ID, the format is: cmgo-xfts****.
- items List<Property Map>
- Audit log file details.
- mongodb
Audit StringLog File Id - ID of the resource.
- order String
- Sort order. Valid values:
ASC,DESC. - order
By String - Sort field. Valid values:
timestamp,affectRows,execTime. - start
Time String - Start time, format: "2021-07-12 10:29:20".
Supporting Types
MongodbAuditLogFileFilter, MongodbAuditLogFileFilterArgs
MongodbAuditLogFileItem, MongodbAuditLogFileItemArgs
- Create
Time string - Creation time.
- Download
Url string - Download URL.
- Err
Msg string - Error message.
- File
Name string - File name.
- File
Size double - File size in KB.
- Progress
Rate double - Download progress.
- Status string
- File status. Valid values:
creating,failed,success.
- Create
Time string - Creation time.
- Download
Url string - Download URL.
- Err
Msg string - Error message.
- File
Name string - File name.
- File
Size float64 - File size in KB.
- Progress
Rate float64 - Download progress.
- Status string
- File status. Valid values:
creating,failed,success.
- create_
time string - Creation time.
- download_
url string - Download URL.
- err_
msg string - Error message.
- file_
name string - File name.
- file_
size number - File size in KB.
- progress_
rate number - Download progress.
- status string
- File status. Valid values:
creating,failed,success.
- create
Time String - Creation time.
- download
Url String - Download URL.
- err
Msg String - Error message.
- file
Name String - File name.
- file
Size Double - File size in KB.
- progress
Rate Double - Download progress.
- status String
- File status. Valid values:
creating,failed,success.
- create
Time string - Creation time.
- download
Url string - Download URL.
- err
Msg string - Error message.
- file
Name string - File name.
- file
Size number - File size in KB.
- progress
Rate number - Download progress.
- status string
- File status. Valid values:
creating,failed,success.
- create_
time str - Creation time.
- download_
url str - Download URL.
- err_
msg str - Error message.
- file_
name str - File name.
- file_
size float - File size in KB.
- progress_
rate float - Download progress.
- status str
- File status. Valid values:
creating,failed,success.
- create
Time String - Creation time.
- download
Url String - Download URL.
- err
Msg String - Error message.
- file
Name String - File name.
- file
Size Number - File size in KB.
- progress
Rate Number - Download progress.
- status String
- File status. Valid values:
creating,failed,success.
Import
mongodb audit_log_file can be imported using the composite instance_id#file_name, e.g.
$ pulumi import tencentcloud:index/mongodbAuditLogFile:MongodbAuditLogFile example cmgo-5aqo4yf7#1309118522_cmgo-5aqo4yf7_1780474413_109642711.csv
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
published on Monday, Jun 15, 2026 by tencentcloudstack