1. Packages
  2. dbt Cloud
  3. API Docs
  4. PostgresCredential
dbt Cloud v0.1.10 published on Thursday, Jul 18, 2024 by Pulumi

dbtcloud.PostgresCredential

Explore with Pulumi AI

dbtcloud logo
dbt Cloud v0.1.10 published on Thursday, Jul 18, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dbtcloud from "@pulumi/dbtcloud";
    
    const postgresProdCredential = new dbtcloud.PostgresCredential("postgres_prod_credential", {
        isActive: true,
        projectId: dbtProject.id,
        type: "postgres",
        defaultSchema: "my_schema",
        username: "my_username",
        password: "my_password",
        numThreads: 16,
    });
    
    import pulumi
    import pulumi_dbtcloud as dbtcloud
    
    postgres_prod_credential = dbtcloud.PostgresCredential("postgres_prod_credential",
        is_active=True,
        project_id=dbt_project["id"],
        type="postgres",
        default_schema="my_schema",
        username="my_username",
        password="my_password",
        num_threads=16)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-dbtcloud/sdk/go/dbtcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbtcloud.NewPostgresCredential(ctx, "postgres_prod_credential", &dbtcloud.PostgresCredentialArgs{
    			IsActive:      pulumi.Bool(true),
    			ProjectId:     pulumi.Any(dbtProject.Id),
    			Type:          pulumi.String("postgres"),
    			DefaultSchema: pulumi.String("my_schema"),
    			Username:      pulumi.String("my_username"),
    			Password:      pulumi.String("my_password"),
    			NumThreads:    pulumi.Int(16),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DbtCloud = Pulumi.DbtCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var postgresProdCredential = new DbtCloud.PostgresCredential("postgres_prod_credential", new()
        {
            IsActive = true,
            ProjectId = dbtProject.Id,
            Type = "postgres",
            DefaultSchema = "my_schema",
            Username = "my_username",
            Password = "my_password",
            NumThreads = 16,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dbtcloud.PostgresCredential;
    import com.pulumi.dbtcloud.PostgresCredentialArgs;
    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 postgresProdCredential = new PostgresCredential("postgresProdCredential", PostgresCredentialArgs.builder()
                .isActive(true)
                .projectId(dbtProject.id())
                .type("postgres")
                .defaultSchema("my_schema")
                .username("my_username")
                .password("my_password")
                .numThreads(16)
                .build());
    
        }
    }
    
    resources:
      postgresProdCredential:
        type: dbtcloud:PostgresCredential
        name: postgres_prod_credential
        properties:
          isActive: true
          projectId: ${dbtProject.id}
          type: postgres
          defaultSchema: my_schema
          username: my_username
          password: my_password
          numThreads: 16
    

    Create PostgresCredential Resource

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

    Constructor syntax

    new PostgresCredential(name: string, args: PostgresCredentialArgs, opts?: CustomResourceOptions);
    @overload
    def PostgresCredential(resource_name: str,
                           args: PostgresCredentialArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresCredential(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           default_schema: Optional[str] = None,
                           project_id: Optional[int] = None,
                           type: Optional[str] = None,
                           username: Optional[str] = None,
                           is_active: Optional[bool] = None,
                           num_threads: Optional[int] = None,
                           password: Optional[str] = None,
                           target_name: Optional[str] = None)
    func NewPostgresCredential(ctx *Context, name string, args PostgresCredentialArgs, opts ...ResourceOption) (*PostgresCredential, error)
    public PostgresCredential(string name, PostgresCredentialArgs args, CustomResourceOptions? opts = null)
    public PostgresCredential(String name, PostgresCredentialArgs args)
    public PostgresCredential(String name, PostgresCredentialArgs args, CustomResourceOptions options)
    
    type: dbtcloud:PostgresCredential
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PostgresCredentialArgs
    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 PostgresCredentialArgs
    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 PostgresCredentialArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PostgresCredentialArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PostgresCredentialArgs
    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 postgresCredentialResource = new DbtCloud.PostgresCredential("postgresCredentialResource", new()
    {
        DefaultSchema = "string",
        ProjectId = 0,
        Type = "string",
        Username = "string",
        IsActive = false,
        NumThreads = 0,
        Password = "string",
        TargetName = "string",
    });
    
    example, err := dbtcloud.NewPostgresCredential(ctx, "postgresCredentialResource", &dbtcloud.PostgresCredentialArgs{
    	DefaultSchema: pulumi.String("string"),
    	ProjectId:     pulumi.Int(0),
    	Type:          pulumi.String("string"),
    	Username:      pulumi.String("string"),
    	IsActive:      pulumi.Bool(false),
    	NumThreads:    pulumi.Int(0),
    	Password:      pulumi.String("string"),
    	TargetName:    pulumi.String("string"),
    })
    
    var postgresCredentialResource = new PostgresCredential("postgresCredentialResource", PostgresCredentialArgs.builder()
        .defaultSchema("string")
        .projectId(0)
        .type("string")
        .username("string")
        .isActive(false)
        .numThreads(0)
        .password("string")
        .targetName("string")
        .build());
    
    postgres_credential_resource = dbtcloud.PostgresCredential("postgresCredentialResource",
        default_schema="string",
        project_id=0,
        type="string",
        username="string",
        is_active=False,
        num_threads=0,
        password="string",
        target_name="string")
    
    const postgresCredentialResource = new dbtcloud.PostgresCredential("postgresCredentialResource", {
        defaultSchema: "string",
        projectId: 0,
        type: "string",
        username: "string",
        isActive: false,
        numThreads: 0,
        password: "string",
        targetName: "string",
    });
    
    type: dbtcloud:PostgresCredential
    properties:
        defaultSchema: string
        isActive: false
        numThreads: 0
        password: string
        projectId: 0
        targetName: string
        type: string
        username: string
    

    PostgresCredential Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The PostgresCredential resource accepts the following input properties:

    DefaultSchema string
    Default schema name
    ProjectId int
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    Type string
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    Username string
    Username for Postgres/Redshift/AlloyDB
    IsActive bool
    Whether the Postgres/Redshift/AlloyDB credential is active
    NumThreads int
    Number of threads to use
    Password string
    Password for Postgres/Redshift/AlloyDB
    TargetName string
    Default schema name
    DefaultSchema string
    Default schema name
    ProjectId int
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    Type string
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    Username string
    Username for Postgres/Redshift/AlloyDB
    IsActive bool
    Whether the Postgres/Redshift/AlloyDB credential is active
    NumThreads int
    Number of threads to use
    Password string
    Password for Postgres/Redshift/AlloyDB
    TargetName string
    Default schema name
    defaultSchema String
    Default schema name
    projectId Integer
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    type String
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    username String
    Username for Postgres/Redshift/AlloyDB
    isActive Boolean
    Whether the Postgres/Redshift/AlloyDB credential is active
    numThreads Integer
    Number of threads to use
    password String
    Password for Postgres/Redshift/AlloyDB
    targetName String
    Default schema name
    defaultSchema string
    Default schema name
    projectId number
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    type string
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    username string
    Username for Postgres/Redshift/AlloyDB
    isActive boolean
    Whether the Postgres/Redshift/AlloyDB credential is active
    numThreads number
    Number of threads to use
    password string
    Password for Postgres/Redshift/AlloyDB
    targetName string
    Default schema name
    default_schema str
    Default schema name
    project_id int
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    type str
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    username str
    Username for Postgres/Redshift/AlloyDB
    is_active bool
    Whether the Postgres/Redshift/AlloyDB credential is active
    num_threads int
    Number of threads to use
    password str
    Password for Postgres/Redshift/AlloyDB
    target_name str
    Default schema name
    defaultSchema String
    Default schema name
    projectId Number
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    type String
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    username String
    Username for Postgres/Redshift/AlloyDB
    isActive Boolean
    Whether the Postgres/Redshift/AlloyDB credential is active
    numThreads Number
    Number of threads to use
    password String
    Password for Postgres/Redshift/AlloyDB
    targetName String
    Default schema name

    Outputs

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

    CredentialId int
    The system Postgres/Redshift/AlloyDB credential ID
    Id string
    The provider-assigned unique ID for this managed resource.
    CredentialId int
    The system Postgres/Redshift/AlloyDB credential ID
    Id string
    The provider-assigned unique ID for this managed resource.
    credentialId Integer
    The system Postgres/Redshift/AlloyDB credential ID
    id String
    The provider-assigned unique ID for this managed resource.
    credentialId number
    The system Postgres/Redshift/AlloyDB credential ID
    id string
    The provider-assigned unique ID for this managed resource.
    credential_id int
    The system Postgres/Redshift/AlloyDB credential ID
    id str
    The provider-assigned unique ID for this managed resource.
    credentialId Number
    The system Postgres/Redshift/AlloyDB credential ID
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PostgresCredential Resource

    Get an existing PostgresCredential 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?: PostgresCredentialState, opts?: CustomResourceOptions): PostgresCredential
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            credential_id: Optional[int] = None,
            default_schema: Optional[str] = None,
            is_active: Optional[bool] = None,
            num_threads: Optional[int] = None,
            password: Optional[str] = None,
            project_id: Optional[int] = None,
            target_name: Optional[str] = None,
            type: Optional[str] = None,
            username: Optional[str] = None) -> PostgresCredential
    func GetPostgresCredential(ctx *Context, name string, id IDInput, state *PostgresCredentialState, opts ...ResourceOption) (*PostgresCredential, error)
    public static PostgresCredential Get(string name, Input<string> id, PostgresCredentialState? state, CustomResourceOptions? opts = null)
    public static PostgresCredential get(String name, Output<String> id, PostgresCredentialState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    CredentialId int
    The system Postgres/Redshift/AlloyDB credential ID
    DefaultSchema string
    Default schema name
    IsActive bool
    Whether the Postgres/Redshift/AlloyDB credential is active
    NumThreads int
    Number of threads to use
    Password string
    Password for Postgres/Redshift/AlloyDB
    ProjectId int
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    TargetName string
    Default schema name
    Type string
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    Username string
    Username for Postgres/Redshift/AlloyDB
    CredentialId int
    The system Postgres/Redshift/AlloyDB credential ID
    DefaultSchema string
    Default schema name
    IsActive bool
    Whether the Postgres/Redshift/AlloyDB credential is active
    NumThreads int
    Number of threads to use
    Password string
    Password for Postgres/Redshift/AlloyDB
    ProjectId int
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    TargetName string
    Default schema name
    Type string
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    Username string
    Username for Postgres/Redshift/AlloyDB
    credentialId Integer
    The system Postgres/Redshift/AlloyDB credential ID
    defaultSchema String
    Default schema name
    isActive Boolean
    Whether the Postgres/Redshift/AlloyDB credential is active
    numThreads Integer
    Number of threads to use
    password String
    Password for Postgres/Redshift/AlloyDB
    projectId Integer
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    targetName String
    Default schema name
    type String
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    username String
    Username for Postgres/Redshift/AlloyDB
    credentialId number
    The system Postgres/Redshift/AlloyDB credential ID
    defaultSchema string
    Default schema name
    isActive boolean
    Whether the Postgres/Redshift/AlloyDB credential is active
    numThreads number
    Number of threads to use
    password string
    Password for Postgres/Redshift/AlloyDB
    projectId number
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    targetName string
    Default schema name
    type string
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    username string
    Username for Postgres/Redshift/AlloyDB
    credential_id int
    The system Postgres/Redshift/AlloyDB credential ID
    default_schema str
    Default schema name
    is_active bool
    Whether the Postgres/Redshift/AlloyDB credential is active
    num_threads int
    Number of threads to use
    password str
    Password for Postgres/Redshift/AlloyDB
    project_id int
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    target_name str
    Default schema name
    type str
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    username str
    Username for Postgres/Redshift/AlloyDB
    credentialId Number
    The system Postgres/Redshift/AlloyDB credential ID
    defaultSchema String
    Default schema name
    isActive Boolean
    Whether the Postgres/Redshift/AlloyDB credential is active
    numThreads Number
    Number of threads to use
    password String
    Password for Postgres/Redshift/AlloyDB
    projectId Number
    Project ID to create the Postgres/Redshift/AlloyDB credential in
    targetName String
    Default schema name
    type String
    Type of connection. One of (postgres/redshift). Use postgres for alloydb connections
    username String
    Username for Postgres/Redshift/AlloyDB

    Import

    using import blocks (requires Terraform >= 1.5)

    import {

    to = dbtcloud_postgres_credential.my_credential

    id = “project_id:credential_id”

    }

    import {

    to = dbtcloud_postgres_credential.my_credential

    id = “12345:6789”

    }

    using the older import command

    $ pulumi import dbtcloud:index/postgresCredential:PostgresCredential my_credential "project_id:credential_id"
    
    $ pulumi import dbtcloud:index/postgresCredential:PostgresCredential my_credential 12345:6789
    

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

    Package Details

    Repository
    dbtcloud pulumi/pulumi-dbtcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dbtcloud Terraform Provider.
    dbtcloud logo
    dbt Cloud v0.1.10 published on Thursday, Jul 18, 2024 by Pulumi