published on Friday, Jun 19, 2026 by tencentcloudstack
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:
- Audit
Type string - Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
- Hot
Log doubleExpire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- Instance
Id string - PostgreSQL instance ID.
- Log
Expire doubleDay - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- Postgres
Audit stringService Id - ID of the resource.
- Audit
Type string - Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
- Hot
Log float64Expire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- Instance
Id string - PostgreSQL instance ID.
- Log
Expire float64Day - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- Postgres
Audit stringService Id - ID of the resource.
- audit_
type string - Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
- hot_
log_ numberexpire_ day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- instance_
id string - PostgreSQL instance ID.
- log_
expire_ numberday - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres_
audit_ stringservice_ id - ID of the resource.
- audit
Type String - Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
- hot
Log DoubleExpire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- instance
Id String - PostgreSQL instance ID.
- log
Expire DoubleDay - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres
Audit StringService Id - ID of the resource.
- audit
Type string - Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
- hot
Log numberExpire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- instance
Id string - PostgreSQL instance ID.
- log
Expire numberDay - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres
Audit stringService Id - ID of the resource.
- audit_
type str - Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
- hot_
log_ floatexpire_ day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- instance_
id str - PostgreSQL instance ID.
- log_
expire_ floatday - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres_
audit_ strservice_ id - ID of the resource.
- audit
Type String - Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
- hot
Log NumberExpire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- instance
Id String - PostgreSQL instance ID.
- log
Expire NumberDay - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres
Audit StringService Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the PostgresAuditService resource produces the following output properties:
- Audit
Status string - Audit status. Values: ON, OFF.
- Cold
Log doubleExpire Day - Cold log retention days.
- Cold
Log doubleSize - Cold log size in MB.
- Hot
Log doubleSize - 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 float64Expire Day - Cold log retention days.
- Cold
Log float64Size - Cold log size in MB.
- Hot
Log float64Size - 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_ numberexpire_ day - Cold log retention days.
- cold_
log_ numbersize - Cold log size in MB.
- hot_
log_ numbersize - 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 DoubleExpire Day - Cold log retention days.
- cold
Log DoubleSize - Cold log size in MB.
- hot
Log DoubleSize - 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 numberExpire Day - Cold log retention days.
- cold
Log numberSize - Cold log size in MB.
- hot
Log numberSize - 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_ floatexpire_ day - Cold log retention days.
- cold_
log_ floatsize - Cold log size in MB.
- hot_
log_ floatsize - Hot log size in MB.
- id str
- The provider-assigned unique ID for this managed resource.
- audit
Status String - Audit status. Values: ON, OFF.
- cold
Log NumberExpire Day - Cold log retention days.
- cold
Log NumberSize - Cold log size in MB.
- hot
Log NumberSize - 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) -> PostgresAuditServicefunc 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.
- Audit
Status string - Audit status. Values: ON, OFF.
- Audit
Type string - Audit type. Valid values: complex (fine-grained audit), simple (fast audit).
- Cold
Log doubleExpire Day - Cold log retention days.
- Cold
Log doubleSize - Cold log size in MB.
- Hot
Log doubleExpire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- Hot
Log doubleSize - Hot log size in MB.
- Instance
Id string - PostgreSQL instance ID.
- Log
Expire doubleDay - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- Postgres
Audit stringService Id - 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 float64Expire Day - Cold log retention days.
- Cold
Log float64Size - Cold log size in MB.
- Hot
Log float64Expire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- Hot
Log float64Size - Hot log size in MB.
- Instance
Id string - PostgreSQL instance ID.
- Log
Expire float64Day - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- Postgres
Audit stringService Id - 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_ numberexpire_ day - Cold log retention days.
- cold_
log_ numbersize - Cold log size in MB.
- hot_
log_ numberexpire_ day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- hot_
log_ numbersize - Hot log size in MB.
- instance_
id string - PostgreSQL instance ID.
- log_
expire_ numberday - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres_
audit_ stringservice_ id - 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 DoubleExpire Day - Cold log retention days.
- cold
Log DoubleSize - Cold log size in MB.
- hot
Log DoubleExpire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- hot
Log DoubleSize - Hot log size in MB.
- instance
Id String - PostgreSQL instance ID.
- log
Expire DoubleDay - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres
Audit StringService Id - 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 numberExpire Day - Cold log retention days.
- cold
Log numberSize - Cold log size in MB.
- hot
Log numberExpire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- hot
Log numberSize - Hot log size in MB.
- instance
Id string - PostgreSQL instance ID.
- log
Expire numberDay - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres
Audit stringService Id - 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_ floatexpire_ day - Cold log retention days.
- cold_
log_ floatsize - Cold log size in MB.
- hot_
log_ floatexpire_ day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- hot_
log_ floatsize - Hot log size in MB.
- instance_
id str - PostgreSQL instance ID.
- log_
expire_ floatday - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres_
audit_ strservice_ id - 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 NumberExpire Day - Cold log retention days.
- cold
Log NumberSize - Cold log size in MB.
- hot
Log NumberExpire Day - Hot log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- hot
Log NumberSize - Hot log size in MB.
- instance
Id String - PostgreSQL instance ID.
- log
Expire NumberDay - Log retention days. Valid values: 7, 30, 90, 180, 365, 1095, 1825.
- postgres
Audit StringService Id - 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
tencentcloudTerraform Provider.
published on Friday, Jun 19, 2026 by tencentcloudstack