1. Packages
  2. Datadog Provider
  3. API Docs
  4. slack
  5. Channel
Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi

datadog.slack.Channel

Explore with Pulumi AI

datadog logo
Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi

    Resource for interacting with the Datadog Slack channel API

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const testChannel = new datadog.slack.Channel("test_channel", {
        accountName: "foo",
        channelName: "#test_channel",
        display: {
            message: true,
            notified: false,
            snapshot: false,
            tags: true,
        },
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    test_channel = datadog.slack.Channel("test_channel",
        account_name="foo",
        channel_name="#test_channel",
        display={
            "message": True,
            "notified": False,
            "snapshot": False,
            "tags": True,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog/slack"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := slack.NewChannel(ctx, "test_channel", &slack.ChannelArgs{
    			AccountName: pulumi.String("foo"),
    			ChannelName: pulumi.String("#test_channel"),
    			Display: &slack.ChannelDisplayArgs{
    				Message:  pulumi.Bool(true),
    				Notified: pulumi.Bool(false),
    				Snapshot: pulumi.Bool(false),
    				Tags:     pulumi.Bool(true),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        var testChannel = new Datadog.Slack.Channel("test_channel", new()
        {
            AccountName = "foo",
            ChannelName = "#test_channel",
            Display = new Datadog.Slack.Inputs.ChannelDisplayArgs
            {
                Message = true,
                Notified = false,
                Snapshot = false,
                Tags = true,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.slack.Channel;
    import com.pulumi.datadog.slack.ChannelArgs;
    import com.pulumi.datadog.slack.inputs.ChannelDisplayArgs;
    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 testChannel = new Channel("testChannel", ChannelArgs.builder()
                .accountName("foo")
                .channelName("#test_channel")
                .display(ChannelDisplayArgs.builder()
                    .message(true)
                    .notified(false)
                    .snapshot(false)
                    .tags(true)
                    .build())
                .build());
    
        }
    }
    
    resources:
      testChannel:
        type: datadog:slack:Channel
        name: test_channel
        properties:
          accountName: foo
          channelName: '#test_channel'
          display:
            message: true
            notified: false
            snapshot: false
            tags: true
    

    Create Channel Resource

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

    Constructor syntax

    new Channel(name: string, args: ChannelArgs, opts?: CustomResourceOptions);
    @overload
    def Channel(resource_name: str,
                args: ChannelArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Channel(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                account_name: Optional[str] = None,
                channel_name: Optional[str] = None,
                display: Optional[ChannelDisplayArgs] = None)
    func NewChannel(ctx *Context, name string, args ChannelArgs, opts ...ResourceOption) (*Channel, error)
    public Channel(string name, ChannelArgs args, CustomResourceOptions? opts = null)
    public Channel(String name, ChannelArgs args)
    public Channel(String name, ChannelArgs args, CustomResourceOptions options)
    
    type: datadog:slack:Channel
    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 ChannelArgs
    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 ChannelArgs
    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 ChannelArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ChannelArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ChannelArgs
    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 channelResource = new Datadog.Slack.Channel("channelResource", new()
    {
        AccountName = "string",
        ChannelName = "string",
        Display = new Datadog.Slack.Inputs.ChannelDisplayArgs
        {
            Message = false,
            Notified = false,
            Snapshot = false,
            Tags = false,
        },
    });
    
    example, err := slack.NewChannel(ctx, "channelResource", &slack.ChannelArgs{
    	AccountName: pulumi.String("string"),
    	ChannelName: pulumi.String("string"),
    	Display: &slack.ChannelDisplayArgs{
    		Message:  pulumi.Bool(false),
    		Notified: pulumi.Bool(false),
    		Snapshot: pulumi.Bool(false),
    		Tags:     pulumi.Bool(false),
    	},
    })
    
    var channelResource = new Channel("channelResource", ChannelArgs.builder()
        .accountName("string")
        .channelName("string")
        .display(ChannelDisplayArgs.builder()
            .message(false)
            .notified(false)
            .snapshot(false)
            .tags(false)
            .build())
        .build());
    
    channel_resource = datadog.slack.Channel("channelResource",
        account_name="string",
        channel_name="string",
        display={
            "message": False,
            "notified": False,
            "snapshot": False,
            "tags": False,
        })
    
    const channelResource = new datadog.slack.Channel("channelResource", {
        accountName: "string",
        channelName: "string",
        display: {
            message: false,
            notified: false,
            snapshot: false,
            tags: false,
        },
    });
    
    type: datadog:slack:Channel
    properties:
        accountName: string
        channelName: string
        display:
            message: false
            notified: false
            snapshot: false
            tags: false
    

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

    AccountName string
    Slack account name.
    ChannelName string
    Slack channel name.
    Display ChannelDisplay
    Configuration options for what is shown in an alert event message.
    AccountName string
    Slack account name.
    ChannelName string
    Slack channel name.
    Display ChannelDisplayArgs
    Configuration options for what is shown in an alert event message.
    accountName String
    Slack account name.
    channelName String
    Slack channel name.
    display ChannelDisplay
    Configuration options for what is shown in an alert event message.
    accountName string
    Slack account name.
    channelName string
    Slack channel name.
    display ChannelDisplay
    Configuration options for what is shown in an alert event message.
    account_name str
    Slack account name.
    channel_name str
    Slack channel name.
    display ChannelDisplayArgs
    Configuration options for what is shown in an alert event message.
    accountName String
    Slack account name.
    channelName String
    Slack channel name.
    display Property Map
    Configuration options for what is shown in an alert event message.

    Outputs

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

    Get an existing Channel 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?: ChannelState, opts?: CustomResourceOptions): Channel
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_name: Optional[str] = None,
            channel_name: Optional[str] = None,
            display: Optional[ChannelDisplayArgs] = None) -> Channel
    func GetChannel(ctx *Context, name string, id IDInput, state *ChannelState, opts ...ResourceOption) (*Channel, error)
    public static Channel Get(string name, Input<string> id, ChannelState? state, CustomResourceOptions? opts = null)
    public static Channel get(String name, Output<String> id, ChannelState 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:
    AccountName string
    Slack account name.
    ChannelName string
    Slack channel name.
    Display ChannelDisplay
    Configuration options for what is shown in an alert event message.
    AccountName string
    Slack account name.
    ChannelName string
    Slack channel name.
    Display ChannelDisplayArgs
    Configuration options for what is shown in an alert event message.
    accountName String
    Slack account name.
    channelName String
    Slack channel name.
    display ChannelDisplay
    Configuration options for what is shown in an alert event message.
    accountName string
    Slack account name.
    channelName string
    Slack channel name.
    display ChannelDisplay
    Configuration options for what is shown in an alert event message.
    account_name str
    Slack account name.
    channel_name str
    Slack channel name.
    display ChannelDisplayArgs
    Configuration options for what is shown in an alert event message.
    accountName String
    Slack account name.
    channelName String
    Slack channel name.
    display Property Map
    Configuration options for what is shown in an alert event message.

    Supporting Types

    ChannelDisplay, ChannelDisplayArgs

    Message bool
    Show the main body of the alert event. Defaults to true.
    Notified bool
    Show the list of @-handles in the alert event. Defaults to true.
    Snapshot bool
    Show the alert event's snapshot image. Defaults to true.
    Tags bool
    Show the scopes on which the monitor alerted. Defaults to true.
    Message bool
    Show the main body of the alert event. Defaults to true.
    Notified bool
    Show the list of @-handles in the alert event. Defaults to true.
    Snapshot bool
    Show the alert event's snapshot image. Defaults to true.
    Tags bool
    Show the scopes on which the monitor alerted. Defaults to true.
    message Boolean
    Show the main body of the alert event. Defaults to true.
    notified Boolean
    Show the list of @-handles in the alert event. Defaults to true.
    snapshot Boolean
    Show the alert event's snapshot image. Defaults to true.
    tags Boolean
    Show the scopes on which the monitor alerted. Defaults to true.
    message boolean
    Show the main body of the alert event. Defaults to true.
    notified boolean
    Show the list of @-handles in the alert event. Defaults to true.
    snapshot boolean
    Show the alert event's snapshot image. Defaults to true.
    tags boolean
    Show the scopes on which the monitor alerted. Defaults to true.
    message bool
    Show the main body of the alert event. Defaults to true.
    notified bool
    Show the list of @-handles in the alert event. Defaults to true.
    snapshot bool
    Show the alert event's snapshot image. Defaults to true.
    tags bool
    Show the scopes on which the monitor alerted. Defaults to true.
    message Boolean
    Show the main body of the alert event. Defaults to true.
    notified Boolean
    Show the list of @-handles in the alert event. Defaults to true.
    snapshot Boolean
    Show the alert event's snapshot image. Defaults to true.
    tags Boolean
    Show the scopes on which the monitor alerted. Defaults to true.

    Import

    Slack channel integrations can be imported using their account_name and channel_name separated with a colon (:).

    $ pulumi import datadog:slack/channel:Channel test_channel "foo:#test_channel"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi