dbtcloud.PostgresCredential
Explore with Pulumi AI
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The PostgresCredential resource accepts the following input properties:
- Default
Schema string - Default schema name
- Project
Id 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
- Is
Active bool - Whether the Postgres/Redshift/AlloyDB credential is active
- Num
Threads int - Number of threads to use
- Password string
- Password for Postgres/Redshift/AlloyDB
- Target
Name string - Default schema name
- Default
Schema string - Default schema name
- Project
Id 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
- Is
Active bool - Whether the Postgres/Redshift/AlloyDB credential is active
- Num
Threads int - Number of threads to use
- Password string
- Password for Postgres/Redshift/AlloyDB
- Target
Name string - Default schema name
- default
Schema String - Default schema name
- project
Id 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
- is
Active Boolean - Whether the Postgres/Redshift/AlloyDB credential is active
- num
Threads Integer - Number of threads to use
- password String
- Password for Postgres/Redshift/AlloyDB
- target
Name String - Default schema name
- default
Schema string - Default schema name
- project
Id 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
- is
Active boolean - Whether the Postgres/Redshift/AlloyDB credential is active
- num
Threads number - Number of threads to use
- password string
- Password for Postgres/Redshift/AlloyDB
- target
Name 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
- default
Schema String - Default schema name
- project
Id 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
- is
Active Boolean - Whether the Postgres/Redshift/AlloyDB credential is active
- num
Threads Number - Number of threads to use
- password String
- Password for Postgres/Redshift/AlloyDB
- target
Name String - Default schema name
Outputs
All input properties are implicitly available as output properties. Additionally, the PostgresCredential resource produces the following output properties:
- Credential
Id int - 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 string
- The provider-assigned unique ID for this managed resource.
- credential
Id Integer - The system Postgres/Redshift/AlloyDB credential ID
- id String
- The provider-assigned unique ID for this managed resource.
- credential
Id 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.
- credential
Id 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.
- Credential
Id int - The system Postgres/Redshift/AlloyDB credential ID
- Default
Schema string - Default schema name
- Is
Active bool - Whether the Postgres/Redshift/AlloyDB credential is active
- Num
Threads int - Number of threads to use
- Password string
- Password for Postgres/Redshift/AlloyDB
- Project
Id int - Project ID to create the Postgres/Redshift/AlloyDB credential in
- Target
Name 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 string - Default schema name
- Is
Active bool - Whether the Postgres/Redshift/AlloyDB credential is active
- Num
Threads int - Number of threads to use
- Password string
- Password for Postgres/Redshift/AlloyDB
- Project
Id int - Project ID to create the Postgres/Redshift/AlloyDB credential in
- Target
Name 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 Integer - The system Postgres/Redshift/AlloyDB credential ID
- default
Schema String - Default schema name
- is
Active Boolean - Whether the Postgres/Redshift/AlloyDB credential is active
- num
Threads Integer - Number of threads to use
- password String
- Password for Postgres/Redshift/AlloyDB
- project
Id Integer - Project ID to create the Postgres/Redshift/AlloyDB credential in
- target
Name 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 number - The system Postgres/Redshift/AlloyDB credential ID
- default
Schema string - Default schema name
- is
Active boolean - Whether the Postgres/Redshift/AlloyDB credential is active
- num
Threads number - Number of threads to use
- password string
- Password for Postgres/Redshift/AlloyDB
- project
Id number - Project ID to create the Postgres/Redshift/AlloyDB credential in
- target
Name 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
- credential
Id Number - The system Postgres/Redshift/AlloyDB credential ID
- default
Schema String - Default schema name
- is
Active Boolean - Whether the Postgres/Redshift/AlloyDB credential is active
- num
Threads Number - Number of threads to use
- password String
- Password for Postgres/Redshift/AlloyDB
- project
Id Number - Project ID to create the Postgres/Redshift/AlloyDB credential in
- target
Name 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.