1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getPostgresqlAccountPrivileges
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getPostgresqlAccountPrivileges

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query detailed information of postgresql account privileges

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = tencentcloud.getPostgresqlAccountPrivileges({
        databaseObjectSets: [{
            objectName: "postgres",
            objectType: "database",
        }],
        dbInstanceId: "postgres-3hk6b6tj",
        userName: "tf_example",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.get_postgresql_account_privileges(database_object_sets=[{
            "object_name": "postgres",
            "object_type": "database",
        }],
        db_instance_id="postgres-3hk6b6tj",
        user_name="tf_example")
    
    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.GetPostgresqlAccountPrivileges(ctx, &tencentcloud.GetPostgresqlAccountPrivilegesArgs{
    			DatabaseObjectSets: []tencentcloud.GetPostgresqlAccountPrivilegesDatabaseObjectSet{
    				{
    					ObjectName: "postgres",
    					ObjectType: "database",
    				},
    			},
    			DbInstanceId: "postgres-3hk6b6tj",
    			UserName:     "tf_example",
    		}, nil)
    		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 = Tencentcloud.GetPostgresqlAccountPrivileges.Invoke(new()
        {
            DatabaseObjectSets = new[]
            {
                new Tencentcloud.Inputs.GetPostgresqlAccountPrivilegesDatabaseObjectSetInputArgs
                {
                    ObjectName = "postgres",
                    ObjectType = "database",
                },
            },
            DbInstanceId = "postgres-3hk6b6tj",
            UserName = "tf_example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetPostgresqlAccountPrivilegesArgs;
    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) {
            final var example = TencentcloudFunctions.getPostgresqlAccountPrivileges(GetPostgresqlAccountPrivilegesArgs.builder()
                .databaseObjectSets(GetPostgresqlAccountPrivilegesDatabaseObjectSetArgs.builder()
                    .objectName("postgres")
                    .objectType("database")
                    .build())
                .dbInstanceId("postgres-3hk6b6tj")
                .userName("tf_example")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: tencentcloud:getPostgresqlAccountPrivileges
          arguments:
            databaseObjectSets:
              - objectName: postgres
                objectType: database
            dbInstanceId: postgres-3hk6b6tj
            userName: tf_example
    

    Using getPostgresqlAccountPrivileges

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getPostgresqlAccountPrivileges(args: GetPostgresqlAccountPrivilegesArgs, opts?: InvokeOptions): Promise<GetPostgresqlAccountPrivilegesResult>
    function getPostgresqlAccountPrivilegesOutput(args: GetPostgresqlAccountPrivilegesOutputArgs, opts?: InvokeOptions): Output<GetPostgresqlAccountPrivilegesResult>
    def get_postgresql_account_privileges(database_object_sets: Optional[Sequence[GetPostgresqlAccountPrivilegesDatabaseObjectSet]] = None,
                                          db_instance_id: Optional[str] = None,
                                          id: Optional[str] = None,
                                          result_output_file: Optional[str] = None,
                                          user_name: Optional[str] = None,
                                          opts: Optional[InvokeOptions] = None) -> GetPostgresqlAccountPrivilegesResult
    def get_postgresql_account_privileges_output(database_object_sets: Optional[pulumi.Input[Sequence[pulumi.Input[GetPostgresqlAccountPrivilegesDatabaseObjectSetArgs]]]] = None,
                                          db_instance_id: Optional[pulumi.Input[str]] = None,
                                          id: Optional[pulumi.Input[str]] = None,
                                          result_output_file: Optional[pulumi.Input[str]] = None,
                                          user_name: Optional[pulumi.Input[str]] = None,
                                          opts: Optional[InvokeOptions] = None) -> Output[GetPostgresqlAccountPrivilegesResult]
    func GetPostgresqlAccountPrivileges(ctx *Context, args *GetPostgresqlAccountPrivilegesArgs, opts ...InvokeOption) (*GetPostgresqlAccountPrivilegesResult, error)
    func GetPostgresqlAccountPrivilegesOutput(ctx *Context, args *GetPostgresqlAccountPrivilegesOutputArgs, opts ...InvokeOption) GetPostgresqlAccountPrivilegesResultOutput

    > Note: This function is named GetPostgresqlAccountPrivileges in the Go SDK.

    public static class GetPostgresqlAccountPrivileges 
    {
        public static Task<GetPostgresqlAccountPrivilegesResult> InvokeAsync(GetPostgresqlAccountPrivilegesArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresqlAccountPrivilegesResult> Invoke(GetPostgresqlAccountPrivilegesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPostgresqlAccountPrivilegesResult> getPostgresqlAccountPrivileges(GetPostgresqlAccountPrivilegesArgs args, InvokeOptions options)
    public static Output<GetPostgresqlAccountPrivilegesResult> getPostgresqlAccountPrivileges(GetPostgresqlAccountPrivilegesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getPostgresqlAccountPrivileges:getPostgresqlAccountPrivileges
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DatabaseObjectSets List<GetPostgresqlAccountPrivilegesDatabaseObjectSet>
    Instance database object info.
    DbInstanceId string
    Instance ID.
    UserName string
    Instance username.
    Id string
    ResultOutputFile string
    Used to save results.
    DatabaseObjectSets []GetPostgresqlAccountPrivilegesDatabaseObjectSet
    Instance database object info.
    DbInstanceId string
    Instance ID.
    UserName string
    Instance username.
    Id string
    ResultOutputFile string
    Used to save results.
    databaseObjectSets List<GetPostgresqlAccountPrivilegesDatabaseObjectSet>
    Instance database object info.
    dbInstanceId String
    Instance ID.
    userName String
    Instance username.
    id String
    resultOutputFile String
    Used to save results.
    databaseObjectSets GetPostgresqlAccountPrivilegesDatabaseObjectSet[]
    Instance database object info.
    dbInstanceId string
    Instance ID.
    userName string
    Instance username.
    id string
    resultOutputFile string
    Used to save results.
    database_object_sets Sequence[GetPostgresqlAccountPrivilegesDatabaseObjectSet]
    Instance database object info.
    db_instance_id str
    Instance ID.
    user_name str
    Instance username.
    id str
    result_output_file str
    Used to save results.
    databaseObjectSets List<Property Map>
    Instance database object info.
    dbInstanceId String
    Instance ID.
    userName String
    Instance username.
    id String
    resultOutputFile String
    Used to save results.

    getPostgresqlAccountPrivileges Result

    The following output properties are available:

    DatabaseObjectSets List<GetPostgresqlAccountPrivilegesDatabaseObjectSet>
    DbInstanceId string
    Id string
    PrivilegeSets List<GetPostgresqlAccountPrivilegesPrivilegeSet>
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    UserName string
    ResultOutputFile string
    DatabaseObjectSets []GetPostgresqlAccountPrivilegesDatabaseObjectSet
    DbInstanceId string
    Id string
    PrivilegeSets []GetPostgresqlAccountPrivilegesPrivilegeSet
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    UserName string
    ResultOutputFile string
    databaseObjectSets List<GetPostgresqlAccountPrivilegesDatabaseObjectSet>
    dbInstanceId String
    id String
    privilegeSets List<GetPostgresqlAccountPrivilegesPrivilegeSet>
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    userName String
    resultOutputFile String
    databaseObjectSets GetPostgresqlAccountPrivilegesDatabaseObjectSet[]
    dbInstanceId string
    id string
    privilegeSets GetPostgresqlAccountPrivilegesPrivilegeSet[]
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    userName string
    resultOutputFile string
    database_object_sets Sequence[GetPostgresqlAccountPrivilegesDatabaseObjectSet]
    db_instance_id str
    id str
    privilege_sets Sequence[GetPostgresqlAccountPrivilegesPrivilegeSet]
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    user_name str
    result_output_file str
    databaseObjectSets List<Property Map>
    dbInstanceId String
    id String
    privilegeSets List<Property Map>
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    userName String
    resultOutputFile String

    Supporting Types

    GetPostgresqlAccountPrivilegesDatabaseObjectSet

    ObjectName string
    Database object Name.Note: This field may return null, indicating that no valid value can be obtained.
    ObjectType string
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    DatabaseName string
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database.Note: This field may return null, indicating that no valid value can be obtained.
    SchemaName string
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema.Note: This field may return null, indicating that no valid value can be obtained.
    TableName string
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column.Note: This field may return null, indicating that no valid value can be obtained.
    ObjectName string
    Database object Name.Note: This field may return null, indicating that no valid value can be obtained.
    ObjectType string
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    DatabaseName string
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database.Note: This field may return null, indicating that no valid value can be obtained.
    SchemaName string
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema.Note: This field may return null, indicating that no valid value can be obtained.
    TableName string
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column.Note: This field may return null, indicating that no valid value can be obtained.
    objectName String
    Database object Name.Note: This field may return null, indicating that no valid value can be obtained.
    objectType String
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    databaseName String
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database.Note: This field may return null, indicating that no valid value can be obtained.
    schemaName String
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema.Note: This field may return null, indicating that no valid value can be obtained.
    tableName String
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column.Note: This field may return null, indicating that no valid value can be obtained.
    objectName string
    Database object Name.Note: This field may return null, indicating that no valid value can be obtained.
    objectType string
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    databaseName string
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database.Note: This field may return null, indicating that no valid value can be obtained.
    schemaName string
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema.Note: This field may return null, indicating that no valid value can be obtained.
    tableName string
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column.Note: This field may return null, indicating that no valid value can be obtained.
    object_name str
    Database object Name.Note: This field may return null, indicating that no valid value can be obtained.
    object_type str
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    database_name str
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database.Note: This field may return null, indicating that no valid value can be obtained.
    schema_name str
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema.Note: This field may return null, indicating that no valid value can be obtained.
    table_name str
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column.Note: This field may return null, indicating that no valid value can be obtained.
    objectName String
    Database object Name.Note: This field may return null, indicating that no valid value can be obtained.
    objectType String
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    databaseName String
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database.Note: This field may return null, indicating that no valid value can be obtained.
    schemaName String
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema.Note: This field may return null, indicating that no valid value can be obtained.
    tableName String
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column.Note: This field may return null, indicating that no valid value can be obtained.

    GetPostgresqlAccountPrivilegesPrivilegeSet

    Objects List<GetPostgresqlAccountPrivilegesPrivilegeSetObject>
    Database object.If ObjectType is database, DatabaseName/SchemaName/TableName can be null.If ObjectType is schema, SchemaName/TableName can be null.If ObjectType is table, TableName can be null.If ObjectType is column, DatabaseName/SchemaName/TableName can&#39;t be null.In all other cases, DatabaseName/SchemaName/TableName can be null. Note: This field may return null, indicating that no valid value can be obtained.
    PrivilegeSets List<string>
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    Objects []GetPostgresqlAccountPrivilegesPrivilegeSetObject
    Database object.If ObjectType is database, DatabaseName/SchemaName/TableName can be null.If ObjectType is schema, SchemaName/TableName can be null.If ObjectType is table, TableName can be null.If ObjectType is column, DatabaseName/SchemaName/TableName can&#39;t be null.In all other cases, DatabaseName/SchemaName/TableName can be null. Note: This field may return null, indicating that no valid value can be obtained.
    PrivilegeSets []string
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    objects List<GetPostgresqlAccountPrivilegesPrivilegeSetObject>
    Database object.If ObjectType is database, DatabaseName/SchemaName/TableName can be null.If ObjectType is schema, SchemaName/TableName can be null.If ObjectType is table, TableName can be null.If ObjectType is column, DatabaseName/SchemaName/TableName can&#39;t be null.In all other cases, DatabaseName/SchemaName/TableName can be null. Note: This field may return null, indicating that no valid value can be obtained.
    privilegeSets List<String>
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    objects GetPostgresqlAccountPrivilegesPrivilegeSetObject[]
    Database object.If ObjectType is database, DatabaseName/SchemaName/TableName can be null.If ObjectType is schema, SchemaName/TableName can be null.If ObjectType is table, TableName can be null.If ObjectType is column, DatabaseName/SchemaName/TableName can&#39;t be null.In all other cases, DatabaseName/SchemaName/TableName can be null. Note: This field may return null, indicating that no valid value can be obtained.
    privilegeSets string[]
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    objects Sequence[GetPostgresqlAccountPrivilegesPrivilegeSetObject]
    Database object.If ObjectType is database, DatabaseName/SchemaName/TableName can be null.If ObjectType is schema, SchemaName/TableName can be null.If ObjectType is table, TableName can be null.If ObjectType is column, DatabaseName/SchemaName/TableName can&#39;t be null.In all other cases, DatabaseName/SchemaName/TableName can be null. Note: This field may return null, indicating that no valid value can be obtained.
    privilege_sets Sequence[str]
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.
    objects List<Property Map>
    Database object.If ObjectType is database, DatabaseName/SchemaName/TableName can be null.If ObjectType is schema, SchemaName/TableName can be null.If ObjectType is table, TableName can be null.If ObjectType is column, DatabaseName/SchemaName/TableName can&#39;t be null.In all other cases, DatabaseName/SchemaName/TableName can be null. Note: This field may return null, indicating that no valid value can be obtained.
    privilegeSets List<String>
    Privileges the specific account has on database object. Note: This field may return null, indicating that no valid value can be obtained.

    GetPostgresqlAccountPrivilegesPrivilegeSetObject

    DatabaseName string
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database. Note: This field may return null, indicating that no valid value can be obtained.
    ObjectName string
    Database object Name. Note: This field may return null, indicating that no valid value can be obtained.
    ObjectType string
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    SchemaName string
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema. Note: This field may return null, indicating that no valid value can be obtained.
    TableName string
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column. Note: This field may return null, indicating that no valid value can be obtained.
    DatabaseName string
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database. Note: This field may return null, indicating that no valid value can be obtained.
    ObjectName string
    Database object Name. Note: This field may return null, indicating that no valid value can be obtained.
    ObjectType string
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    SchemaName string
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema. Note: This field may return null, indicating that no valid value can be obtained.
    TableName string
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column. Note: This field may return null, indicating that no valid value can be obtained.
    databaseName String
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database. Note: This field may return null, indicating that no valid value can be obtained.
    objectName String
    Database object Name. Note: This field may return null, indicating that no valid value can be obtained.
    objectType String
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    schemaName String
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema. Note: This field may return null, indicating that no valid value can be obtained.
    tableName String
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column. Note: This field may return null, indicating that no valid value can be obtained.
    databaseName string
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database. Note: This field may return null, indicating that no valid value can be obtained.
    objectName string
    Database object Name. Note: This field may return null, indicating that no valid value can be obtained.
    objectType string
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    schemaName string
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema. Note: This field may return null, indicating that no valid value can be obtained.
    tableName string
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column. Note: This field may return null, indicating that no valid value can be obtained.
    database_name str
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database. Note: This field may return null, indicating that no valid value can be obtained.
    object_name str
    Database object Name. Note: This field may return null, indicating that no valid value can be obtained.
    object_type str
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    schema_name str
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema. Note: This field may return null, indicating that no valid value can be obtained.
    table_name str
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column. Note: This field may return null, indicating that no valid value can be obtained.
    databaseName String
    Database name to which the database object belongs. This parameter is mandatory when ObjectType is not database. Note: This field may return null, indicating that no valid value can be obtained.
    objectName String
    Database object Name. Note: This field may return null, indicating that no valid value can be obtained.
    objectType String
    Supported database object types: account, database, schema, sequence, procedure, type, function, table, view, matview, column. Note: This field may return null, indicating that no valid value can be obtained.
    schemaName String
    Schema name to which the database object belongs. This parameter is mandatory when ObjectType is not database or schema. Note: This field may return null, indicating that no valid value can be obtained.
    tableName String
    Table name to which the database object belongs. This parameter is mandatory when ObjectType is column. Note: This field may return null, indicating that no valid value can be obtained.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack