1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CynosdbAuditService
tencentcloud 1.82.45 published on Tuesday, Dec 16, 2025 by tencentcloudstack
tencentcloud logo
tencentcloud 1.82.45 published on Tuesday, Dec 16, 2025 by tencentcloudstack

    Provides a resource to create a CynosDB audit service

    Example Usage

    If audit_all is true

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.CynosdbAuditService("example", {
        instanceId: "cynosdbmysql-ins-f9j6sopi",
        logExpireDay: 30,
        highLogExpireDay: 7,
        auditAll: true,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.CynosdbAuditService("example",
        instance_id="cynosdbmysql-ins-f9j6sopi",
        log_expire_day=30,
        high_log_expire_day=7,
        audit_all=True)
    
    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.NewCynosdbAuditService(ctx, "example", &tencentcloud.CynosdbAuditServiceArgs{
    			InstanceId:       pulumi.String("cynosdbmysql-ins-f9j6sopi"),
    			LogExpireDay:     pulumi.Float64(30),
    			HighLogExpireDay: pulumi.Float64(7),
    			AuditAll:         pulumi.Bool(true),
    		})
    		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.CynosdbAuditService("example", new()
        {
            InstanceId = "cynosdbmysql-ins-f9j6sopi",
            LogExpireDay = 30,
            HighLogExpireDay = 7,
            AuditAll = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CynosdbAuditService;
    import com.pulumi.tencentcloud.CynosdbAuditServiceArgs;
    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 CynosdbAuditService("example", CynosdbAuditServiceArgs.builder()
                .instanceId("cynosdbmysql-ins-f9j6sopi")
                .logExpireDay(30.0)
                .highLogExpireDay(7.0)
                .auditAll(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:CynosdbAuditService
        properties:
          instanceId: cynosdbmysql-ins-f9j6sopi
          logExpireDay: 30
          highLogExpireDay: 7
          auditAll: true
    

    If audit_all is false

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.CynosdbAuditService("example", {
        instanceId: "cynosdbmysql-ins-f9j6sopi",
        logExpireDay: 30,
        highLogExpireDay: 7,
        ruleTemplateIds: ["cynosdb-art-riwq2vx0"],
        auditAll: false,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.CynosdbAuditService("example",
        instance_id="cynosdbmysql-ins-f9j6sopi",
        log_expire_day=30,
        high_log_expire_day=7,
        rule_template_ids=["cynosdb-art-riwq2vx0"],
        audit_all=False)
    
    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.NewCynosdbAuditService(ctx, "example", &tencentcloud.CynosdbAuditServiceArgs{
    			InstanceId:       pulumi.String("cynosdbmysql-ins-f9j6sopi"),
    			LogExpireDay:     pulumi.Float64(30),
    			HighLogExpireDay: pulumi.Float64(7),
    			RuleTemplateIds: pulumi.StringArray{
    				pulumi.String("cynosdb-art-riwq2vx0"),
    			},
    			AuditAll: pulumi.Bool(false),
    		})
    		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.CynosdbAuditService("example", new()
        {
            InstanceId = "cynosdbmysql-ins-f9j6sopi",
            LogExpireDay = 30,
            HighLogExpireDay = 7,
            RuleTemplateIds = new[]
            {
                "cynosdb-art-riwq2vx0",
            },
            AuditAll = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CynosdbAuditService;
    import com.pulumi.tencentcloud.CynosdbAuditServiceArgs;
    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 CynosdbAuditService("example", CynosdbAuditServiceArgs.builder()
                .instanceId("cynosdbmysql-ins-f9j6sopi")
                .logExpireDay(30.0)
                .highLogExpireDay(7.0)
                .ruleTemplateIds("cynosdb-art-riwq2vx0")
                .auditAll(false)
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:CynosdbAuditService
        properties:
          instanceId: cynosdbmysql-ins-f9j6sopi
          logExpireDay: 30
          highLogExpireDay: 7
          ruleTemplateIds:
            - cynosdb-art-riwq2vx0
          auditAll: false
    

    Create CynosdbAuditService Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CynosdbAuditService(name: string, args: CynosdbAuditServiceArgs, opts?: CustomResourceOptions);
    @overload
    def CynosdbAuditService(resource_name: str,
                            args: CynosdbAuditServiceArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def CynosdbAuditService(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            instance_id: Optional[str] = None,
                            log_expire_day: Optional[float] = None,
                            audit_all: Optional[bool] = None,
                            cynosdb_audit_service_id: Optional[str] = None,
                            high_log_expire_day: Optional[float] = None,
                            rule_template_ids: Optional[Sequence[str]] = None)
    func NewCynosdbAuditService(ctx *Context, name string, args CynosdbAuditServiceArgs, opts ...ResourceOption) (*CynosdbAuditService, error)
    public CynosdbAuditService(string name, CynosdbAuditServiceArgs args, CustomResourceOptions? opts = null)
    public CynosdbAuditService(String name, CynosdbAuditServiceArgs args)
    public CynosdbAuditService(String name, CynosdbAuditServiceArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CynosdbAuditService
    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 CynosdbAuditServiceArgs
    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 CynosdbAuditServiceArgs
    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 CynosdbAuditServiceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CynosdbAuditServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CynosdbAuditServiceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    CynosdbAuditService 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 CynosdbAuditService resource accepts the following input properties:

    InstanceId string
    Instance ID.
    LogExpireDay double
    Log retention period.
    AuditAll bool
    Audit type. true - full audit; default false - rule-based audit.
    CynosdbAuditServiceId string
    ID of the resource.
    HighLogExpireDay double
    Frequent log retention period.
    RuleTemplateIds List<string>
    Rule template ID set.
    InstanceId string
    Instance ID.
    LogExpireDay float64
    Log retention period.
    AuditAll bool
    Audit type. true - full audit; default false - rule-based audit.
    CynosdbAuditServiceId string
    ID of the resource.
    HighLogExpireDay float64
    Frequent log retention period.
    RuleTemplateIds []string
    Rule template ID set.
    instanceId String
    Instance ID.
    logExpireDay Double
    Log retention period.
    auditAll Boolean
    Audit type. true - full audit; default false - rule-based audit.
    cynosdbAuditServiceId String
    ID of the resource.
    highLogExpireDay Double
    Frequent log retention period.
    ruleTemplateIds List<String>
    Rule template ID set.
    instanceId string
    Instance ID.
    logExpireDay number
    Log retention period.
    auditAll boolean
    Audit type. true - full audit; default false - rule-based audit.
    cynosdbAuditServiceId string
    ID of the resource.
    highLogExpireDay number
    Frequent log retention period.
    ruleTemplateIds string[]
    Rule template ID set.
    instance_id str
    Instance ID.
    log_expire_day float
    Log retention period.
    audit_all bool
    Audit type. true - full audit; default false - rule-based audit.
    cynosdb_audit_service_id str
    ID of the resource.
    high_log_expire_day float
    Frequent log retention period.
    rule_template_ids Sequence[str]
    Rule template ID set.
    instanceId String
    Instance ID.
    logExpireDay Number
    Log retention period.
    auditAll Boolean
    Audit type. true - full audit; default false - rule-based audit.
    cynosdbAuditServiceId String
    ID of the resource.
    highLogExpireDay Number
    Frequent log retention period.
    ruleTemplateIds List<String>
    Rule template ID set.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CynosdbAuditService resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CynosdbAuditService Resource

    Get an existing CynosdbAuditService 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?: CynosdbAuditServiceState, opts?: CustomResourceOptions): CynosdbAuditService
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            audit_all: Optional[bool] = None,
            cynosdb_audit_service_id: Optional[str] = None,
            high_log_expire_day: Optional[float] = None,
            instance_id: Optional[str] = None,
            log_expire_day: Optional[float] = None,
            rule_template_ids: Optional[Sequence[str]] = None) -> CynosdbAuditService
    func GetCynosdbAuditService(ctx *Context, name string, id IDInput, state *CynosdbAuditServiceState, opts ...ResourceOption) (*CynosdbAuditService, error)
    public static CynosdbAuditService Get(string name, Input<string> id, CynosdbAuditServiceState? state, CustomResourceOptions? opts = null)
    public static CynosdbAuditService get(String name, Output<String> id, CynosdbAuditServiceState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CynosdbAuditService    get:      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.
    The following state arguments are supported:
    AuditAll bool
    Audit type. true - full audit; default false - rule-based audit.
    CynosdbAuditServiceId string
    ID of the resource.
    HighLogExpireDay double
    Frequent log retention period.
    InstanceId string
    Instance ID.
    LogExpireDay double
    Log retention period.
    RuleTemplateIds List<string>
    Rule template ID set.
    AuditAll bool
    Audit type. true - full audit; default false - rule-based audit.
    CynosdbAuditServiceId string
    ID of the resource.
    HighLogExpireDay float64
    Frequent log retention period.
    InstanceId string
    Instance ID.
    LogExpireDay float64
    Log retention period.
    RuleTemplateIds []string
    Rule template ID set.
    auditAll Boolean
    Audit type. true - full audit; default false - rule-based audit.
    cynosdbAuditServiceId String
    ID of the resource.
    highLogExpireDay Double
    Frequent log retention period.
    instanceId String
    Instance ID.
    logExpireDay Double
    Log retention period.
    ruleTemplateIds List<String>
    Rule template ID set.
    auditAll boolean
    Audit type. true - full audit; default false - rule-based audit.
    cynosdbAuditServiceId string
    ID of the resource.
    highLogExpireDay number
    Frequent log retention period.
    instanceId string
    Instance ID.
    logExpireDay number
    Log retention period.
    ruleTemplateIds string[]
    Rule template ID set.
    audit_all bool
    Audit type. true - full audit; default false - rule-based audit.
    cynosdb_audit_service_id str
    ID of the resource.
    high_log_expire_day float
    Frequent log retention period.
    instance_id str
    Instance ID.
    log_expire_day float
    Log retention period.
    rule_template_ids Sequence[str]
    Rule template ID set.
    auditAll Boolean
    Audit type. true - full audit; default false - rule-based audit.
    cynosdbAuditServiceId String
    ID of the resource.
    highLogExpireDay Number
    Frequent log retention period.
    instanceId String
    Instance ID.
    logExpireDay Number
    Log retention period.
    ruleTemplateIds List<String>
    Rule template ID set.

    Import

    CynosDB audit service can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/cynosdbAuditService:CynosdbAuditService example cynosdbmysql-ins-f9j6sopi
    

    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 tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.82.45 published on Tuesday, Dec 16, 2025 by tencentcloudstack
      Meet Neo: Your AI Platform Teammate