1. Packages
  2. dbt Cloud
  3. API Docs
  4. ProjectRepository
dbt Cloud v0.1.8 published on Tuesday, Jun 11, 2024 by Pulumi

dbtcloud.ProjectRepository

Explore with Pulumi AI

dbtcloud logo
dbt Cloud v0.1.8 published on Tuesday, Jun 11, 2024 by Pulumi

    This resource allows you to link a dbt Cloud project to a git repository.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dbtcloud from "@pulumi/dbtcloud";
    
    const dbtProjectRepository = new dbtcloud.ProjectRepository("dbt_project_repository", {
        projectId: dbtProject.id,
        repositoryId: dbtRepository.repositoryId,
    });
    
    import pulumi
    import pulumi_dbtcloud as dbtcloud
    
    dbt_project_repository = dbtcloud.ProjectRepository("dbt_project_repository",
        project_id=dbt_project["id"],
        repository_id=dbt_repository["repositoryId"])
    
    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.NewProjectRepository(ctx, "dbt_project_repository", &dbtcloud.ProjectRepositoryArgs{
    			ProjectId:    pulumi.Any(dbtProject.Id),
    			RepositoryId: pulumi.Any(dbtRepository.RepositoryId),
    		})
    		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 dbtProjectRepository = new DbtCloud.ProjectRepository("dbt_project_repository", new()
        {
            ProjectId = dbtProject.Id,
            RepositoryId = dbtRepository.RepositoryId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dbtcloud.ProjectRepository;
    import com.pulumi.dbtcloud.ProjectRepositoryArgs;
    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 dbtProjectRepository = new ProjectRepository("dbtProjectRepository", ProjectRepositoryArgs.builder()
                .projectId(dbtProject.id())
                .repositoryId(dbtRepository.repositoryId())
                .build());
    
        }
    }
    
    resources:
      dbtProjectRepository:
        type: dbtcloud:ProjectRepository
        name: dbt_project_repository
        properties:
          projectId: ${dbtProject.id}
          repositoryId: ${dbtRepository.repositoryId}
    

    Create ProjectRepository Resource

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

    Constructor syntax

    new ProjectRepository(name: string, args: ProjectRepositoryArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectRepository(resource_name: str,
                          args: ProjectRepositoryArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectRepository(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          project_id: Optional[int] = None,
                          repository_id: Optional[int] = None)
    func NewProjectRepository(ctx *Context, name string, args ProjectRepositoryArgs, opts ...ResourceOption) (*ProjectRepository, error)
    public ProjectRepository(string name, ProjectRepositoryArgs args, CustomResourceOptions? opts = null)
    public ProjectRepository(String name, ProjectRepositoryArgs args)
    public ProjectRepository(String name, ProjectRepositoryArgs args, CustomResourceOptions options)
    
    type: dbtcloud:ProjectRepository
    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 ProjectRepositoryArgs
    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 ProjectRepositoryArgs
    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 ProjectRepositoryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectRepositoryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectRepositoryArgs
    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 projectRepositoryResource = new DbtCloud.ProjectRepository("projectRepositoryResource", new()
    {
        ProjectId = 0,
        RepositoryId = 0,
    });
    
    example, err := dbtcloud.NewProjectRepository(ctx, "projectRepositoryResource", &dbtcloud.ProjectRepositoryArgs{
    	ProjectId:    pulumi.Int(0),
    	RepositoryId: pulumi.Int(0),
    })
    
    var projectRepositoryResource = new ProjectRepository("projectRepositoryResource", ProjectRepositoryArgs.builder()
        .projectId(0)
        .repositoryId(0)
        .build());
    
    project_repository_resource = dbtcloud.ProjectRepository("projectRepositoryResource",
        project_id=0,
        repository_id=0)
    
    const projectRepositoryResource = new dbtcloud.ProjectRepository("projectRepositoryResource", {
        projectId: 0,
        repositoryId: 0,
    });
    
    type: dbtcloud:ProjectRepository
    properties:
        projectId: 0
        repositoryId: 0
    

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

    ProjectId int
    Project ID
    RepositoryId int
    Repository ID
    ProjectId int
    Project ID
    RepositoryId int
    Repository ID
    projectId Integer
    Project ID
    repositoryId Integer
    Repository ID
    projectId number
    Project ID
    repositoryId number
    Repository ID
    project_id int
    Project ID
    repository_id int
    Repository ID
    projectId Number
    Project ID
    repositoryId Number
    Repository ID

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ProjectRepository 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 ProjectRepository Resource

    Get an existing ProjectRepository 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?: ProjectRepositoryState, opts?: CustomResourceOptions): ProjectRepository
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            project_id: Optional[int] = None,
            repository_id: Optional[int] = None) -> ProjectRepository
    func GetProjectRepository(ctx *Context, name string, id IDInput, state *ProjectRepositoryState, opts ...ResourceOption) (*ProjectRepository, error)
    public static ProjectRepository Get(string name, Input<string> id, ProjectRepositoryState? state, CustomResourceOptions? opts = null)
    public static ProjectRepository get(String name, Output<String> id, ProjectRepositoryState 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:
    ProjectId int
    Project ID
    RepositoryId int
    Repository ID
    ProjectId int
    Project ID
    RepositoryId int
    Repository ID
    projectId Integer
    Project ID
    repositoryId Integer
    Repository ID
    projectId number
    Project ID
    repositoryId number
    Repository ID
    project_id int
    Project ID
    repository_id int
    Repository ID
    projectId Number
    Project ID
    repositoryId Number
    Repository ID

    Import

    using import blocks (requires Terraform >= 1.5)

    import {

    to = dbtcloud_project_repository.my_project

    id = “project_id:repository_id”

    }

    import {

    to = dbtcloud_project_repository.my_project

    id = “12345:5678”

    }

    using the older import command

    $ pulumi import dbtcloud:index/projectRepository:ProjectRepository my_project "project_id:repository_id"
    
    $ pulumi import dbtcloud:index/projectRepository:ProjectRepository my_project 12345:5678
    

    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.8 published on Tuesday, Jun 11, 2024 by Pulumi