1. Packages
  2. dbt Cloud Provider
  3. API Docs
  4. ProjectConnection
dbt Cloud v0.1.30 published on Thursday, Mar 20, 2025 by Pulumi

dbtcloud.ProjectConnection

Explore with Pulumi AI

This resource is deprecated with the release of global connections and it will be removed in a future version of the provider. Going forward, please set the connection_id in the dbtcloud.Environment resource instead.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as dbtcloud from "@pulumi/dbtcloud";

const dbtProjectConnection = new dbtcloud.ProjectConnection("dbt_project_connection", {
    projectId: dbtProject.id,
    connectionId: dbtConnection.connectionId,
});
Copy
import pulumi
import pulumi_dbtcloud as dbtcloud

dbt_project_connection = dbtcloud.ProjectConnection("dbt_project_connection",
    project_id=dbt_project["id"],
    connection_id=dbt_connection["connectionId"])
Copy
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.NewProjectConnection(ctx, "dbt_project_connection", &dbtcloud.ProjectConnectionArgs{
			ProjectId:    pulumi.Any(dbtProject.Id),
			ConnectionId: pulumi.Any(dbtConnection.ConnectionId),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DbtCloud = Pulumi.DbtCloud;

return await Deployment.RunAsync(() => 
{
    var dbtProjectConnection = new DbtCloud.ProjectConnection("dbt_project_connection", new()
    {
        ProjectId = dbtProject.Id,
        ConnectionId = dbtConnection.ConnectionId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dbtcloud.ProjectConnection;
import com.pulumi.dbtcloud.ProjectConnectionArgs;
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 dbtProjectConnection = new ProjectConnection("dbtProjectConnection", ProjectConnectionArgs.builder()
            .projectId(dbtProject.id())
            .connectionId(dbtConnection.connectionId())
            .build());

    }
}
Copy
resources:
  dbtProjectConnection:
    type: dbtcloud:ProjectConnection
    name: dbt_project_connection
    properties:
      projectId: ${dbtProject.id}
      connectionId: ${dbtConnection.connectionId}
Copy

Create ProjectConnection Resource

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

Constructor syntax

new ProjectConnection(name: string, args: ProjectConnectionArgs, opts?: CustomResourceOptions);
@overload
def ProjectConnection(resource_name: str,
                      args: ProjectConnectionArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def ProjectConnection(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      connection_id: Optional[int] = None,
                      project_id: Optional[int] = None)
func NewProjectConnection(ctx *Context, name string, args ProjectConnectionArgs, opts ...ResourceOption) (*ProjectConnection, error)
public ProjectConnection(string name, ProjectConnectionArgs args, CustomResourceOptions? opts = null)
public ProjectConnection(String name, ProjectConnectionArgs args)
public ProjectConnection(String name, ProjectConnectionArgs args, CustomResourceOptions options)
type: dbtcloud:ProjectConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ProjectConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ProjectConnectionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ProjectConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ProjectConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ProjectConnectionArgs
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 projectConnectionResource = new DbtCloud.ProjectConnection("projectConnectionResource", new()
{
    ConnectionId = 0,
    ProjectId = 0,
});
Copy
example, err := dbtcloud.NewProjectConnection(ctx, "projectConnectionResource", &dbtcloud.ProjectConnectionArgs{
	ConnectionId: pulumi.Int(0),
	ProjectId:    pulumi.Int(0),
})
Copy
var projectConnectionResource = new ProjectConnection("projectConnectionResource", ProjectConnectionArgs.builder()
    .connectionId(0)
    .projectId(0)
    .build());
Copy
project_connection_resource = dbtcloud.ProjectConnection("projectConnectionResource",
    connection_id=0,
    project_id=0)
Copy
const projectConnectionResource = new dbtcloud.ProjectConnection("projectConnectionResource", {
    connectionId: 0,
    projectId: 0,
});
Copy
type: dbtcloud:ProjectConnection
properties:
    connectionId: 0
    projectId: 0
Copy

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

ConnectionId
This property is required.
Changes to this property will trigger replacement.
int
Connection ID
ProjectId
This property is required.
Changes to this property will trigger replacement.
int
Project ID
ConnectionId
This property is required.
Changes to this property will trigger replacement.
int
Connection ID
ProjectId
This property is required.
Changes to this property will trigger replacement.
int
Project ID
connectionId
This property is required.
Changes to this property will trigger replacement.
Integer
Connection ID
projectId
This property is required.
Changes to this property will trigger replacement.
Integer
Project ID
connectionId
This property is required.
Changes to this property will trigger replacement.
number
Connection ID
projectId
This property is required.
Changes to this property will trigger replacement.
number
Project ID
connection_id
This property is required.
Changes to this property will trigger replacement.
int
Connection ID
project_id
This property is required.
Changes to this property will trigger replacement.
int
Project ID
connectionId
This property is required.
Changes to this property will trigger replacement.
Number
Connection ID
projectId
This property is required.
Changes to this property will trigger replacement.
Number
Project ID

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ProjectConnection Resource

Get an existing ProjectConnection 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?: ProjectConnectionState, opts?: CustomResourceOptions): ProjectConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        connection_id: Optional[int] = None,
        project_id: Optional[int] = None) -> ProjectConnection
func GetProjectConnection(ctx *Context, name string, id IDInput, state *ProjectConnectionState, opts ...ResourceOption) (*ProjectConnection, error)
public static ProjectConnection Get(string name, Input<string> id, ProjectConnectionState? state, CustomResourceOptions? opts = null)
public static ProjectConnection get(String name, Output<String> id, ProjectConnectionState state, CustomResourceOptions options)
resources:  _:    type: dbtcloud:ProjectConnection    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ConnectionId Changes to this property will trigger replacement. int
Connection ID
ProjectId Changes to this property will trigger replacement. int
Project ID
ConnectionId Changes to this property will trigger replacement. int
Connection ID
ProjectId Changes to this property will trigger replacement. int
Project ID
connectionId Changes to this property will trigger replacement. Integer
Connection ID
projectId Changes to this property will trigger replacement. Integer
Project ID
connectionId Changes to this property will trigger replacement. number
Connection ID
projectId Changes to this property will trigger replacement. number
Project ID
connection_id Changes to this property will trigger replacement. int
Connection ID
project_id Changes to this property will trigger replacement. int
Project ID
connectionId Changes to this property will trigger replacement. Number
Connection ID
projectId Changes to this property will trigger replacement. Number
Project ID

Import

using import blocks (requires Terraform >= 1.5)

import {

to = dbtcloud_project_connection.my_project

id = “project_id:connection_id”

}

import {

to = dbtcloud_project_connection.my_project

id = “12345:5678”

}

using the older import command

$ pulumi import dbtcloud:index/projectConnection:ProjectConnection my_project "project_id:connection_id"
Copy
$ pulumi import dbtcloud:index/projectConnection:ProjectConnection my_project 12345:5678
Copy

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.