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

opentelekomcloud.SmnTopicAttributeV2

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 topic attribute you can get at documentation portal

    Manages a V2 Topic Attribute 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 attribute1 = new opentelekomcloud.SmnTopicAttributeV2("attribute1", {
        topicUrn: topic1.topicUrn,
        attributeName: "access_policy",
        topicAttribute: pulumi.interpolate`{
      "Version": "2016-09-07",
      "Id": "__default_policy_ID",
      "Statement": [
        {
          "Sid": "__service_pub_0",
          "Effect": "Allow",
          "Principal": {
            "Service": [
              "OBS"
            ]
          },
          "Action": [
            "SMN:Publish",
            "SMN:QueryTopicDetail"
          ],
          "Resource": "${topic1.topicUrn}"
        }
      ]
    }
    `,
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    topic1 = opentelekomcloud.SmnTopicV2("topic1", display_name="The display name of topic_1")
    attribute1 = opentelekomcloud.SmnTopicAttributeV2("attribute1",
        topic_urn=topic1.topic_urn,
        attribute_name="access_policy",
        topic_attribute=topic1.topic_urn.apply(lambda topic_urn: f"""{{
      "Version": "2016-09-07",
      "Id": "__default_policy_ID",
      "Statement": [
        {{
          "Sid": "__service_pub_0",
          "Effect": "Allow",
          "Principal": {{
            "Service": [
              "OBS"
            ]
          }},
          "Action": [
            "SMN:Publish",
            "SMN:QueryTopicDetail"
          ],
          "Resource": "{topic_urn}"
        }}
      ]
    }}
    """))
    
    package main
    
    import (
    	"fmt"
    
    	"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.NewSmnTopicAttributeV2(ctx, "attribute1", &opentelekomcloud.SmnTopicAttributeV2Args{
    			TopicUrn:      topic1.TopicUrn,
    			AttributeName: pulumi.String("access_policy"),
    			TopicAttribute: topic1.TopicUrn.ApplyT(func(topicUrn string) (string, error) {
    				return fmt.Sprintf(`{
      "Version": "2016-09-07",
      "Id": "__default_policy_ID",
      "Statement": [
        {
          "Sid": "__service_pub_0",
          "Effect": "Allow",
          "Principal": {
            "Service": [
              "OBS"
            ]
          },
          "Action": [
            "SMN:Publish",
            "SMN:QueryTopicDetail"
          ],
          "Resource": "%v"
        }
      ]
    }
    `, topicUrn), nil
    			}).(pulumi.StringOutput),
    		})
    		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 attribute1 = new Opentelekomcloud.SmnTopicAttributeV2("attribute1", new()
        {
            TopicUrn = topic1.TopicUrn,
            AttributeName = "access_policy",
            TopicAttribute = topic1.TopicUrn.Apply(topicUrn => @$"{{
      ""Version"": ""2016-09-07"",
      ""Id"": ""__default_policy_ID"",
      ""Statement"": [
        {{
          ""Sid"": ""__service_pub_0"",
          ""Effect"": ""Allow"",
          ""Principal"": {{
            ""Service"": [
              ""OBS""
            ]
          }},
          ""Action"": [
            ""SMN:Publish"",
            ""SMN:QueryTopicDetail""
          ],
          ""Resource"": ""{topicUrn}""
        }}
      ]
    }}
    "),
        });
    
    });
    
    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.SmnTopicAttributeV2;
    import com.pulumi.opentelekomcloud.SmnTopicAttributeV2Args;
    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 attribute1 = new SmnTopicAttributeV2("attribute1", SmnTopicAttributeV2Args.builder()
                .topicUrn(topic1.topicUrn())
                .attributeName("access_policy")
                .topicAttribute(topic1.topicUrn().applyValue(topicUrn -> """
    {
      "Version": "2016-09-07",
      "Id": "__default_policy_ID",
      "Statement": [
        {
          "Sid": "__service_pub_0",
          "Effect": "Allow",
          "Principal": {
            "Service": [
              "OBS"
            ]
          },
          "Action": [
            "SMN:Publish",
            "SMN:QueryTopicDetail"
          ],
          "Resource": "%s"
        }
      ]
    }
    ", topicUrn)))
                .build());
    
        }
    }
    
    resources:
      topic1:
        type: opentelekomcloud:SmnTopicV2
        properties:
          displayName: The display name of topic_1
      attribute1:
        type: opentelekomcloud:SmnTopicAttributeV2
        properties:
          topicUrn: ${topic1.topicUrn}
          attributeName: access_policy
          topicAttribute: |
            {
              "Version": "2016-09-07",
              "Id": "__default_policy_ID",
              "Statement": [
                {
                  "Sid": "__service_pub_0",
                  "Effect": "Allow",
                  "Principal": {
                    "Service": [
                      "OBS"
                    ]
                  },
                  "Action": [
                    "SMN:Publish",
                    "SMN:QueryTopicDetail"
                  ],
                  "Resource": "${topic1.topicUrn}"
                }
              ]
            }        
    

    Create SmnTopicAttributeV2 Resource

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

    Constructor syntax

    new SmnTopicAttributeV2(name: string, args: SmnTopicAttributeV2Args, opts?: CustomResourceOptions);
    @overload
    def SmnTopicAttributeV2(resource_name: str,
                            args: SmnTopicAttributeV2Args,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def SmnTopicAttributeV2(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            attribute_name: Optional[str] = None,
                            topic_attribute: Optional[str] = None,
                            topic_urn: Optional[str] = None,
                            smn_topic_attribute_v2_id: Optional[str] = None)
    func NewSmnTopicAttributeV2(ctx *Context, name string, args SmnTopicAttributeV2Args, opts ...ResourceOption) (*SmnTopicAttributeV2, error)
    public SmnTopicAttributeV2(string name, SmnTopicAttributeV2Args args, CustomResourceOptions? opts = null)
    public SmnTopicAttributeV2(String name, SmnTopicAttributeV2Args args)
    public SmnTopicAttributeV2(String name, SmnTopicAttributeV2Args args, CustomResourceOptions options)
    
    type: opentelekomcloud:SmnTopicAttributeV2
    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 SmnTopicAttributeV2Args
    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 SmnTopicAttributeV2Args
    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 SmnTopicAttributeV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SmnTopicAttributeV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SmnTopicAttributeV2Args
    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 smnTopicAttributeV2Resource = new Opentelekomcloud.SmnTopicAttributeV2("smnTopicAttributeV2Resource", new()
    {
        AttributeName = "string",
        TopicAttribute = "string",
        TopicUrn = "string",
        SmnTopicAttributeV2Id = "string",
    });
    
    example, err := opentelekomcloud.NewSmnTopicAttributeV2(ctx, "smnTopicAttributeV2Resource", &opentelekomcloud.SmnTopicAttributeV2Args{
    	AttributeName:         pulumi.String("string"),
    	TopicAttribute:        pulumi.String("string"),
    	TopicUrn:              pulumi.String("string"),
    	SmnTopicAttributeV2Id: pulumi.String("string"),
    })
    
    var smnTopicAttributeV2Resource = new SmnTopicAttributeV2("smnTopicAttributeV2Resource", SmnTopicAttributeV2Args.builder()
        .attributeName("string")
        .topicAttribute("string")
        .topicUrn("string")
        .smnTopicAttributeV2Id("string")
        .build());
    
    smn_topic_attribute_v2_resource = opentelekomcloud.SmnTopicAttributeV2("smnTopicAttributeV2Resource",
        attribute_name="string",
        topic_attribute="string",
        topic_urn="string",
        smn_topic_attribute_v2_id="string")
    
    const smnTopicAttributeV2Resource = new opentelekomcloud.SmnTopicAttributeV2("smnTopicAttributeV2Resource", {
        attributeName: "string",
        topicAttribute: "string",
        topicUrn: "string",
        smnTopicAttributeV2Id: "string",
    });
    
    type: opentelekomcloud:SmnTopicAttributeV2
    properties:
        attributeName: string
        smnTopicAttributeV2Id: string
        topicAttribute: string
        topicUrn: string
    

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

    AttributeName string
    Attribute name. Valid value is access_policy.
    TopicAttribute string
    Topic attribute value. The value cannot exceed 30 KB.
    TopicUrn string
    Resource identifier of a topic, which is unique.
    SmnTopicAttributeV2Id string
    AttributeName string
    Attribute name. Valid value is access_policy.
    TopicAttribute string
    Topic attribute value. The value cannot exceed 30 KB.
    TopicUrn string
    Resource identifier of a topic, which is unique.
    SmnTopicAttributeV2Id string
    attributeName String
    Attribute name. Valid value is access_policy.
    topicAttribute String
    Topic attribute value. The value cannot exceed 30 KB.
    topicUrn String
    Resource identifier of a topic, which is unique.
    smnTopicAttributeV2Id String
    attributeName string
    Attribute name. Valid value is access_policy.
    topicAttribute string
    Topic attribute value. The value cannot exceed 30 KB.
    topicUrn string
    Resource identifier of a topic, which is unique.
    smnTopicAttributeV2Id string
    attribute_name str
    Attribute name. Valid value is access_policy.
    topic_attribute str
    Topic attribute value. The value cannot exceed 30 KB.
    topic_urn str
    Resource identifier of a topic, which is unique.
    smn_topic_attribute_v2_id str
    attributeName String
    Attribute name. Valid value is access_policy.
    topicAttribute String
    Topic attribute value. The value cannot exceed 30 KB.
    topicUrn String
    Resource identifier of a topic, which is unique.
    smnTopicAttributeV2Id String

    Outputs

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

    Get an existing SmnTopicAttributeV2 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?: SmnTopicAttributeV2State, opts?: CustomResourceOptions): SmnTopicAttributeV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            attribute_name: Optional[str] = None,
            smn_topic_attribute_v2_id: Optional[str] = None,
            topic_attribute: Optional[str] = None,
            topic_urn: Optional[str] = None) -> SmnTopicAttributeV2
    func GetSmnTopicAttributeV2(ctx *Context, name string, id IDInput, state *SmnTopicAttributeV2State, opts ...ResourceOption) (*SmnTopicAttributeV2, error)
    public static SmnTopicAttributeV2 Get(string name, Input<string> id, SmnTopicAttributeV2State? state, CustomResourceOptions? opts = null)
    public static SmnTopicAttributeV2 get(String name, Output<String> id, SmnTopicAttributeV2State state, CustomResourceOptions options)
    resources:  _:    type: opentelekomcloud:SmnTopicAttributeV2    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:
    AttributeName string
    Attribute name. Valid value is access_policy.
    SmnTopicAttributeV2Id string
    TopicAttribute string
    Topic attribute value. The value cannot exceed 30 KB.
    TopicUrn string
    Resource identifier of a topic, which is unique.
    AttributeName string
    Attribute name. Valid value is access_policy.
    SmnTopicAttributeV2Id string
    TopicAttribute string
    Topic attribute value. The value cannot exceed 30 KB.
    TopicUrn string
    Resource identifier of a topic, which is unique.
    attributeName String
    Attribute name. Valid value is access_policy.
    smnTopicAttributeV2Id String
    topicAttribute String
    Topic attribute value. The value cannot exceed 30 KB.
    topicUrn String
    Resource identifier of a topic, which is unique.
    attributeName string
    Attribute name. Valid value is access_policy.
    smnTopicAttributeV2Id string
    topicAttribute string
    Topic attribute value. The value cannot exceed 30 KB.
    topicUrn string
    Resource identifier of a topic, which is unique.
    attribute_name str
    Attribute name. Valid value is access_policy.
    smn_topic_attribute_v2_id str
    topic_attribute str
    Topic attribute value. The value cannot exceed 30 KB.
    topic_urn str
    Resource identifier of a topic, which is unique.
    attributeName String
    Attribute name. Valid value is access_policy.
    smnTopicAttributeV2Id String
    topicAttribute String
    Topic attribute value. The value cannot exceed 30 KB.
    topicUrn String
    Resource identifier of a topic, which is unique.

    Import

    SMNv2 Topic Attribute can be imported using the <topic_urn>/<attribute_name>, e.g.

    $ pulumi import opentelekomcloud:index/smnTopicAttributeV2:SmnTopicAttributeV2 attribute_1 urn:smn:eu-de:5045c215010c440d91b2f7dce1f3753b:example/access_policy
    

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

    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