dbtcloud.Environment
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as dbtcloud from "@pulumi/dbtcloud";
const ciEnvironment = new dbtcloud.Environment("ci_environment", {
dbtVersion: "versionless",
name: "CI",
projectId: dbtProject.id,
type: "deployment",
credentialId: ciCredential.credentialId,
});
// we can also set a deployment environment as being the production one
const prodEnvironment = new dbtcloud.Environment("prod_environment", {
dbtVersion: "1.7.0-latest",
name: "Prod",
projectId: dbtProject.id,
type: "deployment",
credentialId: prodCredential.credentialId,
deploymentType: "production",
});
// Creating a development environment
const devEnvironment = new dbtcloud.Environment("dev_environment", {
dbtVersion: "versionless",
name: "Dev",
projectId: dbtProject.id,
type: "development",
});
import pulumi
import pulumi_dbtcloud as dbtcloud
ci_environment = dbtcloud.Environment("ci_environment",
dbt_version="versionless",
name="CI",
project_id=dbt_project["id"],
type="deployment",
credential_id=ci_credential["credentialId"])
# we can also set a deployment environment as being the production one
prod_environment = dbtcloud.Environment("prod_environment",
dbt_version="1.7.0-latest",
name="Prod",
project_id=dbt_project["id"],
type="deployment",
credential_id=prod_credential["credentialId"],
deployment_type="production")
# Creating a development environment
dev_environment = dbtcloud.Environment("dev_environment",
dbt_version="versionless",
name="Dev",
project_id=dbt_project["id"],
type="development")
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.NewEnvironment(ctx, "ci_environment", &dbtcloud.EnvironmentArgs{
DbtVersion: pulumi.String("versionless"),
Name: pulumi.String("CI"),
ProjectId: pulumi.Any(dbtProject.Id),
Type: pulumi.String("deployment"),
CredentialId: pulumi.Any(ciCredential.CredentialId),
})
if err != nil {
return err
}
// we can also set a deployment environment as being the production one
_, err = dbtcloud.NewEnvironment(ctx, "prod_environment", &dbtcloud.EnvironmentArgs{
DbtVersion: pulumi.String("1.7.0-latest"),
Name: pulumi.String("Prod"),
ProjectId: pulumi.Any(dbtProject.Id),
Type: pulumi.String("deployment"),
CredentialId: pulumi.Any(prodCredential.CredentialId),
DeploymentType: pulumi.String("production"),
})
if err != nil {
return err
}
// Creating a development environment
_, err = dbtcloud.NewEnvironment(ctx, "dev_environment", &dbtcloud.EnvironmentArgs{
DbtVersion: pulumi.String("versionless"),
Name: pulumi.String("Dev"),
ProjectId: pulumi.Any(dbtProject.Id),
Type: pulumi.String("development"),
})
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 ciEnvironment = new DbtCloud.Environment("ci_environment", new()
{
DbtVersion = "versionless",
Name = "CI",
ProjectId = dbtProject.Id,
Type = "deployment",
CredentialId = ciCredential.CredentialId,
});
// we can also set a deployment environment as being the production one
var prodEnvironment = new DbtCloud.Environment("prod_environment", new()
{
DbtVersion = "1.7.0-latest",
Name = "Prod",
ProjectId = dbtProject.Id,
Type = "deployment",
CredentialId = prodCredential.CredentialId,
DeploymentType = "production",
});
// Creating a development environment
var devEnvironment = new DbtCloud.Environment("dev_environment", new()
{
DbtVersion = "versionless",
Name = "Dev",
ProjectId = dbtProject.Id,
Type = "development",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dbtcloud.Environment;
import com.pulumi.dbtcloud.EnvironmentArgs;
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 ciEnvironment = new Environment("ciEnvironment", EnvironmentArgs.builder()
.dbtVersion("versionless")
.name("CI")
.projectId(dbtProject.id())
.type("deployment")
.credentialId(ciCredential.credentialId())
.build());
// we can also set a deployment environment as being the production one
var prodEnvironment = new Environment("prodEnvironment", EnvironmentArgs.builder()
.dbtVersion("1.7.0-latest")
.name("Prod")
.projectId(dbtProject.id())
.type("deployment")
.credentialId(prodCredential.credentialId())
.deploymentType("production")
.build());
// Creating a development environment
var devEnvironment = new Environment("devEnvironment", EnvironmentArgs.builder()
.dbtVersion("versionless")
.name("Dev")
.projectId(dbtProject.id())
.type("development")
.build());
}
}
resources:
ciEnvironment:
type: dbtcloud:Environment
name: ci_environment
properties:
dbtVersion: versionless
name: CI
projectId: ${dbtProject.id}
type: deployment
credentialId: ${ciCredential.credentialId}
# we can also set a deployment environment as being the production one
prodEnvironment:
type: dbtcloud:Environment
name: prod_environment
properties:
dbtVersion: 1.7.0-latest
name: Prod
projectId: ${dbtProject.id}
type: deployment
credentialId: ${prodCredential.credentialId}
deploymentType: production
# Creating a development environment
devEnvironment:
type: dbtcloud:Environment
name: dev_environment
properties:
dbtVersion: versionless
name: Dev
projectId: ${dbtProject.id}
type: development
Create Environment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Environment(name: string, args: EnvironmentArgs, opts?: CustomResourceOptions);
@overload
def Environment(resource_name: str,
args: EnvironmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Environment(resource_name: str,
opts: Optional[ResourceOptions] = None,
dbt_version: Optional[str] = None,
project_id: Optional[int] = None,
type: Optional[str] = None,
credential_id: Optional[int] = None,
custom_branch: Optional[str] = None,
deployment_type: Optional[str] = None,
extended_attributes_id: Optional[int] = None,
is_active: Optional[bool] = None,
name: Optional[str] = None,
use_custom_branch: Optional[bool] = None)
func NewEnvironment(ctx *Context, name string, args EnvironmentArgs, opts ...ResourceOption) (*Environment, error)
public Environment(string name, EnvironmentArgs args, CustomResourceOptions? opts = null)
public Environment(String name, EnvironmentArgs args)
public Environment(String name, EnvironmentArgs args, CustomResourceOptions options)
type: dbtcloud:Environment
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 EnvironmentArgs
- 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 EnvironmentArgs
- 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 EnvironmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnvironmentArgs
- 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 environmentResource = new DbtCloud.Environment("environmentResource", new()
{
DbtVersion = "string",
ProjectId = 0,
Type = "string",
CredentialId = 0,
CustomBranch = "string",
DeploymentType = "string",
ExtendedAttributesId = 0,
IsActive = false,
Name = "string",
UseCustomBranch = false,
});
example, err := dbtcloud.NewEnvironment(ctx, "environmentResource", &dbtcloud.EnvironmentArgs{
DbtVersion: pulumi.String("string"),
ProjectId: pulumi.Int(0),
Type: pulumi.String("string"),
CredentialId: pulumi.Int(0),
CustomBranch: pulumi.String("string"),
DeploymentType: pulumi.String("string"),
ExtendedAttributesId: pulumi.Int(0),
IsActive: pulumi.Bool(false),
Name: pulumi.String("string"),
UseCustomBranch: pulumi.Bool(false),
})
var environmentResource = new Environment("environmentResource", EnvironmentArgs.builder()
.dbtVersion("string")
.projectId(0)
.type("string")
.credentialId(0)
.customBranch("string")
.deploymentType("string")
.extendedAttributesId(0)
.isActive(false)
.name("string")
.useCustomBranch(false)
.build());
environment_resource = dbtcloud.Environment("environmentResource",
dbt_version="string",
project_id=0,
type="string",
credential_id=0,
custom_branch="string",
deployment_type="string",
extended_attributes_id=0,
is_active=False,
name="string",
use_custom_branch=False)
const environmentResource = new dbtcloud.Environment("environmentResource", {
dbtVersion: "string",
projectId: 0,
type: "string",
credentialId: 0,
customBranch: "string",
deploymentType: "string",
extendedAttributesId: 0,
isActive: false,
name: "string",
useCustomBranch: false,
});
type: dbtcloud:Environment
properties:
credentialId: 0
customBranch: string
dbtVersion: string
deploymentType: string
extendedAttributesId: 0
isActive: false
name: string
projectId: 0
type: string
useCustomBranch: false
Environment 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 Environment resource accepts the following input properties:
- Dbt
Version string - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - Project
Id int - Project ID to create the environment in
- Type string
- The type of environment (must be either development or deployment)
- Credential
Id int - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- Custom
Branch string - Which custom branch to use in this environment
- Deployment
Type string - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- Extended
Attributes intId - ID of the extended attributes for the environment
- Is
Active bool - Whether the environment is active
- Name string
- Environment name
- Use
Custom boolBranch - Whether to use a custom git branch in this environment
- Dbt
Version string - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - Project
Id int - Project ID to create the environment in
- Type string
- The type of environment (must be either development or deployment)
- Credential
Id int - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- Custom
Branch string - Which custom branch to use in this environment
- Deployment
Type string - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- Extended
Attributes intId - ID of the extended attributes for the environment
- Is
Active bool - Whether the environment is active
- Name string
- Environment name
- Use
Custom boolBranch - Whether to use a custom git branch in this environment
- dbt
Version String - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - project
Id Integer - Project ID to create the environment in
- type String
- The type of environment (must be either development or deployment)
- credential
Id Integer - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- custom
Branch String - Which custom branch to use in this environment
- deployment
Type String - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- extended
Attributes IntegerId - ID of the extended attributes for the environment
- is
Active Boolean - Whether the environment is active
- name String
- Environment name
- use
Custom BooleanBranch - Whether to use a custom git branch in this environment
- dbt
Version string - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - project
Id number - Project ID to create the environment in
- type string
- The type of environment (must be either development or deployment)
- credential
Id number - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- custom
Branch string - Which custom branch to use in this environment
- deployment
Type string - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- extended
Attributes numberId - ID of the extended attributes for the environment
- is
Active boolean - Whether the environment is active
- name string
- Environment name
- use
Custom booleanBranch - Whether to use a custom git branch in this environment
- dbt_
version str - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - project_
id int - Project ID to create the environment in
- type str
- The type of environment (must be either development or deployment)
- credential_
id int - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- custom_
branch str - Which custom branch to use in this environment
- deployment_
type str - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- extended_
attributes_ intid - ID of the extended attributes for the environment
- is_
active bool - Whether the environment is active
- name str
- Environment name
- use_
custom_ boolbranch - Whether to use a custom git branch in this environment
- dbt
Version String - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - project
Id Number - Project ID to create the environment in
- type String
- The type of environment (must be either development or deployment)
- credential
Id Number - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- custom
Branch String - Which custom branch to use in this environment
- deployment
Type String - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- extended
Attributes NumberId - ID of the extended attributes for the environment
- is
Active Boolean - Whether the environment is active
- name String
- Environment name
- use
Custom BooleanBranch - Whether to use a custom git branch in this environment
Outputs
All input properties are implicitly available as output properties. Additionally, the Environment resource produces the following output properties:
- Environment
Id int - Environment ID within the project
- Id string
- The provider-assigned unique ID for this managed resource.
- Environment
Id int - Environment ID within the project
- Id string
- The provider-assigned unique ID for this managed resource.
- environment
Id Integer - Environment ID within the project
- id String
- The provider-assigned unique ID for this managed resource.
- environment
Id number - Environment ID within the project
- id string
- The provider-assigned unique ID for this managed resource.
- environment_
id int - Environment ID within the project
- id str
- The provider-assigned unique ID for this managed resource.
- environment
Id Number - Environment ID within the project
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Environment Resource
Get an existing Environment 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?: EnvironmentState, opts?: CustomResourceOptions): Environment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
credential_id: Optional[int] = None,
custom_branch: Optional[str] = None,
dbt_version: Optional[str] = None,
deployment_type: Optional[str] = None,
environment_id: Optional[int] = None,
extended_attributes_id: Optional[int] = None,
is_active: Optional[bool] = None,
name: Optional[str] = None,
project_id: Optional[int] = None,
type: Optional[str] = None,
use_custom_branch: Optional[bool] = None) -> Environment
func GetEnvironment(ctx *Context, name string, id IDInput, state *EnvironmentState, opts ...ResourceOption) (*Environment, error)
public static Environment Get(string name, Input<string> id, EnvironmentState? state, CustomResourceOptions? opts = null)
public static Environment get(String name, Output<String> id, EnvironmentState 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 - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- Custom
Branch string - Which custom branch to use in this environment
- Dbt
Version string - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - Deployment
Type string - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- Environment
Id int - Environment ID within the project
- Extended
Attributes intId - ID of the extended attributes for the environment
- Is
Active bool - Whether the environment is active
- Name string
- Environment name
- Project
Id int - Project ID to create the environment in
- Type string
- The type of environment (must be either development or deployment)
- Use
Custom boolBranch - Whether to use a custom git branch in this environment
- Credential
Id int - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- Custom
Branch string - Which custom branch to use in this environment
- Dbt
Version string - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - Deployment
Type string - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- Environment
Id int - Environment ID within the project
- Extended
Attributes intId - ID of the extended attributes for the environment
- Is
Active bool - Whether the environment is active
- Name string
- Environment name
- Project
Id int - Project ID to create the environment in
- Type string
- The type of environment (must be either development or deployment)
- Use
Custom boolBranch - Whether to use a custom git branch in this environment
- credential
Id Integer - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- custom
Branch String - Which custom branch to use in this environment
- dbt
Version String - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - deployment
Type String - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- environment
Id Integer - Environment ID within the project
- extended
Attributes IntegerId - ID of the extended attributes for the environment
- is
Active Boolean - Whether the environment is active
- name String
- Environment name
- project
Id Integer - Project ID to create the environment in
- type String
- The type of environment (must be either development or deployment)
- use
Custom BooleanBranch - Whether to use a custom git branch in this environment
- credential
Id number - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- custom
Branch string - Which custom branch to use in this environment
- dbt
Version string - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - deployment
Type string - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- environment
Id number - Environment ID within the project
- extended
Attributes numberId - ID of the extended attributes for the environment
- is
Active boolean - Whether the environment is active
- name string
- Environment name
- project
Id number - Project ID to create the environment in
- type string
- The type of environment (must be either development or deployment)
- use
Custom booleanBranch - Whether to use a custom git branch in this environment
- credential_
id int - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- custom_
branch str - Which custom branch to use in this environment
- dbt_
version str - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - deployment_
type str - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- environment_
id int - Environment ID within the project
- extended_
attributes_ intid - ID of the extended attributes for the environment
- is_
active bool - Whether the environment is active
- name str
- Environment name
- project_
id int - Project ID to create the environment in
- type str
- The type of environment (must be either development or deployment)
- use_
custom_ boolbranch - Whether to use a custom git branch in this environment
- credential
Id Number - Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- custom
Branch String - Which custom branch to use in this environment
- dbt
Version String - Version number of dbt to use in this environment. It needs to be in the format
major.minor.0-latest
(e.g.1.5.0-latest
),major.minor.0-pre
orversionless
. In a future version of the providerversionless
will be the default if no version is provided - deployment
Type String - The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- environment
Id Number - Environment ID within the project
- extended
Attributes NumberId - ID of the extended attributes for the environment
- is
Active Boolean - Whether the environment is active
- name String
- Environment name
- project
Id Number - Project ID to create the environment in
- type String
- The type of environment (must be either development or deployment)
- use
Custom BooleanBranch - Whether to use a custom git branch in this environment
Import
using import blocks (requires Terraform >= 1.5)
import {
to = dbtcloud_environment.prod_environment
id = “project_id:environment_id”
}
import {
to = dbtcloud_environment.prod_environment
id = “12345:6789”
}
using the older import command
$ pulumi import dbtcloud:index/environment:Environment prod_environment "project_id:environment_id"
$ pulumi import dbtcloud:index/environment:Environment prod_environment 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.