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

dbtcloud.getProject

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";
    
    // projects data sources can use the project_id parameter (preferred uniqueness is ensured)
    const testProject = dbtcloud.getProject({
        projectId: dbtCloudProjectId,
    });
    // or they can use project names
    // the provider will raise an error if more than one project is found with the same name
    const anotherTestProject = dbtcloud.getProject({
        name: "My other project name",
    });
    
    import pulumi
    import pulumi_dbtcloud as dbtcloud
    
    # projects data sources can use the project_id parameter (preferred uniqueness is ensured)
    test_project = dbtcloud.get_project(project_id=dbt_cloud_project_id)
    # or they can use project names
    # the provider will raise an error if more than one project is found with the same name
    another_test_project = dbtcloud.get_project(name="My other project name")
    
    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 {
    		// projects data sources can use the project_id parameter (preferred uniqueness is ensured)
    		_, err := dbtcloud.LookupProject(ctx, &dbtcloud.LookupProjectArgs{
    			ProjectId: pulumi.IntRef(dbtCloudProjectId),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// or they can use project names
    		// the provider will raise an error if more than one project is found with the same name
    		_, err = dbtcloud.LookupProject(ctx, &dbtcloud.LookupProjectArgs{
    			Name: pulumi.StringRef("My other project name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DbtCloud = Pulumi.DbtCloud;
    
    return await Deployment.RunAsync(() => 
    {
        // projects data sources can use the project_id parameter (preferred uniqueness is ensured)
        var testProject = DbtCloud.GetProject.Invoke(new()
        {
            ProjectId = dbtCloudProjectId,
        });
    
        // or they can use project names
        // the provider will raise an error if more than one project is found with the same name
        var anotherTestProject = DbtCloud.GetProject.Invoke(new()
        {
            Name = "My other project name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dbtcloud.DbtcloudFunctions;
    import com.pulumi.dbtcloud.inputs.GetProjectArgs;
    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) {
            // projects data sources can use the project_id parameter (preferred uniqueness is ensured)
            final var testProject = DbtcloudFunctions.getProject(GetProjectArgs.builder()
                .projectId(dbtCloudProjectId)
                .build());
    
            // or they can use project names
            // the provider will raise an error if more than one project is found with the same name
            final var anotherTestProject = DbtcloudFunctions.getProject(GetProjectArgs.builder()
                .name("My other project name")
                .build());
    
        }
    }
    
    variables:
      # projects data sources can use the project_id parameter (preferred uniqueness is ensured)
      testProject:
        fn::invoke:
          Function: dbtcloud:getProject
          Arguments:
            projectId: ${dbtCloudProjectId}
      # or they can use project names
      # // the provider will raise an error if more than one project is found with the same name
      anotherTestProject:
        fn::invoke:
          Function: dbtcloud:getProject
          Arguments:
            name: My other project name
    

    Using getProject

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getProject(args: GetProjectArgs, opts?: InvokeOptions): Promise<GetProjectResult>
    function getProjectOutput(args: GetProjectOutputArgs, opts?: InvokeOptions): Output<GetProjectResult>
    def get_project(name: Optional[str] = None,
                    project_id: Optional[int] = None,
                    opts: Optional[InvokeOptions] = None) -> GetProjectResult
    def get_project_output(name: Optional[pulumi.Input[str]] = None,
                    project_id: Optional[pulumi.Input[int]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetProjectResult]
    func LookupProject(ctx *Context, args *LookupProjectArgs, opts ...InvokeOption) (*LookupProjectResult, error)
    func LookupProjectOutput(ctx *Context, args *LookupProjectOutputArgs, opts ...InvokeOption) LookupProjectResultOutput

    > Note: This function is named LookupProject in the Go SDK.

    public static class GetProject 
    {
        public static Task<GetProjectResult> InvokeAsync(GetProjectArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectResult> Invoke(GetProjectInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectResult> getProject(GetProjectArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: dbtcloud:index/getProject:getProject
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Given name for project
    ProjectId int
    ID of the project to represent
    Name string
    Given name for project
    ProjectId int
    ID of the project to represent
    name String
    Given name for project
    projectId Integer
    ID of the project to represent
    name string
    Given name for project
    projectId number
    ID of the project to represent
    name str
    Given name for project
    project_id int
    ID of the project to represent
    name String
    Given name for project
    projectId Number
    ID of the project to represent

    getProject Result

    The following output properties are available:

    ConnectionId int
    ID of the connection associated with the project
    DocsJobId int
    ID of Job for the documentation
    FreshnessJobId int
    ID of Job for source freshness
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Given name for project
    RepositoryId int
    ID of the repository associated with the project
    State int
    Project state should be 1 = active, as 2 = deleted
    ProjectId int
    ID of the project to represent
    ConnectionId int
    ID of the connection associated with the project
    DocsJobId int
    ID of Job for the documentation
    FreshnessJobId int
    ID of Job for source freshness
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Given name for project
    RepositoryId int
    ID of the repository associated with the project
    State int
    Project state should be 1 = active, as 2 = deleted
    ProjectId int
    ID of the project to represent
    connectionId Integer
    ID of the connection associated with the project
    docsJobId Integer
    ID of Job for the documentation
    freshnessJobId Integer
    ID of Job for source freshness
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Given name for project
    repositoryId Integer
    ID of the repository associated with the project
    state Integer
    Project state should be 1 = active, as 2 = deleted
    projectId Integer
    ID of the project to represent
    connectionId number
    ID of the connection associated with the project
    docsJobId number
    ID of Job for the documentation
    freshnessJobId number
    ID of Job for source freshness
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Given name for project
    repositoryId number
    ID of the repository associated with the project
    state number
    Project state should be 1 = active, as 2 = deleted
    projectId number
    ID of the project to represent
    connection_id int
    ID of the connection associated with the project
    docs_job_id int
    ID of Job for the documentation
    freshness_job_id int
    ID of Job for source freshness
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Given name for project
    repository_id int
    ID of the repository associated with the project
    state int
    Project state should be 1 = active, as 2 = deleted
    project_id int
    ID of the project to represent
    connectionId Number
    ID of the connection associated with the project
    docsJobId Number
    ID of Job for the documentation
    freshnessJobId Number
    ID of Job for source freshness
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Given name for project
    repositoryId Number
    ID of the repository associated with the project
    state Number
    Project state should be 1 = active, as 2 = deleted
    projectId Number
    ID of the project to represent

    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