1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. SmnSubscriptionV2
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

opentelekomcloud.SmnSubscriptionV2

Explore with Pulumi AI

opentelekomcloud logo
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

    Up-to-date reference of API arguments for SMN subscription you can get at documentation portal

    Manages a V2 subscription resource within OpenTelekomCloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const topic1 = new opentelekomcloud.SmnTopicV2("topic1", {displayName: "The display name of topic_1"});
    const subscription1 = new opentelekomcloud.SmnSubscriptionV2("subscription1", {
        topicUrn: topic1.smnTopicV2Id,
        endpoint: "mailtest@gmail.com",
        protocol: "email",
        remark: "O&M",
    });
    const subscription2 = new opentelekomcloud.SmnSubscriptionV2("subscription2", {
        topicUrn: topic1.smnTopicV2Id,
        endpoint: "13600000000",
        protocol: "sms",
        remark: "O&M",
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    topic1 = opentelekomcloud.SmnTopicV2("topic1", display_name="The display name of topic_1")
    subscription1 = opentelekomcloud.SmnSubscriptionV2("subscription1",
        topic_urn=topic1.smn_topic_v2_id,
        endpoint="mailtest@gmail.com",
        protocol="email",
        remark="O&M")
    subscription2 = opentelekomcloud.SmnSubscriptionV2("subscription2",
        topic_urn=topic1.smn_topic_v2_id,
        endpoint="13600000000",
        protocol="sms",
        remark="O&M")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		topic1, err := opentelekomcloud.NewSmnTopicV2(ctx, "topic1", &opentelekomcloud.SmnTopicV2Args{
    			DisplayName: pulumi.String("The display name of topic_1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = opentelekomcloud.NewSmnSubscriptionV2(ctx, "subscription1", &opentelekomcloud.SmnSubscriptionV2Args{
    			TopicUrn: topic1.SmnTopicV2Id,
    			Endpoint: pulumi.String("mailtest@gmail.com"),
    			Protocol: pulumi.String("email"),
    			Remark:   pulumi.String("O&M"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = opentelekomcloud.NewSmnSubscriptionV2(ctx, "subscription2", &opentelekomcloud.SmnSubscriptionV2Args{
    			TopicUrn: topic1.SmnTopicV2Id,
    			Endpoint: pulumi.String("13600000000"),
    			Protocol: pulumi.String("sms"),
    			Remark:   pulumi.String("O&M"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var topic1 = new Opentelekomcloud.SmnTopicV2("topic1", new()
        {
            DisplayName = "The display name of topic_1",
        });
    
        var subscription1 = new Opentelekomcloud.SmnSubscriptionV2("subscription1", new()
        {
            TopicUrn = topic1.SmnTopicV2Id,
            Endpoint = "mailtest@gmail.com",
            Protocol = "email",
            Remark = "O&M",
        });
    
        var subscription2 = new Opentelekomcloud.SmnSubscriptionV2("subscription2", new()
        {
            TopicUrn = topic1.SmnTopicV2Id,
            Endpoint = "13600000000",
            Protocol = "sms",
            Remark = "O&M",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.SmnTopicV2;
    import com.pulumi.opentelekomcloud.SmnTopicV2Args;
    import com.pulumi.opentelekomcloud.SmnSubscriptionV2;
    import com.pulumi.opentelekomcloud.SmnSubscriptionV2Args;
    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 topic1 = new SmnTopicV2("topic1", SmnTopicV2Args.builder()
                .displayName("The display name of topic_1")
                .build());
    
            var subscription1 = new SmnSubscriptionV2("subscription1", SmnSubscriptionV2Args.builder()
                .topicUrn(topic1.smnTopicV2Id())
                .endpoint("mailtest@gmail.com")
                .protocol("email")
                .remark("O&M")
                .build());
    
            var subscription2 = new SmnSubscriptionV2("subscription2", SmnSubscriptionV2Args.builder()
                .topicUrn(topic1.smnTopicV2Id())
                .endpoint("13600000000")
                .protocol("sms")
                .remark("O&M")
                .build());
    
        }
    }
    
    resources:
      topic1:
        type: opentelekomcloud:SmnTopicV2
        properties:
          displayName: The display name of topic_1
      subscription1:
        type: opentelekomcloud:SmnSubscriptionV2
        properties:
          topicUrn: ${topic1.smnTopicV2Id}
          endpoint: mailtest@gmail.com
          protocol: email
          remark: O&M
      subscription2:
        type: opentelekomcloud:SmnSubscriptionV2
        properties:
          topicUrn: ${topic1.smnTopicV2Id}
          endpoint: '13600000000'
          protocol: sms
          remark: O&M
    

    Create SmnSubscriptionV2 Resource

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

    Constructor syntax

    new SmnSubscriptionV2(name: string, args: SmnSubscriptionV2Args, opts?: CustomResourceOptions);
    @overload
    def SmnSubscriptionV2(resource_name: str,
                          args: SmnSubscriptionV2Args,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def SmnSubscriptionV2(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          endpoint: Optional[str] = None,
                          protocol: Optional[str] = None,
                          topic_urn: Optional[str] = None,
                          project_name: Optional[str] = None,
                          remark: Optional[str] = None,
                          smn_subscription_v2_id: Optional[str] = None)
    func NewSmnSubscriptionV2(ctx *Context, name string, args SmnSubscriptionV2Args, opts ...ResourceOption) (*SmnSubscriptionV2, error)
    public SmnSubscriptionV2(string name, SmnSubscriptionV2Args args, CustomResourceOptions? opts = null)
    public SmnSubscriptionV2(String name, SmnSubscriptionV2Args args)
    public SmnSubscriptionV2(String name, SmnSubscriptionV2Args args, CustomResourceOptions options)
    
    type: opentelekomcloud:SmnSubscriptionV2
    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 SmnSubscriptionV2Args
    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 SmnSubscriptionV2Args
    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 SmnSubscriptionV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SmnSubscriptionV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SmnSubscriptionV2Args
    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 smnSubscriptionV2Resource = new Opentelekomcloud.SmnSubscriptionV2("smnSubscriptionV2Resource", new()
    {
        Endpoint = "string",
        Protocol = "string",
        TopicUrn = "string",
        ProjectName = "string",
        Remark = "string",
        SmnSubscriptionV2Id = "string",
    });
    
    example, err := opentelekomcloud.NewSmnSubscriptionV2(ctx, "smnSubscriptionV2Resource", &opentelekomcloud.SmnSubscriptionV2Args{
    	Endpoint:            pulumi.String("string"),
    	Protocol:            pulumi.String("string"),
    	TopicUrn:            pulumi.String("string"),
    	ProjectName:         pulumi.String("string"),
    	Remark:              pulumi.String("string"),
    	SmnSubscriptionV2Id: pulumi.String("string"),
    })
    
    var smnSubscriptionV2Resource = new SmnSubscriptionV2("smnSubscriptionV2Resource", SmnSubscriptionV2Args.builder()
        .endpoint("string")
        .protocol("string")
        .topicUrn("string")
        .projectName("string")
        .remark("string")
        .smnSubscriptionV2Id("string")
        .build());
    
    smn_subscription_v2_resource = opentelekomcloud.SmnSubscriptionV2("smnSubscriptionV2Resource",
        endpoint="string",
        protocol="string",
        topic_urn="string",
        project_name="string",
        remark="string",
        smn_subscription_v2_id="string")
    
    const smnSubscriptionV2Resource = new opentelekomcloud.SmnSubscriptionV2("smnSubscriptionV2Resource", {
        endpoint: "string",
        protocol: "string",
        topicUrn: "string",
        projectName: "string",
        remark: "string",
        smnSubscriptionV2Id: "string",
    });
    
    type: opentelekomcloud:SmnSubscriptionV2
    properties:
        endpoint: string
        projectName: string
        protocol: string
        remark: string
        smnSubscriptionV2Id: string
        topicUrn: string
    

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

    Endpoint string
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    Protocol string
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    TopicUrn string
    Specifies the resource identifier of a topic, which is unique.
    ProjectName string
    The project name for the subscription.
    Remark string
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    SmnSubscriptionV2Id string
    Endpoint string
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    Protocol string
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    TopicUrn string
    Specifies the resource identifier of a topic, which is unique.
    ProjectName string
    The project name for the subscription.
    Remark string
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    SmnSubscriptionV2Id string
    endpoint String
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    protocol String
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    topicUrn String
    Specifies the resource identifier of a topic, which is unique.
    projectName String
    The project name for the subscription.
    remark String
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    smnSubscriptionV2Id String
    endpoint string
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    protocol string
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    topicUrn string
    Specifies the resource identifier of a topic, which is unique.
    projectName string
    The project name for the subscription.
    remark string
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    smnSubscriptionV2Id string
    endpoint str
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    protocol str
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    topic_urn str
    Specifies the resource identifier of a topic, which is unique.
    project_name str
    The project name for the subscription.
    remark str
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    smn_subscription_v2_id str
    endpoint String
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    protocol String
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    topicUrn String
    Specifies the resource identifier of a topic, which is unique.
    projectName String
    The project name for the subscription.
    remark String
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    smnSubscriptionV2Id String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SmnSubscriptionV2 resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Owner string
    The project ID of the topic creator.
    Status double
    The subscription status.
    SubscriptionUrn string
    The resource identifier of a subscription.
    Id string
    The provider-assigned unique ID for this managed resource.
    Owner string
    The project ID of the topic creator.
    Status float64
    The subscription status.
    SubscriptionUrn string
    The resource identifier of a subscription.
    id String
    The provider-assigned unique ID for this managed resource.
    owner String
    The project ID of the topic creator.
    status Double
    The subscription status.
    subscriptionUrn String
    The resource identifier of a subscription.
    id string
    The provider-assigned unique ID for this managed resource.
    owner string
    The project ID of the topic creator.
    status number
    The subscription status.
    subscriptionUrn string
    The resource identifier of a subscription.
    id str
    The provider-assigned unique ID for this managed resource.
    owner str
    The project ID of the topic creator.
    status float
    The subscription status.
    subscription_urn str
    The resource identifier of a subscription.
    id String
    The provider-assigned unique ID for this managed resource.
    owner String
    The project ID of the topic creator.
    status Number
    The subscription status.
    subscriptionUrn String
    The resource identifier of a subscription.

    Look up Existing SmnSubscriptionV2 Resource

    Get an existing SmnSubscriptionV2 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?: SmnSubscriptionV2State, opts?: CustomResourceOptions): SmnSubscriptionV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            endpoint: Optional[str] = None,
            owner: Optional[str] = None,
            project_name: Optional[str] = None,
            protocol: Optional[str] = None,
            remark: Optional[str] = None,
            smn_subscription_v2_id: Optional[str] = None,
            status: Optional[float] = None,
            subscription_urn: Optional[str] = None,
            topic_urn: Optional[str] = None) -> SmnSubscriptionV2
    func GetSmnSubscriptionV2(ctx *Context, name string, id IDInput, state *SmnSubscriptionV2State, opts ...ResourceOption) (*SmnSubscriptionV2, error)
    public static SmnSubscriptionV2 Get(string name, Input<string> id, SmnSubscriptionV2State? state, CustomResourceOptions? opts = null)
    public static SmnSubscriptionV2 get(String name, Output<String> id, SmnSubscriptionV2State state, CustomResourceOptions options)
    resources:  _:    type: opentelekomcloud:SmnSubscriptionV2    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:
    Endpoint string
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    Owner string
    The project ID of the topic creator.
    ProjectName string
    The project name for the subscription.
    Protocol string
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    Remark string
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    SmnSubscriptionV2Id string
    Status double
    The subscription status.
    SubscriptionUrn string
    The resource identifier of a subscription.
    TopicUrn string
    Specifies the resource identifier of a topic, which is unique.
    Endpoint string
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    Owner string
    The project ID of the topic creator.
    ProjectName string
    The project name for the subscription.
    Protocol string
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    Remark string
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    SmnSubscriptionV2Id string
    Status float64
    The subscription status.
    SubscriptionUrn string
    The resource identifier of a subscription.
    TopicUrn string
    Specifies the resource identifier of a topic, which is unique.
    endpoint String
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    owner String
    The project ID of the topic creator.
    projectName String
    The project name for the subscription.
    protocol String
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    remark String
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    smnSubscriptionV2Id String
    status Double
    The subscription status.
    subscriptionUrn String
    The resource identifier of a subscription.
    topicUrn String
    Specifies the resource identifier of a topic, which is unique.
    endpoint string
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    owner string
    The project ID of the topic creator.
    projectName string
    The project name for the subscription.
    protocol string
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    remark string
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    smnSubscriptionV2Id string
    status number
    The subscription status.
    subscriptionUrn string
    The resource identifier of a subscription.
    topicUrn string
    Specifies the resource identifier of a topic, which is unique.
    endpoint str
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    owner str
    The project ID of the topic creator.
    project_name str
    The project name for the subscription.
    protocol str
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    remark str
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    smn_subscription_v2_id str
    status float
    The subscription status.
    subscription_urn str
    The resource identifier of a subscription.
    topic_urn str
    Specifies the resource identifier of a topic, which is unique.
    endpoint String
    Specifies the message endpoint.

    • For an HTTP subscription, the endpoint starts with http://.
    • For an HTTPS subscription, the endpoint starts with https://.
    • For an email subscription, the endpoint is a mail address.
    • For an SMS message subscription, the endpoint is a phone number.
    owner String
    The project ID of the topic creator.
    projectName String
    The project name for the subscription.
    protocol String
    Specifies protocol of the message endpoint. Currently, email, sms, http, and https are supported.
    remark String
    Specifies the remark information. The remarks must be a UTF-8-coded character string containing 128 bytes.
    smnSubscriptionV2Id String
    status Number
    The subscription status.
    subscriptionUrn String
    The resource identifier of a subscription.
    topicUrn String
    Specifies the resource identifier of a topic, which is unique.

    Package Details

    Repository
    opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
    License
    Notes
    This Pulumi package is based on the opentelekomcloud Terraform Provider.
    opentelekomcloud logo
    opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud