published on Monday, Sep 21, 2026 by tencentcloudstack
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:
- 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
Postgres
Audit Log File Filter - Filter conditions.
- Postgres
Audit stringLog File Id - ID of the resource.
- Timeouts
Postgres
Audit Log File Timeouts
- 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
Postgres
Audit Log File Filter Args - Filter conditions.
- Postgres
Audit stringLog File Id - ID of the resource.
- Timeouts
Postgres
Audit Log File Timeouts Args
- 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_ stringlog_ file_ id - ID of the resource.
- timeouts object
- 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
Postgres
Audit Log File Filter - Filter conditions.
- postgres
Audit StringLog File Id - ID of the resource.
- timeouts
Postgres
Audit Log File Timeouts
- 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
Postgres
Audit Log File Filter - Filter conditions.
- postgres
Audit stringLog File Id - ID of the resource.
- timeouts
Postgres
Audit Log File Timeouts
- 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
Postgres
Audit Log File Filter Args - Filter conditions.
- postgres_
audit_ strlog_ file_ id - ID of the resource.
- timeouts
Postgres
Audit Log File Timeouts Args
- 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 Property Map
- Filter conditions.
- postgres
Audit StringLog File Id - 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:
- Download
Url string - Download URL.
- File
Name string - Audit log file name.
- File
Size double - 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 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.
- download
Url String - Download URL.
- file
Name String - Audit log file name.
- file
Size Double - 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.
- 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.
- 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.
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) -> PostgresAuditLogFilefunc 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.
- 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 double - File size in MB.
- Filter
Postgres
Audit Log File Filter - Filter conditions.
- Instance
Id string - Instance ID.
- Postgres
Audit stringLog File Id - 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
Postgres
Audit Log File Timeouts
- 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 float64 - File size in MB.
- Filter
Postgres
Audit Log File Filter Args - Filter conditions.
- Instance
Id string - Instance ID.
- Postgres
Audit stringLog File Id - 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
Postgres
Audit Log File Timeouts Args
- 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_ stringlog_ file_ id - 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
- 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 Double - File size in MB.
- filter
Postgres
Audit Log File Filter - Filter conditions.
- instance
Id String - Instance ID.
- postgres
Audit StringLog File Id - 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
Postgres
Audit Log File Timeouts
- 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
Postgres
Audit Log File Filter - Filter conditions.
- instance
Id string - Instance ID.
- postgres
Audit stringLog File Id - 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
Postgres
Audit Log File Timeouts
- 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
Postgres
Audit Log File Filter Args - Filter conditions.
- instance_
id str - Instance ID.
- postgres_
audit_ strlog_ file_ id - 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
Postgres
Audit Log File Timeouts Args
- 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 Property Map
- Filter conditions.
- instance
Id String - Instance ID.
- postgres
Audit StringLog File Id - 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 Property Map
Supporting Types
PostgresAuditLogFileFilter, PostgresAuditLogFileFilterArgs
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
tencentcloudTerraform Provider.
published on Monday, Sep 21, 2026 by tencentcloudstack