1. Packages
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. PostgresAuditService
Viewing docs for tencentcloud 1.83.3
published on Friday, Jun 19, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.83.3
published on Friday, Jun 19, 2026 by tencentcloudstack

    Provides a resource to manage PostgreSQL audit service

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.PostgresAuditService("example", {
        instanceId: "postgres-ckwcgdf1",
        logExpireDay: 30,
        hotLogExpireDay: 7,
        auditType: "complex",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.PostgresAuditService("example",
        instance_id="postgres-ckwcgdf1",
        log_expire_day=30,
        hot_log_expire_day=7,
        audit_type="complex")
    
    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.NewPostgresAuditService(ctx, "example", &tencentcloud.PostgresAuditServiceArgs{
    			InstanceId:      pulumi.String("postgres-ckwcgdf1"),
    			LogExpireDay:    pulumi.Float64(30),
    			HotLogExpireDay: pulumi.Float64(7),
    			AuditType:       pulumi.String("complex"),
    		})
    		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.PostgresAuditService("example", new()
        {
            InstanceId = "postgres-ckwcgdf1",
            LogExpireDay = 30,
            HotLogExpireDay = 7,
            AuditType = "complex",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.PostgresAuditService;
    import com.pulumi.tencentcloud.PostgresAuditServiceArgs;
    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 PostgresAuditService("example", PostgresAuditServiceArgs.builder()
                .instanceId("postgres-ckwcgdf1")
                .logExpireDay(30.0)
                .hotLogExpireDay(7.0)
                .auditType("complex")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:PostgresAuditService
        properties:
          instanceId: postgres-ckwcgdf1
          logExpireDay: 30
          hotLogExpireDay: 7
          auditType: complex
    
    Example coming soon!
    

    Create PostgresAuditService Resource

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

    Constructor syntax

    new PostgresAuditService(name: string, args: PostgresAuditServiceArgs, opts?: CustomResourceOptions);
    @overload
    def PostgresAuditService(resource_name: str,
                             args: PostgresAuditServiceArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresAuditService(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             audit_type: Optional[str] = None,
                             hot_log_expire_day: Optional[float] = None,
                             instance_id: Optional[str] = None,
                             log_expire_day: Optional[float] = None,
                             postgres_audit_service_id: Optional[str] = None)
    func NewPostgresAuditService(ctx *Context, name string, args PostgresAuditServiceArgs, opts ...ResourceOption) (*PostgresAuditService, error)
    public PostgresAuditService(string name, PostgresAuditServiceArgs args, CustomResourceOptions? opts = null)
    public PostgresAuditService(String name, PostgresAuditServiceArgs args)
    public PostgresAuditService(String name, PostgresAuditServiceArgs args, CustomResourceOptions options)
    
    type: tencentcloud:PostgresAuditService
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "tencentcloud_postgresauditservice" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args PostgresAuditServiceArgs
    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 PostgresAuditServiceArgs
    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 PostgresAuditServiceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PostgresAuditServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PostgresAuditServiceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    AuditType string
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    HotLogExpireDay double
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    InstanceId string
    PostgreSQL instance ID.
    LogExpireDay double
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    PostgresAuditServiceId string
    ID of the resource.
    AuditType string
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    HotLogExpireDay float64
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    InstanceId string
    PostgreSQL instance ID.
    LogExpireDay float64
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    PostgresAuditServiceId string
    ID of the resource.
    audit_type string
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    hot_log_expire_day number
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    instance_id string
    PostgreSQL instance ID.
    log_expire_day number
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgres_audit_service_id string
    ID of the resource.
    auditType String
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    hotLogExpireDay Double
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    instanceId String
    PostgreSQL instance ID.
    logExpireDay Double
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgresAuditServiceId String
    ID of the resource.
    auditType string
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    hotLogExpireDay number
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    instanceId string
    PostgreSQL instance ID.
    logExpireDay number
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgresAuditServiceId string
    ID of the resource.
    audit_type str
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    hot_log_expire_day float
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    instance_id str
    PostgreSQL instance ID.
    log_expire_day float
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgres_audit_service_id str
    ID of the resource.
    auditType String
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    hotLogExpireDay Number
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    instanceId String
    PostgreSQL instance ID.
    logExpireDay Number
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgresAuditServiceId String
    ID of the resource.

    Outputs

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

    AuditStatus string
    Audit status. Values: ON, OFF.
    ColdLogExpireDay double
    Cold log retention days.
    ColdLogSize double
    Cold log size in MB.
    HotLogSize double
    Hot log size in MB.
    Id string
    The provider-assigned unique ID for this managed resource.
    AuditStatus string
    Audit status. Values: ON, OFF.
    ColdLogExpireDay float64
    Cold log retention days.
    ColdLogSize float64
    Cold log size in MB.
    HotLogSize float64
    Hot log size in MB.
    Id string
    The provider-assigned unique ID for this managed resource.
    audit_status string
    Audit status. Values: ON, OFF.
    cold_log_expire_day number
    Cold log retention days.
    cold_log_size number
    Cold log size in MB.
    hot_log_size number
    Hot log size in MB.
    id string
    The provider-assigned unique ID for this managed resource.
    auditStatus String
    Audit status. Values: ON, OFF.
    coldLogExpireDay Double
    Cold log retention days.
    coldLogSize Double
    Cold log size in MB.
    hotLogSize Double
    Hot log size in MB.
    id String
    The provider-assigned unique ID for this managed resource.
    auditStatus string
    Audit status. Values: ON, OFF.
    coldLogExpireDay number
    Cold log retention days.
    coldLogSize number
    Cold log size in MB.
    hotLogSize number
    Hot log size in MB.
    id string
    The provider-assigned unique ID for this managed resource.
    audit_status str
    Audit status. Values: ON, OFF.
    cold_log_expire_day float
    Cold log retention days.
    cold_log_size float
    Cold log size in MB.
    hot_log_size float
    Hot log size in MB.
    id str
    The provider-assigned unique ID for this managed resource.
    auditStatus String
    Audit status. Values: ON, OFF.
    coldLogExpireDay Number
    Cold log retention days.
    coldLogSize Number
    Cold log size in MB.
    hotLogSize Number
    Hot log size in MB.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PostgresAuditService Resource

    Get an existing PostgresAuditService 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?: PostgresAuditServiceState, opts?: CustomResourceOptions): PostgresAuditService
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            audit_status: Optional[str] = None,
            audit_type: Optional[str] = None,
            cold_log_expire_day: Optional[float] = None,
            cold_log_size: Optional[float] = None,
            hot_log_expire_day: Optional[float] = None,
            hot_log_size: Optional[float] = None,
            instance_id: Optional[str] = None,
            log_expire_day: Optional[float] = None,
            postgres_audit_service_id: Optional[str] = None) -> PostgresAuditService
    func GetPostgresAuditService(ctx *Context, name string, id IDInput, state *PostgresAuditServiceState, opts ...ResourceOption) (*PostgresAuditService, error)
    public static PostgresAuditService Get(string name, Input<string> id, PostgresAuditServiceState? state, CustomResourceOptions? opts = null)
    public static PostgresAuditService get(String name, Output<String> id, PostgresAuditServiceState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:PostgresAuditService    get:      id: ${id}
    import {
      to = tencentcloud_postgresauditservice.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.
    The following state arguments are supported:
    AuditStatus string
    Audit status. Values: ON, OFF.
    AuditType string
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    ColdLogExpireDay double
    Cold log retention days.
    ColdLogSize double
    Cold log size in MB.
    HotLogExpireDay double
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    HotLogSize double
    Hot log size in MB.
    InstanceId string
    PostgreSQL instance ID.
    LogExpireDay double
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    PostgresAuditServiceId string
    ID of the resource.
    AuditStatus string
    Audit status. Values: ON, OFF.
    AuditType string
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    ColdLogExpireDay float64
    Cold log retention days.
    ColdLogSize float64
    Cold log size in MB.
    HotLogExpireDay float64
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    HotLogSize float64
    Hot log size in MB.
    InstanceId string
    PostgreSQL instance ID.
    LogExpireDay float64
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    PostgresAuditServiceId string
    ID of the resource.
    audit_status string
    Audit status. Values: ON, OFF.
    audit_type string
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    cold_log_expire_day number
    Cold log retention days.
    cold_log_size number
    Cold log size in MB.
    hot_log_expire_day number
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    hot_log_size number
    Hot log size in MB.
    instance_id string
    PostgreSQL instance ID.
    log_expire_day number
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgres_audit_service_id string
    ID of the resource.
    auditStatus String
    Audit status. Values: ON, OFF.
    auditType String
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    coldLogExpireDay Double
    Cold log retention days.
    coldLogSize Double
    Cold log size in MB.
    hotLogExpireDay Double
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    hotLogSize Double
    Hot log size in MB.
    instanceId String
    PostgreSQL instance ID.
    logExpireDay Double
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgresAuditServiceId String
    ID of the resource.
    auditStatus string
    Audit status. Values: ON, OFF.
    auditType string
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    coldLogExpireDay number
    Cold log retention days.
    coldLogSize number
    Cold log size in MB.
    hotLogExpireDay number
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    hotLogSize number
    Hot log size in MB.
    instanceId string
    PostgreSQL instance ID.
    logExpireDay number
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgresAuditServiceId string
    ID of the resource.
    audit_status str
    Audit status. Values: ON, OFF.
    audit_type str
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    cold_log_expire_day float
    Cold log retention days.
    cold_log_size float
    Cold log size in MB.
    hot_log_expire_day float
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    hot_log_size float
    Hot log size in MB.
    instance_id str
    PostgreSQL instance ID.
    log_expire_day float
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgres_audit_service_id str
    ID of the resource.
    auditStatus String
    Audit status. Values: ON, OFF.
    auditType String
    Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
    coldLogExpireDay Number
    Cold log retention days.
    coldLogSize Number
    Cold log size in MB.
    hotLogExpireDay Number
    Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    hotLogSize Number
    Hot log size in MB.
    instanceId String
    PostgreSQL instance ID.
    logExpireDay Number
    Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
    postgresAuditServiceId String
    ID of the resource.

    Import

    PostgreSQL audit service can be imported using the instance_id, e.g.

    $ pulumi import tencentcloud:index/postgresAuditService:PostgresAuditService example postgres-ckwcgdf1
    

    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.
    Viewing docs for tencentcloud 1.83.3
    published on Friday, Jun 19, 2026 by tencentcloudstack

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial