dbtcloud.ModelNotifications
Explore with Pulumi AI
Configure model notifications for a dbt Cloud environment. By default all the on_... are set to false. When destroyed, the model notifications are disabled.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as dbtcloud from "@pulumi/dbtcloud";
const prodModelNotifications = new dbtcloud.ModelNotifications("prod_model_notifications", {
    environmentId: prodEnvironment.environmentId,
    enabled: true,
    onSuccess: false,
    onFailure: true,
    onWarning: true,
});
import pulumi
import pulumi_dbtcloud as dbtcloud
prod_model_notifications = dbtcloud.ModelNotifications("prod_model_notifications",
    environment_id=prod_environment["environmentId"],
    enabled=True,
    on_success=False,
    on_failure=True,
    on_warning=True)
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.NewModelNotifications(ctx, "prod_model_notifications", &dbtcloud.ModelNotificationsArgs{
			EnvironmentId: pulumi.Any(prodEnvironment.EnvironmentId),
			Enabled:       pulumi.Bool(true),
			OnSuccess:     pulumi.Bool(false),
			OnFailure:     pulumi.Bool(true),
			OnWarning:     pulumi.Bool(true),
		})
		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 prodModelNotifications = new DbtCloud.ModelNotifications("prod_model_notifications", new()
    {
        EnvironmentId = prodEnvironment.EnvironmentId,
        Enabled = true,
        OnSuccess = false,
        OnFailure = true,
        OnWarning = true,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dbtcloud.ModelNotifications;
import com.pulumi.dbtcloud.ModelNotificationsArgs;
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 prodModelNotifications = new ModelNotifications("prodModelNotifications", ModelNotificationsArgs.builder()
            .environmentId(prodEnvironment.environmentId())
            .enabled(true)
            .onSuccess(false)
            .onFailure(true)
            .onWarning(true)
            .build());
    }
}
resources:
  prodModelNotifications:
    type: dbtcloud:ModelNotifications
    name: prod_model_notifications
    properties:
      environmentId: ${prodEnvironment.environmentId}
      enabled: true
      onSuccess: false
      onFailure: true
      onWarning: true
Create ModelNotifications Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ModelNotifications(name: string, args: ModelNotificationsArgs, opts?: CustomResourceOptions);@overload
def ModelNotifications(resource_name: str,
                       args: ModelNotificationsArgs,
                       opts: Optional[ResourceOptions] = None)
@overload
def ModelNotifications(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       environment_id: Optional[str] = None,
                       enabled: Optional[bool] = None,
                       on_failure: Optional[bool] = None,
                       on_skipped: Optional[bool] = None,
                       on_success: Optional[bool] = None,
                       on_warning: Optional[bool] = None)func NewModelNotifications(ctx *Context, name string, args ModelNotificationsArgs, opts ...ResourceOption) (*ModelNotifications, error)public ModelNotifications(string name, ModelNotificationsArgs args, CustomResourceOptions? opts = null)
public ModelNotifications(String name, ModelNotificationsArgs args)
public ModelNotifications(String name, ModelNotificationsArgs args, CustomResourceOptions options)
type: dbtcloud:ModelNotifications
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 ModelNotificationsArgs
- 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 ModelNotificationsArgs
- 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 ModelNotificationsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ModelNotificationsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ModelNotificationsArgs
- 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 modelNotificationsResource = new DbtCloud.ModelNotifications("modelNotificationsResource", new()
{
    EnvironmentId = "string",
    Enabled = false,
    OnFailure = false,
    OnSkipped = false,
    OnSuccess = false,
    OnWarning = false,
});
example, err := dbtcloud.NewModelNotifications(ctx, "modelNotificationsResource", &dbtcloud.ModelNotificationsArgs{
	EnvironmentId: pulumi.String("string"),
	Enabled:       pulumi.Bool(false),
	OnFailure:     pulumi.Bool(false),
	OnSkipped:     pulumi.Bool(false),
	OnSuccess:     pulumi.Bool(false),
	OnWarning:     pulumi.Bool(false),
})
var modelNotificationsResource = new ModelNotifications("modelNotificationsResource", ModelNotificationsArgs.builder()
    .environmentId("string")
    .enabled(false)
    .onFailure(false)
    .onSkipped(false)
    .onSuccess(false)
    .onWarning(false)
    .build());
model_notifications_resource = dbtcloud.ModelNotifications("modelNotificationsResource",
    environment_id="string",
    enabled=False,
    on_failure=False,
    on_skipped=False,
    on_success=False,
    on_warning=False)
const modelNotificationsResource = new dbtcloud.ModelNotifications("modelNotificationsResource", {
    environmentId: "string",
    enabled: false,
    onFailure: false,
    onSkipped: false,
    onSuccess: false,
    onWarning: false,
});
type: dbtcloud:ModelNotifications
properties:
    enabled: false
    environmentId: string
    onFailure: false
    onSkipped: false
    onSuccess: false
    onWarning: false
ModelNotifications 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 ModelNotifications resource accepts the following input properties:
- EnvironmentId string
- The ID of the dbt Cloud environment
- Enabled bool
- Whether model notifications are enabled for this environment
- OnFailure bool
- Whether to send notifications for failed model runs
- OnSkipped bool
- Whether to send notifications for skipped model runs
- OnSuccess bool
- Whether to send notifications for successful model runs
- OnWarning bool
- Whether to send notifications for model runs with warnings
- EnvironmentId string
- The ID of the dbt Cloud environment
- Enabled bool
- Whether model notifications are enabled for this environment
- OnFailure bool
- Whether to send notifications for failed model runs
- OnSkipped bool
- Whether to send notifications for skipped model runs
- OnSuccess bool
- Whether to send notifications for successful model runs
- OnWarning bool
- Whether to send notifications for model runs with warnings
- environmentId String
- The ID of the dbt Cloud environment
- enabled Boolean
- Whether model notifications are enabled for this environment
- onFailure Boolean
- Whether to send notifications for failed model runs
- onSkipped Boolean
- Whether to send notifications for skipped model runs
- onSuccess Boolean
- Whether to send notifications for successful model runs
- onWarning Boolean
- Whether to send notifications for model runs with warnings
- environmentId string
- The ID of the dbt Cloud environment
- enabled boolean
- Whether model notifications are enabled for this environment
- onFailure boolean
- Whether to send notifications for failed model runs
- onSkipped boolean
- Whether to send notifications for skipped model runs
- onSuccess boolean
- Whether to send notifications for successful model runs
- onWarning boolean
- Whether to send notifications for model runs with warnings
- environment_id str
- The ID of the dbt Cloud environment
- enabled bool
- Whether model notifications are enabled for this environment
- on_failure bool
- Whether to send notifications for failed model runs
- on_skipped bool
- Whether to send notifications for skipped model runs
- on_success bool
- Whether to send notifications for successful model runs
- on_warning bool
- Whether to send notifications for model runs with warnings
- environmentId String
- The ID of the dbt Cloud environment
- enabled Boolean
- Whether model notifications are enabled for this environment
- onFailure Boolean
- Whether to send notifications for failed model runs
- onSkipped Boolean
- Whether to send notifications for skipped model runs
- onSuccess Boolean
- Whether to send notifications for successful model runs
- onWarning Boolean
- Whether to send notifications for model runs with warnings
Outputs
All input properties are implicitly available as output properties. Additionally, the ModelNotifications 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 ModelNotifications Resource
Get an existing ModelNotifications 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?: ModelNotificationsState, opts?: CustomResourceOptions): ModelNotifications@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enabled: Optional[bool] = None,
        environment_id: Optional[str] = None,
        on_failure: Optional[bool] = None,
        on_skipped: Optional[bool] = None,
        on_success: Optional[bool] = None,
        on_warning: Optional[bool] = None) -> ModelNotificationsfunc GetModelNotifications(ctx *Context, name string, id IDInput, state *ModelNotificationsState, opts ...ResourceOption) (*ModelNotifications, error)public static ModelNotifications Get(string name, Input<string> id, ModelNotificationsState? state, CustomResourceOptions? opts = null)public static ModelNotifications get(String name, Output<String> id, ModelNotificationsState state, CustomResourceOptions options)resources:  _:    type: dbtcloud:ModelNotifications    get:      id: ${id}- 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.
- Enabled bool
- Whether model notifications are enabled for this environment
- EnvironmentId string
- The ID of the dbt Cloud environment
- OnFailure bool
- Whether to send notifications for failed model runs
- OnSkipped bool
- Whether to send notifications for skipped model runs
- OnSuccess bool
- Whether to send notifications for successful model runs
- OnWarning bool
- Whether to send notifications for model runs with warnings
- Enabled bool
- Whether model notifications are enabled for this environment
- EnvironmentId string
- The ID of the dbt Cloud environment
- OnFailure bool
- Whether to send notifications for failed model runs
- OnSkipped bool
- Whether to send notifications for skipped model runs
- OnSuccess bool
- Whether to send notifications for successful model runs
- OnWarning bool
- Whether to send notifications for model runs with warnings
- enabled Boolean
- Whether model notifications are enabled for this environment
- environmentId String
- The ID of the dbt Cloud environment
- onFailure Boolean
- Whether to send notifications for failed model runs
- onSkipped Boolean
- Whether to send notifications for skipped model runs
- onSuccess Boolean
- Whether to send notifications for successful model runs
- onWarning Boolean
- Whether to send notifications for model runs with warnings
- enabled boolean
- Whether model notifications are enabled for this environment
- environmentId string
- The ID of the dbt Cloud environment
- onFailure boolean
- Whether to send notifications for failed model runs
- onSkipped boolean
- Whether to send notifications for skipped model runs
- onSuccess boolean
- Whether to send notifications for successful model runs
- onWarning boolean
- Whether to send notifications for model runs with warnings
- enabled bool
- Whether model notifications are enabled for this environment
- environment_id str
- The ID of the dbt Cloud environment
- on_failure bool
- Whether to send notifications for failed model runs
- on_skipped bool
- Whether to send notifications for skipped model runs
- on_success bool
- Whether to send notifications for successful model runs
- on_warning bool
- Whether to send notifications for model runs with warnings
- enabled Boolean
- Whether model notifications are enabled for this environment
- environmentId String
- The ID of the dbt Cloud environment
- onFailure Boolean
- Whether to send notifications for failed model runs
- onSkipped Boolean
- Whether to send notifications for skipped model runs
- onSuccess Boolean
- Whether to send notifications for successful model runs
- onWarning Boolean
- Whether to send notifications for model runs with warnings
Import
Model notifications are imported using the environment ID where the notifications are enabled
Using import blocks (requires Terraform >= 1.5)
import {
to = dbtcloud_model_notifications.my_model_notifications
id = “environment_id”
}
import {
to = dbtcloud_model_notifications.my_model_notifications
id = “12345”
}
Using the older import command
$ pulumi import dbtcloud:index/modelNotifications:ModelNotifications my_model_notifications "environment_id"
$ pulumi import dbtcloud:index/modelNotifications:ModelNotifications my_model_notifications 12345
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 dbtcloudTerraform Provider.
