1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. MscSubWebhook
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

alicloud.MscSubWebhook

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

    Provides a Msc Sub Webhook resource.

    NOTE: Available since v1.141.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as std from "@pulumi/std";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tfexample";
    const token = config.get("token") || "abcd****";
    const example = new alicloud.MscSubWebhook("example", {
        serverUrl: std.format({
            input: "https://oapi.dingtalk.com/robot/send?access_token=%s",
            args: [token],
        }).then(invoke => invoke.result),
        webhookName: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_std as std
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tfexample"
    token = config.get("token")
    if token is None:
        token = "abcd****"
    example = alicloud.MscSubWebhook("example",
        server_url=std.format(input="https://oapi.dingtalk.com/robot/send?access_token=%s",
            args=[token]).result,
        webhook_name=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tfexample"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		token := "abcd****"
    		if param := cfg.Get("token"); param != "" {
    			token = param
    		}
    		invokeFormat, err := std.Format(ctx, &std.FormatArgs{
    			Input: "https://oapi.dingtalk.com/robot/send?access_token=%s",
    			Args: []string{
    				token,
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = alicloud.NewMscSubWebhook(ctx, "example", &alicloud.MscSubWebhookArgs{
    			ServerUrl:   pulumi.String(invokeFormat.Result),
    			WebhookName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tfexample";
        var token = config.Get("token") ?? "abcd****";
        var example = new AliCloud.MscSubWebhook("example", new()
        {
            ServerUrl = Std.Format.Invoke(new()
            {
                Input = "https://oapi.dingtalk.com/robot/send?access_token=%s",
                Args = new[]
                {
                    token,
                },
            }).Apply(invoke => invoke.Result),
            WebhookName = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.MscSubWebhook;
    import com.pulumi.alicloud.MscSubWebhookArgs;
    import com.pulumi.std.StdFunctions;
    import com.pulumi.std.inputs.FormatArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("tfexample");
            final var token = config.get("token").orElse("abcd****");
            var example = new MscSubWebhook("example", MscSubWebhookArgs.builder()
                .serverUrl(StdFunctions.format(FormatArgs.builder()
                    .input("https://oapi.dingtalk.com/robot/send?access_token=%s")
                    .args(token)
                    .build()).result())
                .webhookName(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tfexample
      token:
        type: string
        default: abcd****
    resources:
      example:
        type: alicloud:MscSubWebhook
        properties:
          serverUrl:
            fn::invoke:
              function: std:format
              arguments:
                input: https://oapi.dingtalk.com/robot/send?access_token=%s
                args:
                  - ${token}
              return: result
          webhookName: ${name}
    

    Create MscSubWebhook Resource

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

    Constructor syntax

    new MscSubWebhook(name: string, args: MscSubWebhookArgs, opts?: CustomResourceOptions);
    @overload
    def MscSubWebhook(resource_name: str,
                      args: MscSubWebhookArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def MscSubWebhook(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      server_url: Optional[str] = None,
                      webhook_name: Optional[str] = None)
    func NewMscSubWebhook(ctx *Context, name string, args MscSubWebhookArgs, opts ...ResourceOption) (*MscSubWebhook, error)
    public MscSubWebhook(string name, MscSubWebhookArgs args, CustomResourceOptions? opts = null)
    public MscSubWebhook(String name, MscSubWebhookArgs args)
    public MscSubWebhook(String name, MscSubWebhookArgs args, CustomResourceOptions options)
    
    type: alicloud:MscSubWebhook
    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 MscSubWebhookArgs
    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 MscSubWebhookArgs
    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 MscSubWebhookArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MscSubWebhookArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MscSubWebhookArgs
    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 mscSubWebhookResource = new AliCloud.MscSubWebhook("mscSubWebhookResource", new()
    {
        ServerUrl = "string",
        WebhookName = "string",
    });
    
    example, err := alicloud.NewMscSubWebhook(ctx, "mscSubWebhookResource", &alicloud.MscSubWebhookArgs{
    	ServerUrl:   pulumi.String("string"),
    	WebhookName: pulumi.String("string"),
    })
    
    var mscSubWebhookResource = new MscSubWebhook("mscSubWebhookResource", MscSubWebhookArgs.builder()
        .serverUrl("string")
        .webhookName("string")
        .build());
    
    msc_sub_webhook_resource = alicloud.MscSubWebhook("mscSubWebhookResource",
        server_url="string",
        webhook_name="string")
    
    const mscSubWebhookResource = new alicloud.MscSubWebhook("mscSubWebhookResource", {
        serverUrl: "string",
        webhookName: "string",
    });
    
    type: alicloud:MscSubWebhook
    properties:
        serverUrl: string
        webhookName: string
    

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

    ServerUrl string
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    WebhookName string
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    ServerUrl string
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    WebhookName string
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    serverUrl String
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    webhookName String
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    serverUrl string
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    webhookName string
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    server_url str
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    webhook_name str
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    serverUrl String
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    webhookName String
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.

    Outputs

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

    Get an existing MscSubWebhook 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?: MscSubWebhookState, opts?: CustomResourceOptions): MscSubWebhook
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            server_url: Optional[str] = None,
            webhook_name: Optional[str] = None) -> MscSubWebhook
    func GetMscSubWebhook(ctx *Context, name string, id IDInput, state *MscSubWebhookState, opts ...ResourceOption) (*MscSubWebhook, error)
    public static MscSubWebhook Get(string name, Input<string> id, MscSubWebhookState? state, CustomResourceOptions? opts = null)
    public static MscSubWebhook get(String name, Output<String> id, MscSubWebhookState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:MscSubWebhook    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.
    The following state arguments are supported:
    ServerUrl string
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    WebhookName string
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    ServerUrl string
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    WebhookName string
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    serverUrl String
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    webhookName String
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    serverUrl string
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    webhookName string
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    server_url str
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    webhook_name str
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    serverUrl String
    The serverUrl of the Webhook. This url must start with https://oapi.dingtalk.com/robot/send?access_token=.
    webhookName String
    The name of the Webhook. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.

    Import

    Msc Sub Webhook can be imported using the id, e.g.

    $ pulumi import alicloud:index/mscSubWebhook:MscSubWebhook example <id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi