1. Registry
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. PostgresAuditLogFile
Viewing docs for tencentcloud 1.83.33
published on Monday, Sep 21, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.83.33
published on Monday, Sep 21, 2026 by tencentcloudstack

    Provides a resource to create a PostgreSQL audit log file

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.PostgresAuditLogFile("example", {
        instanceId: "postgres-ckwcgdf1",
        startTime: "2026-03-25 00:00:00",
        endTime: "2026-03-25 01:00:00",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.PostgresAuditLogFile("example",
        instance_id="postgres-ckwcgdf1",
        start_time="2026-03-25 00:00:00",
        end_time="2026-03-25 01:00:00")
    
    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.NewPostgresAuditLogFile(ctx, "example", &tencentcloud.PostgresAuditLogFileArgs{
    			InstanceId: pulumi.String("postgres-ckwcgdf1"),
    			StartTime:  pulumi.String("2026-03-25 00:00:00"),
    			EndTime:    pulumi.String("2026-03-25 01:00:00"),
    		})
    		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.PostgresAuditLogFile("example", new()
        {
            InstanceId = "postgres-ckwcgdf1",
            StartTime = "2026-03-25 00:00:00",
            EndTime = "2026-03-25 01:00:00",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.PostgresAuditLogFile;
    import com.pulumi.tencentcloud.PostgresAuditLogFileArgs;
    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 PostgresAuditLogFile("example", PostgresAuditLogFileArgs.builder()
                .instanceId("postgres-ckwcgdf1")
                .startTime("2026-03-25 00:00:00")
                .endTime("2026-03-25 01:00:00")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:PostgresAuditLogFile
        properties:
          instanceId: postgres-ckwcgdf1
          startTime: 2026-03-25 00:00:00
          endTime: 2026-03-25 01:00:00
    
    Example coming soon!
    

    Create with filter conditions

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.PostgresAuditLogFile("example", {
        instanceId: "postgres-ckwcgdf1",
        startTime: "2026-03-25 00:00:00",
        endTime: "2026-03-25 01:00:00",
        filter: {
            affectRows: 100,
            dbNames: ["testDB"],
            execTime: 1000,
            hosts: ["10.0.0.1"],
            sql: "SELECT",
            users: ["admin"],
            sqlTypes: [
                "SELECT",
                "INSERT",
            ],
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.PostgresAuditLogFile("example",
        instance_id="postgres-ckwcgdf1",
        start_time="2026-03-25 00:00:00",
        end_time="2026-03-25 01:00:00",
        filter={
            "affect_rows": 100,
            "db_names": ["testDB"],
            "exec_time": 1000,
            "hosts": ["10.0.0.1"],
            "sql": "SELECT",
            "users": ["admin"],
            "sql_types": [
                "SELECT",
                "INSERT",
            ],
        })
    
    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.NewPostgresAuditLogFile(ctx, "example", &tencentcloud.PostgresAuditLogFileArgs{
    			InstanceId: pulumi.String("postgres-ckwcgdf1"),
    			StartTime:  pulumi.String("2026-03-25 00:00:00"),
    			EndTime:    pulumi.String("2026-03-25 01:00:00"),
    			Filter: &tencentcloud.PostgresAuditLogFileFilterArgs{
    				AffectRows: pulumi.Float64(100),
    				DbNames: pulumi.StringArray{
    					pulumi.String("testDB"),
    				},
    				ExecTime: pulumi.Float64(1000),
    				Hosts: pulumi.StringArray{
    					pulumi.String("10.0.0.1"),
    				},
    				Sql: pulumi.String("SELECT"),
    				Users: pulumi.StringArray{
    					pulumi.String("admin"),
    				},
    				SqlTypes: pulumi.StringArray{
    					pulumi.String("SELECT"),
    					pulumi.String("INSERT"),
    				},
    			},
    		})
    		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.PostgresAuditLogFile("example", new()
        {
            InstanceId = "postgres-ckwcgdf1",
            StartTime = "2026-03-25 00:00:00",
            EndTime = "2026-03-25 01:00:00",
            Filter = new Tencentcloud.Inputs.PostgresAuditLogFileFilterArgs
            {
                AffectRows = 100,
                DbNames = new[]
                {
                    "testDB",
                },
                ExecTime = 1000,
                Hosts = new[]
                {
                    "10.0.0.1",
                },
                Sql = "SELECT",
                Users = new[]
                {
                    "admin",
                },
                SqlTypes = new[]
                {
                    "SELECT",
                    "INSERT",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.PostgresAuditLogFile;
    import com.pulumi.tencentcloud.PostgresAuditLogFileArgs;
    import com.pulumi.tencentcloud.inputs.PostgresAuditLogFileFilterArgs;
    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 PostgresAuditLogFile("example", PostgresAuditLogFileArgs.builder()
                .instanceId("postgres-ckwcgdf1")
                .startTime("2026-03-25 00:00:00")
                .endTime("2026-03-25 01:00:00")
                .filter(PostgresAuditLogFileFilterArgs.builder()
                    .affectRows(100.0)
                    .dbNames("testDB")
                    .execTime(1000.0)
                    .hosts("10.0.0.1")
                    .sql("SELECT")
                    .users("admin")
                    .sqlTypes(                
                        "SELECT",
                        "INSERT")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:PostgresAuditLogFile
        properties:
          instanceId: postgres-ckwcgdf1
          startTime: 2026-03-25 00:00:00
          endTime: 2026-03-25 01:00:00
          filter:
            affectRows: 100
            dbNames:
              - testDB
            execTime: 1000
            hosts:
              - 10.0.0.1
            sql: SELECT
            users:
              - admin
            sqlTypes:
              - SELECT
              - INSERT
    
    Example coming soon!
    

    Create PostgresAuditLogFile Resource

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

    Constructor syntax

    new PostgresAuditLogFile(name: string, args: PostgresAuditLogFileArgs, opts?: CustomResourceOptions);
    @overload
    def PostgresAuditLogFile(resource_name: str,
                             args: PostgresAuditLogFileArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresAuditLogFile(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             end_time: Optional[str] = None,
                             instance_id: Optional[str] = None,
                             start_time: Optional[str] = None,
                             filter: Optional[PostgresAuditLogFileFilterArgs] = None,
                             postgres_audit_log_file_id: Optional[str] = None,
                             timeouts: Optional[PostgresAuditLogFileTimeoutsArgs] = None)
    func NewPostgresAuditLogFile(ctx *Context, name string, args PostgresAuditLogFileArgs, opts ...ResourceOption) (*PostgresAuditLogFile, error)
    public PostgresAuditLogFile(string name, PostgresAuditLogFileArgs args, CustomResourceOptions? opts = null)
    public PostgresAuditLogFile(String name, PostgresAuditLogFileArgs args)
    public PostgresAuditLogFile(String name, PostgresAuditLogFileArgs args, CustomResourceOptions options)
    
    type: tencentcloud:PostgresAuditLogFile
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "tencentcloud_postgres_audit_log_file" "name" {
        # resource properties
    }

    Parameters

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

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

    EndTime string
    End time, format: 2026-03-25 01:00:00.
    InstanceId string
    Instance ID.
    StartTime string
    Start time, format: 2026-03-25 00:00:00.
    Filter PostgresAuditLogFileFilter
    Filter conditions.
    PostgresAuditLogFileId string
    ID of the resource.
    Timeouts PostgresAuditLogFileTimeouts
    EndTime string
    End time, format: 2026-03-25 01:00:00.
    InstanceId string
    Instance ID.
    StartTime string
    Start time, format: 2026-03-25 00:00:00.
    Filter PostgresAuditLogFileFilterArgs
    Filter conditions.
    PostgresAuditLogFileId string
    ID of the resource.
    Timeouts PostgresAuditLogFileTimeoutsArgs
    end_time string
    End time, format: 2026-03-25 01:00:00.
    instance_id string
    Instance ID.
    start_time string
    Start time, format: 2026-03-25 00:00:00.
    filter object
    Filter conditions.
    postgres_audit_log_file_id string
    ID of the resource.
    timeouts object
    endTime String
    End time, format: 2026-03-25 01:00:00.
    instanceId String
    Instance ID.
    startTime String
    Start time, format: 2026-03-25 00:00:00.
    filter PostgresAuditLogFileFilter
    Filter conditions.
    postgresAuditLogFileId String
    ID of the resource.
    timeouts PostgresAuditLogFileTimeouts
    endTime string
    End time, format: 2026-03-25 01:00:00.
    instanceId string
    Instance ID.
    startTime string
    Start time, format: 2026-03-25 00:00:00.
    filter PostgresAuditLogFileFilter
    Filter conditions.
    postgresAuditLogFileId string
    ID of the resource.
    timeouts PostgresAuditLogFileTimeouts
    end_time str
    End time, format: 2026-03-25 01:00:00.
    instance_id str
    Instance ID.
    start_time str
    Start time, format: 2026-03-25 00:00:00.
    filter PostgresAuditLogFileFilterArgs
    Filter conditions.
    postgres_audit_log_file_id str
    ID of the resource.
    timeouts PostgresAuditLogFileTimeoutsArgs
    endTime String
    End time, format: 2026-03-25 01:00:00.
    instanceId String
    Instance ID.
    startTime String
    Start time, format: 2026-03-25 00:00:00.
    filter Property Map
    Filter conditions.
    postgresAuditLogFileId String
    ID of the resource.
    timeouts Property Map

    Outputs

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

    DownloadUrl string
    Download URL.
    FileName string
    Audit log file name.
    FileSize double
    File size in MB.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Task status. Values: success, running, failed.
    DownloadUrl string
    Download URL.
    FileName string
    Audit log file name.
    FileSize float64
    File size in MB.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Task status. Values: success, running, failed.
    download_url string
    Download URL.
    file_name string
    Audit log file name.
    file_size number
    File size in MB.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Task status. Values: success, running, failed.
    downloadUrl String
    Download URL.
    fileName String
    Audit log file name.
    fileSize Double
    File size in MB.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Task status. Values: success, running, failed.
    downloadUrl string
    Download URL.
    fileName string
    Audit log file name.
    fileSize number
    File size in MB.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Task status. Values: success, running, failed.
    download_url str
    Download URL.
    file_name str
    Audit log file name.
    file_size float
    File size in MB.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    Task status. Values: success, running, failed.
    downloadUrl String
    Download URL.
    fileName String
    Audit log file name.
    fileSize Number
    File size in MB.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Task status. Values: success, running, failed.

    Look up Existing PostgresAuditLogFile Resource

    Get an existing PostgresAuditLogFile 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?: PostgresAuditLogFileState, opts?: CustomResourceOptions): PostgresAuditLogFile
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            download_url: Optional[str] = None,
            end_time: Optional[str] = None,
            file_name: Optional[str] = None,
            file_size: Optional[float] = None,
            filter: Optional[PostgresAuditLogFileFilterArgs] = None,
            instance_id: Optional[str] = None,
            postgres_audit_log_file_id: Optional[str] = None,
            start_time: Optional[str] = None,
            status: Optional[str] = None,
            timeouts: Optional[PostgresAuditLogFileTimeoutsArgs] = None) -> PostgresAuditLogFile
    func GetPostgresAuditLogFile(ctx *Context, name string, id IDInput, state *PostgresAuditLogFileState, opts ...ResourceOption) (*PostgresAuditLogFile, error)
    public static PostgresAuditLogFile Get(string name, Input<string> id, PostgresAuditLogFileState? state, CustomResourceOptions? opts = null)
    public static PostgresAuditLogFile get(String name, Output<String> id, PostgresAuditLogFileState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:PostgresAuditLogFile    get:      id: ${id}
    import {
      to = tencentcloud_postgres_audit_log_file.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:
    DownloadUrl string
    Download URL.
    EndTime string
    End time, format: 2026-03-25 01:00:00.
    FileName string
    Audit log file name.
    FileSize double
    File size in MB.
    Filter PostgresAuditLogFileFilter
    Filter conditions.
    InstanceId string
    Instance ID.
    PostgresAuditLogFileId string
    ID of the resource.
    StartTime string
    Start time, format: 2026-03-25 00:00:00.
    Status string
    Task status. Values: success, running, failed.
    Timeouts PostgresAuditLogFileTimeouts
    DownloadUrl string
    Download URL.
    EndTime string
    End time, format: 2026-03-25 01:00:00.
    FileName string
    Audit log file name.
    FileSize float64
    File size in MB.
    Filter PostgresAuditLogFileFilterArgs
    Filter conditions.
    InstanceId string
    Instance ID.
    PostgresAuditLogFileId string
    ID of the resource.
    StartTime string
    Start time, format: 2026-03-25 00:00:00.
    Status string
    Task status. Values: success, running, failed.
    Timeouts PostgresAuditLogFileTimeoutsArgs
    download_url string
    Download URL.
    end_time string
    End time, format: 2026-03-25 01:00:00.
    file_name string
    Audit log file name.
    file_size number
    File size in MB.
    filter object
    Filter conditions.
    instance_id string
    Instance ID.
    postgres_audit_log_file_id string
    ID of the resource.
    start_time string
    Start time, format: 2026-03-25 00:00:00.
    status string
    Task status. Values: success, running, failed.
    timeouts object
    downloadUrl String
    Download URL.
    endTime String
    End time, format: 2026-03-25 01:00:00.
    fileName String
    Audit log file name.
    fileSize Double
    File size in MB.
    filter PostgresAuditLogFileFilter
    Filter conditions.
    instanceId String
    Instance ID.
    postgresAuditLogFileId String
    ID of the resource.
    startTime String
    Start time, format: 2026-03-25 00:00:00.
    status String
    Task status. Values: success, running, failed.
    timeouts PostgresAuditLogFileTimeouts
    downloadUrl string
    Download URL.
    endTime string
    End time, format: 2026-03-25 01:00:00.
    fileName string
    Audit log file name.
    fileSize number
    File size in MB.
    filter PostgresAuditLogFileFilter
    Filter conditions.
    instanceId string
    Instance ID.
    postgresAuditLogFileId string
    ID of the resource.
    startTime string
    Start time, format: 2026-03-25 00:00:00.
    status string
    Task status. Values: success, running, failed.
    timeouts PostgresAuditLogFileTimeouts
    download_url str
    Download URL.
    end_time str
    End time, format: 2026-03-25 01:00:00.
    file_name str
    Audit log file name.
    file_size float
    File size in MB.
    filter PostgresAuditLogFileFilterArgs
    Filter conditions.
    instance_id str
    Instance ID.
    postgres_audit_log_file_id str
    ID of the resource.
    start_time str
    Start time, format: 2026-03-25 00:00:00.
    status str
    Task status. Values: success, running, failed.
    timeouts PostgresAuditLogFileTimeoutsArgs
    downloadUrl String
    Download URL.
    endTime String
    End time, format: 2026-03-25 01:00:00.
    fileName String
    Audit log file name.
    fileSize Number
    File size in MB.
    filter Property Map
    Filter conditions.
    instanceId String
    Instance ID.
    postgresAuditLogFileId String
    ID of the resource.
    startTime String
    Start time, format: 2026-03-25 00:00:00.
    status String
    Task status. Values: success, running, failed.
    timeouts Property Map

    Supporting Types

    PostgresAuditLogFileFilter, PostgresAuditLogFileFilterArgs

    AffectRows double
    Affect rows.
    DbNames List<string>
    Database name list.
    ExecTime double
    Execution time.
    Hosts List<string>
    Host list.
    Sql string
    SQL statement.
    SqlTypes List<string>
    SQL type list.
    Users List<string>
    User name list.
    AffectRows float64
    Affect rows.
    DbNames []string
    Database name list.
    ExecTime float64
    Execution time.
    Hosts []string
    Host list.
    Sql string
    SQL statement.
    SqlTypes []string
    SQL type list.
    Users []string
    User name list.
    affect_rows number
    Affect rows.
    db_names list(string)
    Database name list.
    exec_time number
    Execution time.
    hosts list(string)
    Host list.
    sql string
    SQL statement.
    sql_types list(string)
    SQL type list.
    users list(string)
    User name list.
    affectRows Double
    Affect rows.
    dbNames List<String>
    Database name list.
    execTime Double
    Execution time.
    hosts List<String>
    Host list.
    sql String
    SQL statement.
    sqlTypes List<String>
    SQL type list.
    users List<String>
    User name list.
    affectRows number
    Affect rows.
    dbNames string[]
    Database name list.
    execTime number
    Execution time.
    hosts string[]
    Host list.
    sql string
    SQL statement.
    sqlTypes string[]
    SQL type list.
    users string[]
    User name list.
    affect_rows float
    Affect rows.
    db_names Sequence[str]
    Database name list.
    exec_time float
    Execution time.
    hosts Sequence[str]
    Host list.
    sql str
    SQL statement.
    sql_types Sequence[str]
    SQL type list.
    users Sequence[str]
    User name list.
    affectRows Number
    Affect rows.
    dbNames List<String>
    Database name list.
    execTime Number
    Execution time.
    hosts List<String>
    Host list.
    sql String
    SQL statement.
    sqlTypes List<String>
    SQL type list.
    users List<String>
    User name list.

    PostgresAuditLogFileTimeouts, PostgresAuditLogFileTimeoutsArgs

    Create string
    Create string
    create string
    create String
    create string
    create str
    create String

    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.33
    published on Monday, Sep 21, 2026 by tencentcloudstack

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial