1. Registry
  2. Packages
  3. stackit
  4. API Docs
  5. PostgresflexUser
Viewing docs for stackit v0.0.7
published on Monday, Aug 17, 2026 by stackitcloud
stackit logo
Viewing docs for stackit v0.0.7
published on Monday, Aug 17, 2026 by stackitcloud

    Postgres Flex user resource schema. Must have a region specified in the provider configuration.

    Example Usage

    resource "stackit_postgresflex_user" "example" {
      project_id  = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      username    = "username"
      roles       = ["login"]
    }
    
    resource "time_rotating" "rotate" {
      rotation_days = 80
    }
    
    resource "stackit_postgresflex_user" "example_rotate" {
      project_id  = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      username    = "username"
      roles       = ["login"]
    
      rotate_when_changed = {
        rotation = time_rotating.rotate.id
      }
    }
    

    Create PostgresflexUser Resource

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

    Constructor syntax

    new PostgresflexUser(name: string, args: PostgresflexUserArgs, opts?: CustomResourceOptions);
    @overload
    def PostgresflexUser(resource_name: str,
                         args: PostgresflexUserArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresflexUser(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         instance_id: Optional[str] = None,
                         project_id: Optional[str] = None,
                         roles: Optional[Sequence[str]] = None,
                         username: Optional[str] = None,
                         region: Optional[str] = None,
                         rotate_when_changed: Optional[Mapping[str, str]] = None)
    func NewPostgresflexUser(ctx *Context, name string, args PostgresflexUserArgs, opts ...ResourceOption) (*PostgresflexUser, error)
    public PostgresflexUser(string name, PostgresflexUserArgs args, CustomResourceOptions? opts = null)
    public PostgresflexUser(String name, PostgresflexUserArgs args)
    public PostgresflexUser(String name, PostgresflexUserArgs args, CustomResourceOptions options)
    
    type: stackit:PostgresflexUser
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "stackit_postgresflex_user" "name" {
        # resource properties
    }

    Parameters

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

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var postgresflexUserResource = new Stackit.PostgresflexUser("postgresflexUserResource", new()
    {
        InstanceId = "string",
        ProjectId = "string",
        Roles = new[]
        {
            "string",
        },
        Username = "string",
        Region = "string",
        RotateWhenChanged = 
        {
            { "string", "string" },
        },
    });
    
    example, err := stackit.NewPostgresflexUser(ctx, "postgresflexUserResource", &stackit.PostgresflexUserArgs{
    	InstanceId: pulumi.String("string"),
    	ProjectId:  pulumi.String("string"),
    	Roles: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Username: pulumi.String("string"),
    	Region:   pulumi.String("string"),
    	RotateWhenChanged: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    resource "stackit_postgresflex_user" "postgresflexUserResource" {
      lifecycle {
        create_before_destroy = true
      }
      instance_id = "string"
      project_id  = "string"
      roles       = ["string"]
      username    = "string"
      region      = "string"
      rotate_when_changed = {
        "string" = "string"
      }
    }
    
    var postgresflexUserResource = new PostgresflexUser("postgresflexUserResource", PostgresflexUserArgs.builder()
        .instanceId("string")
        .projectId("string")
        .roles("string")
        .username("string")
        .region("string")
        .rotateWhenChanged(Map.of("string", "string"))
        .build());
    
    postgresflex_user_resource = stackit.PostgresflexUser("postgresflexUserResource",
        instance_id="string",
        project_id="string",
        roles=["string"],
        username="string",
        region="string",
        rotate_when_changed={
            "string": "string",
        })
    
    const postgresflexUserResource = new stackit.PostgresflexUser("postgresflexUserResource", {
        instanceId: "string",
        projectId: "string",
        roles: ["string"],
        username: "string",
        region: "string",
        rotateWhenChanged: {
            string: "string",
        },
    });
    
    type: stackit:PostgresflexUser
    properties:
        instanceId: string
        projectId: string
        region: string
        roles:
            - string
        rotateWhenChanged:
            string: string
        username: string
    

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

    InstanceId string
    ID of the PostgresFlex instance.
    ProjectId string
    STACKIT project ID to which the instance is associated.
    Roles List<string>
    Database access levels for the user.
    Username string
    Region string
    The resource region. If not defined, the provider region is used.
    RotateWhenChanged Dictionary<string, string>
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    InstanceId string
    ID of the PostgresFlex instance.
    ProjectId string
    STACKIT project ID to which the instance is associated.
    Roles []string
    Database access levels for the user.
    Username string
    Region string
    The resource region. If not defined, the provider region is used.
    RotateWhenChanged map[string]string
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    instance_id string
    ID of the PostgresFlex instance.
    project_id string
    STACKIT project ID to which the instance is associated.
    roles list(string)
    Database access levels for the user.
    username string
    region string
    The resource region. If not defined, the provider region is used.
    rotate_when_changed map(string)
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    instanceId String
    ID of the PostgresFlex instance.
    projectId String
    STACKIT project ID to which the instance is associated.
    roles List<String>
    Database access levels for the user.
    username String
    region String
    The resource region. If not defined, the provider region is used.
    rotateWhenChanged Map<String,String>
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    instanceId string
    ID of the PostgresFlex instance.
    projectId string
    STACKIT project ID to which the instance is associated.
    roles string[]
    Database access levels for the user.
    username string
    region string
    The resource region. If not defined, the provider region is used.
    rotateWhenChanged {[key: string]: string}
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    instance_id str
    ID of the PostgresFlex instance.
    project_id str
    STACKIT project ID to which the instance is associated.
    roles Sequence[str]
    Database access levels for the user.
    username str
    region str
    The resource region. If not defined, the provider region is used.
    rotate_when_changed Mapping[str, str]
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    instanceId String
    ID of the PostgresFlex instance.
    projectId String
    STACKIT project ID to which the instance is associated.
    roles List<String>
    Database access levels for the user.
    username String
    region String
    The resource region. If not defined, the provider region is used.
    rotateWhenChanged Map<String>
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.

    Outputs

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

    Host string

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    Id string
    The provider-assigned unique ID for this managed resource.
    Password string
    Port int

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    Uri string

    Deprecated: uri is deprecated and will be removed after February 2027.

    UserId string
    User ID.
    Host string

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    Id string
    The provider-assigned unique ID for this managed resource.
    Password string
    Port int

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    Uri string

    Deprecated: uri is deprecated and will be removed after February 2027.

    UserId string
    User ID.
    host string

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    id string
    The provider-assigned unique ID for this managed resource.
    password string
    port number

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    uri string

    Deprecated: uri is deprecated and will be removed after February 2027.

    user_id string
    User ID.
    host String

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    id String
    The provider-assigned unique ID for this managed resource.
    password String
    port Integer

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    uri String

    Deprecated: uri is deprecated and will be removed after February 2027.

    userId String
    User ID.
    host string

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    id string
    The provider-assigned unique ID for this managed resource.
    password string
    port number

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    uri string

    Deprecated: uri is deprecated and will be removed after February 2027.

    userId string
    User ID.
    host str

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    id str
    The provider-assigned unique ID for this managed resource.
    password str
    port int

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    uri str

    Deprecated: uri is deprecated and will be removed after February 2027.

    user_id str
    User ID.
    host String

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    id String
    The provider-assigned unique ID for this managed resource.
    password String
    port Number

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    uri String

    Deprecated: uri is deprecated and will be removed after February 2027.

    userId String
    User ID.

    Look up Existing PostgresflexUser Resource

    Get an existing PostgresflexUser 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?: PostgresflexUserState, opts?: CustomResourceOptions): PostgresflexUser
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            host: Optional[str] = None,
            instance_id: Optional[str] = None,
            password: Optional[str] = None,
            port: Optional[int] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            roles: Optional[Sequence[str]] = None,
            rotate_when_changed: Optional[Mapping[str, str]] = None,
            uri: Optional[str] = None,
            user_id: Optional[str] = None,
            username: Optional[str] = None) -> PostgresflexUser
    func GetPostgresflexUser(ctx *Context, name string, id IDInput, state *PostgresflexUserState, opts ...ResourceOption) (*PostgresflexUser, error)
    public static PostgresflexUser Get(string name, Input<string> id, PostgresflexUserState? state, CustomResourceOptions? opts = null)
    public static PostgresflexUser get(String name, Output<String> id, PostgresflexUserState state, CustomResourceOptions options)
    resources:  _:    type: stackit:PostgresflexUser    get:      id: ${id}
    import {
      to = stackit_postgresflex_user.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:
    Host string

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    InstanceId string
    ID of the PostgresFlex instance.
    Password string
    Port int

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    ProjectId string
    STACKIT project ID to which the instance is associated.
    Region string
    The resource region. If not defined, the provider region is used.
    Roles List<string>
    Database access levels for the user.
    RotateWhenChanged Dictionary<string, string>
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    Uri string

    Deprecated: uri is deprecated and will be removed after February 2027.

    UserId string
    User ID.
    Username string
    Host string

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    InstanceId string
    ID of the PostgresFlex instance.
    Password string
    Port int

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    ProjectId string
    STACKIT project ID to which the instance is associated.
    Region string
    The resource region. If not defined, the provider region is used.
    Roles []string
    Database access levels for the user.
    RotateWhenChanged map[string]string
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    Uri string

    Deprecated: uri is deprecated and will be removed after February 2027.

    UserId string
    User ID.
    Username string
    host string

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    instance_id string
    ID of the PostgresFlex instance.
    password string
    port number

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    project_id string
    STACKIT project ID to which the instance is associated.
    region string
    The resource region. If not defined, the provider region is used.
    roles list(string)
    Database access levels for the user.
    rotate_when_changed map(string)
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    uri string

    Deprecated: uri is deprecated and will be removed after February 2027.

    user_id string
    User ID.
    username string
    host String

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    instanceId String
    ID of the PostgresFlex instance.
    password String
    port Integer

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    projectId String
    STACKIT project ID to which the instance is associated.
    region String
    The resource region. If not defined, the provider region is used.
    roles List<String>
    Database access levels for the user.
    rotateWhenChanged Map<String,String>
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    uri String

    Deprecated: uri is deprecated and will be removed after February 2027.

    userId String
    User ID.
    username String
    host string

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    instanceId string
    ID of the PostgresFlex instance.
    password string
    port number

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    projectId string
    STACKIT project ID to which the instance is associated.
    region string
    The resource region. If not defined, the provider region is used.
    roles string[]
    Database access levels for the user.
    rotateWhenChanged {[key: string]: string}
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    uri string

    Deprecated: uri is deprecated and will be removed after February 2027.

    userId string
    User ID.
    username string
    host str

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    instance_id str
    ID of the PostgresFlex instance.
    password str
    port int

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    project_id str
    STACKIT project ID to which the instance is associated.
    region str
    The resource region. If not defined, the provider region is used.
    roles Sequence[str]
    Database access levels for the user.
    rotate_when_changed Mapping[str, str]
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    uri str

    Deprecated: uri is deprecated and will be removed after February 2027.

    user_id str
    User ID.
    username str
    host String

    Deprecated: host is deprecated and will be removed after February 2027. The host can be retrieved from the instance in connection_info.write.host.

    instanceId String
    ID of the PostgresFlex instance.
    password String
    port Number

    Deprecated: port is deprecated and will be removed after February 2027. The port can be retrieved from the instance in connection_info.write.port.

    projectId String
    STACKIT project ID to which the instance is associated.
    region String
    The resource region. If not defined, the provider region is used.
    roles List<String>
    Database access levels for the user.
    rotateWhenChanged Map<String>
    A map of arbitrary key/value pairs that will force recreation of the resource when they change, enabling resource rotation based on external conditions such as a rotating timestamp. Changing this forces a new resource to be created.
    uri String

    Deprecated: uri is deprecated and will be removed after February 2027.

    userId String
    User ID.
    username String

    Import

    In Terraform v1.5.0 and later, the + "" + import + “" + block can be used with the + "” + id + “" + attribute, for example:

    # Only use the import statement, if you want to import an existing postgresflex user
    import {
      to = stackit_postgresflex_user.import-example
      id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.user_id}"
    }
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    stackit stackitcloud/pulumi-stackit
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the stackit Terraform Provider.
    stackit logo
    Viewing docs for stackit v0.0.7
    published on Monday, Aug 17, 2026 by stackitcloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial