published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Provides a Mongodb Sharding Audit Filter resource.
For information about Mongodb Sharding Audit Filter and how to use it, see ModifyAuditLogFilter.
NOTE: Available since v1.290.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = alicloud.mongodb.getZones({});
const defaultGetNetworks = alicloud.vpc.getNetworks({
nameRegex: "^default-NODELETING$",
});
const defaultGetSwitches = Promise.all([defaultGetNetworks, _default]).then(([defaultGetNetworks, _default]) => alicloud.vpc.getSwitches({
vpcId: defaultGetNetworks.ids?.[0],
zoneId: _default.zones?.[0]?.id,
}));
const defaultShardingInstance = new alicloud.mongodb.ShardingInstance("default", {
zoneId: _default.then(_default => _default.zones?.[0]?.id),
vswitchId: defaultGetSwitches.then(defaultGetSwitches => defaultGetSwitches.ids?.[0]),
engineVersion: "4.2",
name: name,
mongoLists: [
{
nodeClass: "dds.mongos.mid",
},
{
nodeClass: "dds.mongos.mid",
},
],
shardLists: [
{
nodeClass: "dds.shard.mid",
nodeStorage: 10,
},
{
nodeClass: "dds.shard.mid",
nodeStorage: 10,
},
],
});
const defaultShardingAuditFilter = new alicloud.mongodb.ShardingAuditFilter("default", {
dbInstanceId: defaultShardingInstance.id,
auditStatus: "enable",
filter: "admin,slow",
serviceType: "V2_Standard",
storagePeriod: 30,
hotStoragePeriod: 7,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.mongodb.get_zones()
default_get_networks = alicloud.vpc.get_networks(name_regex="^default-NODELETING$")
default_get_switches = alicloud.vpc.get_switches(vpc_id=default_get_networks.ids[0],
zone_id=default.zones[0].id)
default_sharding_instance = alicloud.mongodb.ShardingInstance("default",
zone_id=default.zones[0].id,
vswitch_id=default_get_switches.ids[0],
engine_version="4.2",
name=name,
mongo_lists=[
{
"node_class": "dds.mongos.mid",
},
{
"node_class": "dds.mongos.mid",
},
],
shard_lists=[
{
"node_class": "dds.shard.mid",
"node_storage": 10,
},
{
"node_class": "dds.shard.mid",
"node_storage": 10,
},
])
default_sharding_audit_filter = alicloud.mongodb.ShardingAuditFilter("default",
db_instance_id=default_sharding_instance.id,
audit_status="enable",
filter="admin,slow",
service_type="V2_Standard",
storage_period=30,
hot_storage_period=7)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mongodb"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := mongodb.GetZones(ctx, &mongodb.GetZonesArgs{}, nil)
if err != nil {
return err
}
defaultGetNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
NameRegex: pulumi.StringRef("^default-NODELETING$"),
}, nil)
if err != nil {
return err
}
defaultGetSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
VpcId: pulumi.StringRef(defaultGetNetworks.Ids[0]),
ZoneId: pulumi.StringRef(_default.Zones[0].Id),
}, nil)
if err != nil {
return err
}
defaultShardingInstance, err := mongodb.NewShardingInstance(ctx, "default", &mongodb.ShardingInstanceArgs{
ZoneId: pulumi.String(_default.Zones[0].Id),
VswitchId: pulumi.String(defaultGetSwitches.Ids[0]),
EngineVersion: pulumi.String("4.2"),
Name: pulumi.String(name),
MongoLists: mongodb.ShardingInstanceMongoListArray{
&mongodb.ShardingInstanceMongoListArgs{
NodeClass: pulumi.String("dds.mongos.mid"),
},
&mongodb.ShardingInstanceMongoListArgs{
NodeClass: pulumi.String("dds.mongos.mid"),
},
},
ShardLists: mongodb.ShardingInstanceShardListArray{
&mongodb.ShardingInstanceShardListArgs{
NodeClass: pulumi.String("dds.shard.mid"),
NodeStorage: pulumi.Int(10),
},
&mongodb.ShardingInstanceShardListArgs{
NodeClass: pulumi.String("dds.shard.mid"),
NodeStorage: pulumi.Int(10),
},
},
})
if err != nil {
return err
}
_, err = mongodb.NewShardingAuditFilter(ctx, "default", &mongodb.ShardingAuditFilterArgs{
DbInstanceId: defaultShardingInstance.ID().ToIDOutput().ToStringOutput(),
AuditStatus: pulumi.String("enable"),
Filter: pulumi.String("admin,slow"),
ServiceType: pulumi.String("V2_Standard"),
StoragePeriod: pulumi.Int(30),
HotStoragePeriod: pulumi.Int(7),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = AliCloud.MongoDB.GetZones.Invoke();
var defaultGetNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
{
NameRegex = "^default-NODELETING$",
});
var defaultGetSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
{
VpcId = defaultGetNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
ZoneId = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
var defaultShardingInstance = new AliCloud.MongoDB.ShardingInstance("default", new()
{
ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
VswitchId = defaultGetSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
EngineVersion = "4.2",
Name = name,
MongoLists = new[]
{
new AliCloud.MongoDB.Inputs.ShardingInstanceMongoListArgs
{
NodeClass = "dds.mongos.mid",
},
new AliCloud.MongoDB.Inputs.ShardingInstanceMongoListArgs
{
NodeClass = "dds.mongos.mid",
},
},
ShardLists = new[]
{
new AliCloud.MongoDB.Inputs.ShardingInstanceShardListArgs
{
NodeClass = "dds.shard.mid",
NodeStorage = 10,
},
new AliCloud.MongoDB.Inputs.ShardingInstanceShardListArgs
{
NodeClass = "dds.shard.mid",
NodeStorage = 10,
},
},
});
var defaultShardingAuditFilter = new AliCloud.MongoDB.ShardingAuditFilter("default", new()
{
DbInstanceId = defaultShardingInstance.Id,
AuditStatus = "enable",
Filter = "admin,slow",
ServiceType = "V2_Standard",
StoragePeriod = 30,
HotStoragePeriod = 7,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.mongodb.MongodbFunctions;
import com.pulumi.alicloud.mongodb.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
import com.pulumi.alicloud.mongodb.ShardingInstance;
import com.pulumi.alicloud.mongodb.ShardingInstanceArgs;
import com.pulumi.alicloud.mongodb.inputs.ShardingInstanceMongoListArgs;
import com.pulumi.alicloud.mongodb.inputs.ShardingInstanceShardListArgs;
import com.pulumi.alicloud.mongodb.ShardingAuditFilter;
import com.pulumi.alicloud.mongodb.ShardingAuditFilterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var default = MongodbFunctions.getZones(GetZonesArgs.builder()
.build());
final var defaultGetNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
.nameRegex("^default-NODELETING$")
.build());
final var defaultGetSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
.vpcId(defaultGetNetworks.ids()[0])
.zoneId(default_.zones()[0].id())
.build());
var defaultShardingInstance = new ShardingInstance("defaultShardingInstance", ShardingInstanceArgs.builder()
.zoneId(default_.zones()[0].id())
.vswitchId(defaultGetSwitches.ids()[0])
.engineVersion("4.2")
.name(name)
.mongoLists(
ShardingInstanceMongoListArgs.builder()
.nodeClass("dds.mongos.mid")
.build(),
ShardingInstanceMongoListArgs.builder()
.nodeClass("dds.mongos.mid")
.build())
.shardLists(
ShardingInstanceShardListArgs.builder()
.nodeClass("dds.shard.mid")
.nodeStorage(10)
.build(),
ShardingInstanceShardListArgs.builder()
.nodeClass("dds.shard.mid")
.nodeStorage(10)
.build())
.build());
var defaultShardingAuditFilter = new ShardingAuditFilter("defaultShardingAuditFilter", ShardingAuditFilterArgs.builder()
.dbInstanceId(defaultShardingInstance.id())
.auditStatus("enable")
.filter("admin,slow")
.serviceType("V2_Standard")
.storagePeriod(30)
.hotStoragePeriod(7)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultShardingInstance:
type: alicloud:mongodb:ShardingInstance
name: default
properties:
zoneId: ${default.zones[0].id}
vswitchId: ${defaultGetSwitches.ids[0]}
engineVersion: '4.2'
name: ${name}
mongoLists:
- nodeClass: dds.mongos.mid
- nodeClass: dds.mongos.mid
shardLists:
- nodeClass: dds.shard.mid
nodeStorage: 10
- nodeClass: dds.shard.mid
nodeStorage: 10
defaultShardingAuditFilter:
type: alicloud:mongodb:ShardingAuditFilter
name: default
properties:
dbInstanceId: ${defaultShardingInstance.id}
auditStatus: enable
filter: admin,slow
serviceType: V2_Standard
storagePeriod: 30
hotStoragePeriod: 7
variables:
default:
fn::invoke:
function: alicloud:mongodb:getZones
arguments: {}
defaultGetNetworks:
fn::invoke:
function: alicloud:vpc:getNetworks
arguments:
nameRegex: ^default-NODELETING$
defaultGetSwitches:
fn::invoke:
function: alicloud:vpc:getSwitches
arguments:
vpcId: ${defaultGetNetworks.ids[0]}
zoneId: ${default.zones[0].id}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_mongodb_getzones" "default" {
}
data "alicloud_vpc_getnetworks" "defaultGetNetworks" {
name_regex = "^default-NODELETING$"
}
data "alicloud_vpc_getswitches" "defaultGetSwitches" {
vpc_id = data.alicloud_vpc_getnetworks.defaultGetNetworks.ids[0]
zone_id = data.alicloud_mongodb_getzones.default.zones[0].id
}
resource "alicloud_mongodb_shardinginstance" "default" {
zone_id = data.alicloud_mongodb_getzones.default.zones[0].id
vswitch_id = data.alicloud_vpc_getswitches.defaultGetSwitches.ids[0]
engine_version = "4.2"
name = var.name
mongo_lists {
node_class = "dds.mongos.mid"
}
mongo_lists {
node_class = "dds.mongos.mid"
}
shard_lists {
node_class = "dds.shard.mid"
node_storage = 10
}
shard_lists {
node_class = "dds.shard.mid"
node_storage = 10
}
}
resource "alicloud_mongodb_shardingauditfilter" "default" {
db_instance_id = alicloud_mongodb_shardinginstance.default.id
audit_status = "enable"
filter = "admin,slow"
service_type = "V2_Standard"
storage_period = 30
hot_storage_period = 7
}
variable "name" {
type = string
default = "terraform-example"
}
Deleting alicloud.mongodb.ShardingAuditFilter or removing it from your configuration
Terraform cannot destroy resource alicloud.mongodb.ShardingAuditFilter. Terraform will remove this resource from the state file, however resources may remain.
📚 Need more examples? VIEW MORE EXAMPLES
Create ShardingAuditFilter Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ShardingAuditFilter(name: string, args: ShardingAuditFilterArgs, opts?: CustomResourceOptions);@overload
def ShardingAuditFilter(resource_name: str,
args: ShardingAuditFilterArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ShardingAuditFilter(resource_name: str,
opts: Optional[ResourceOptions] = None,
audit_status: Optional[str] = None,
db_instance_id: Optional[str] = None,
filter: Optional[str] = None,
hot_storage_period: Optional[int] = None,
role_type: Optional[str] = None,
service_type: Optional[str] = None,
storage_period: Optional[int] = None)func NewShardingAuditFilter(ctx *Context, name string, args ShardingAuditFilterArgs, opts ...ResourceOption) (*ShardingAuditFilter, error)public ShardingAuditFilter(string name, ShardingAuditFilterArgs args, CustomResourceOptions? opts = null)
public ShardingAuditFilter(String name, ShardingAuditFilterArgs args)
public ShardingAuditFilter(String name, ShardingAuditFilterArgs args, CustomResourceOptions options)
type: alicloud:mongodb:ShardingAuditFilter
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "alicloud_mongodb_sharding_audit_filter" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ShardingAuditFilterArgs
- 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 ShardingAuditFilterArgs
- 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 ShardingAuditFilterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ShardingAuditFilterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ShardingAuditFilterArgs
- 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 shardingAuditFilterResource = new AliCloud.MongoDB.ShardingAuditFilter("shardingAuditFilterResource", new()
{
AuditStatus = "string",
DbInstanceId = "string",
Filter = "string",
HotStoragePeriod = 0,
RoleType = "string",
ServiceType = "string",
StoragePeriod = 0,
});
example, err := mongodb.NewShardingAuditFilter(ctx, "shardingAuditFilterResource", &mongodb.ShardingAuditFilterArgs{
AuditStatus: pulumi.String("string"),
DbInstanceId: pulumi.String("string"),
Filter: pulumi.String("string"),
HotStoragePeriod: pulumi.Int(0),
RoleType: pulumi.String("string"),
ServiceType: pulumi.String("string"),
StoragePeriod: pulumi.Int(0),
})
resource "alicloud_mongodb_sharding_audit_filter" "shardingAuditFilterResource" {
lifecycle {
create_before_destroy = true
}
audit_status = "string"
db_instance_id = "string"
filter = "string"
hot_storage_period = 0
role_type = "string"
service_type = "string"
storage_period = 0
}
var shardingAuditFilterResource = new ShardingAuditFilter("shardingAuditFilterResource", ShardingAuditFilterArgs.builder()
.auditStatus("string")
.dbInstanceId("string")
.filter("string")
.hotStoragePeriod(0)
.roleType("string")
.serviceType("string")
.storagePeriod(0)
.build());
sharding_audit_filter_resource = alicloud.mongodb.ShardingAuditFilter("shardingAuditFilterResource",
audit_status="string",
db_instance_id="string",
filter="string",
hot_storage_period=0,
role_type="string",
service_type="string",
storage_period=0)
const shardingAuditFilterResource = new alicloud.mongodb.ShardingAuditFilter("shardingAuditFilterResource", {
auditStatus: "string",
dbInstanceId: "string",
filter: "string",
hotStoragePeriod: 0,
roleType: "string",
serviceType: "string",
storagePeriod: 0,
});
type: alicloud:mongodb:ShardingAuditFilter
properties:
auditStatus: string
dbInstanceId: string
filter: string
hotStoragePeriod: 0
roleType: string
serviceType: string
storagePeriod: 0
ShardingAuditFilter 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 ShardingAuditFilter resource accepts the following input properties:
- Audit
Status string - Audit state. Valid values:
enable,disabled. - Db
Instance stringId - The ID of the sharding cluster instance.
- Filter string
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- Hot
Storage intPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - Role
Type string - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- Service
Type string - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - Storage
Period int - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- Audit
Status string - Audit state. Valid values:
enable,disabled. - Db
Instance stringId - The ID of the sharding cluster instance.
- Filter string
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- Hot
Storage intPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - Role
Type string - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- Service
Type string - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - Storage
Period int - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit_
status string - Audit state. Valid values:
enable,disabled. - db_
instance_ stringid - The ID of the sharding cluster instance.
- filter string
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot_
storage_ numberperiod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - role_
type string - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service_
type string - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage_
period number - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit
Status String - Audit state. Valid values:
enable,disabled. - db
Instance StringId - The ID of the sharding cluster instance.
- filter String
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot
Storage IntegerPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - role
Type String - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service
Type String - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage
Period Integer - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit
Status string - Audit state. Valid values:
enable,disabled. - db
Instance stringId - The ID of the sharding cluster instance.
- filter string
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot
Storage numberPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - role
Type string - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service
Type string - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage
Period number - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit_
status str - Audit state. Valid values:
enable,disabled. - db_
instance_ strid - The ID of the sharding cluster instance.
- filter str
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot_
storage_ intperiod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - role_
type str - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service_
type str - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage_
period int - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit
Status String - Audit state. Valid values:
enable,disabled. - db
Instance StringId - The ID of the sharding cluster instance.
- filter String
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot
Storage NumberPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - role
Type String - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service
Type String - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage
Period Number - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
Outputs
All input properties are implicitly available as output properties. Additionally, the ShardingAuditFilter resource produces the following output properties:
Look up Existing ShardingAuditFilter Resource
Get an existing ShardingAuditFilter 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?: ShardingAuditFilterState, opts?: CustomResourceOptions): ShardingAuditFilter@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
audit_status: Optional[str] = None,
db_instance_id: Optional[str] = None,
filter: Optional[str] = None,
hot_storage_period: Optional[int] = None,
region_id: Optional[str] = None,
role_type: Optional[str] = None,
service_type: Optional[str] = None,
storage_period: Optional[int] = None) -> ShardingAuditFilterfunc GetShardingAuditFilter(ctx *Context, name string, id IDInput, state *ShardingAuditFilterState, opts ...ResourceOption) (*ShardingAuditFilter, error)public static ShardingAuditFilter Get(string name, Input<string> id, ShardingAuditFilterState? state, CustomResourceOptions? opts = null)public static ShardingAuditFilter get(String name, Output<String> id, ShardingAuditFilterState state, CustomResourceOptions options)resources: _: type: alicloud:mongodb:ShardingAuditFilter get: id: ${id}import {
to = alicloud_mongodb_sharding_audit_filter.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.
- Audit
Status string - Audit state. Valid values:
enable,disabled. - Db
Instance stringId - The ID of the sharding cluster instance.
- Filter string
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- Hot
Storage intPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - Region
Id string - The region ID of the sharding cluster instance.
- Role
Type string - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- Service
Type string - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - Storage
Period int - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- Audit
Status string - Audit state. Valid values:
enable,disabled. - Db
Instance stringId - The ID of the sharding cluster instance.
- Filter string
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- Hot
Storage intPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - Region
Id string - The region ID of the sharding cluster instance.
- Role
Type string - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- Service
Type string - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - Storage
Period int - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit_
status string - Audit state. Valid values:
enable,disabled. - db_
instance_ stringid - The ID of the sharding cluster instance.
- filter string
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot_
storage_ numberperiod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - region_
id string - The region ID of the sharding cluster instance.
- role_
type string - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service_
type string - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage_
period number - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit
Status String - Audit state. Valid values:
enable,disabled. - db
Instance StringId - The ID of the sharding cluster instance.
- filter String
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot
Storage IntegerPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - region
Id String - The region ID of the sharding cluster instance.
- role
Type String - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service
Type String - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage
Period Integer - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit
Status string - Audit state. Valid values:
enable,disabled. - db
Instance stringId - The ID of the sharding cluster instance.
- filter string
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot
Storage numberPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - region
Id string - The region ID of the sharding cluster instance.
- role
Type string - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service
Type string - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage
Period number - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit_
status str - Audit state. Valid values:
enable,disabled. - db_
instance_ strid - The ID of the sharding cluster instance.
- filter str
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot_
storage_ intperiod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - region_
id str - The region ID of the sharding cluster instance.
- role_
type str - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service_
type str - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage_
period int - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
- audit
Status String - Audit state. Valid values:
enable,disabled. - db
Instance StringId - The ID of the sharding cluster instance.
- filter String
- The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:
- hot
Storage NumberPeriod - The hot storage duration of the audit log, in days. The value range is 0 to 7. Only takes effect when
serviceTypeisV2_Standard. - region
Id String - The region ID of the sharding cluster instance.
- role
Type String - The role of the node in the sharding cluster instance that the audit log filter applies to. Valid values:
- service
Type String - The edition of the audit log. Valid values:
Standard,V2_Standard. If omitted, the Provider sendsStandard. In regions where only the V2 audit log is available, set this toV2_Standard. Changes to this field are ignored whileauditStatusisdisabled— the server switches the edition internally when audit is off and restores the declared value on re-enable. - storage
Period Number - Audit log retention duration, in days.
- When
serviceTypeisStandard, the value range is 1 to 365 days. The default value is 30 days. - When
serviceTypeisV2_Standard, this is the cold storage duration and is required. Valid values:30,180,365,1095,1825.
- When
Import
Mongodb Sharding Audit Filter can be imported using the id, e.g.
$ pulumi import alicloud:mongodb/shardingAuditFilter:ShardingAuditFilter example <db_instance_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
published on Thursday, Sep 17, 2026 by Pulumi