1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. MqttUser
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.MqttUser

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a MQTT user

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.MqttUser("example", {
        instanceId: "mqtt-zxjwkr98",
        password: "Password@123",
        remark: "Remark.",
        username: "tf-example",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.MqttUser("example",
        instance_id="mqtt-zxjwkr98",
        password="Password@123",
        remark="Remark.",
        username="tf-example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewMqttUser(ctx, "example", &tencentcloud.MqttUserArgs{
    			InstanceId: pulumi.String("mqtt-zxjwkr98"),
    			Password:   pulumi.String("Password@123"),
    			Remark:     pulumi.String("Remark."),
    			Username:   pulumi.String("tf-example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Tencentcloud.MqttUser("example", new()
        {
            InstanceId = "mqtt-zxjwkr98",
            Password = "Password@123",
            Remark = "Remark.",
            Username = "tf-example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.MqttUser;
    import com.pulumi.tencentcloud.MqttUserArgs;
    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 example = new MqttUser("example", MqttUserArgs.builder()
                .instanceId("mqtt-zxjwkr98")
                .password("Password@123")
                .remark("Remark.")
                .username("tf-example")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:MqttUser
        properties:
          instanceId: mqtt-zxjwkr98
          password: Password@123
          remark: Remark.
          username: tf-example
    

    Create MqttUser Resource

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

    Constructor syntax

    new MqttUser(name: string, args: MqttUserArgs, opts?: CustomResourceOptions);
    @overload
    def MqttUser(resource_name: str,
                 args: MqttUserArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def MqttUser(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 instance_id: Optional[str] = None,
                 username: Optional[str] = None,
                 mqtt_user_id: Optional[str] = None,
                 password: Optional[str] = None,
                 remark: Optional[str] = None)
    func NewMqttUser(ctx *Context, name string, args MqttUserArgs, opts ...ResourceOption) (*MqttUser, error)
    public MqttUser(string name, MqttUserArgs args, CustomResourceOptions? opts = null)
    public MqttUser(String name, MqttUserArgs args)
    public MqttUser(String name, MqttUserArgs args, CustomResourceOptions options)
    
    type: tencentcloud:MqttUser
    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 MqttUserArgs
    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 MqttUserArgs
    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 MqttUserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MqttUserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MqttUserArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    InstanceId string
    Instance ID.
    Username string
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    MqttUserId string
    ID of the resource.
    Password string
    Password, when this field is empty, the backend will generate it by default.
    Remark string
    Note that the length should not exceed 128 characters.
    InstanceId string
    Instance ID.
    Username string
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    MqttUserId string
    ID of the resource.
    Password string
    Password, when this field is empty, the backend will generate it by default.
    Remark string
    Note that the length should not exceed 128 characters.
    instanceId String
    Instance ID.
    username String
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    mqttUserId String
    ID of the resource.
    password String
    Password, when this field is empty, the backend will generate it by default.
    remark String
    Note that the length should not exceed 128 characters.
    instanceId string
    Instance ID.
    username string
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    mqttUserId string
    ID of the resource.
    password string
    Password, when this field is empty, the backend will generate it by default.
    remark string
    Note that the length should not exceed 128 characters.
    instance_id str
    Instance ID.
    username str
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    mqtt_user_id str
    ID of the resource.
    password str
    Password, when this field is empty, the backend will generate it by default.
    remark str
    Note that the length should not exceed 128 characters.
    instanceId String
    Instance ID.
    username String
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    mqttUserId String
    ID of the resource.
    password String
    Password, when this field is empty, the backend will generate it by default.
    remark String
    Note that the length should not exceed 128 characters.

    Outputs

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

    CreatedTime double
    Creation time, millisecond timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedTime double
    Modify time, millisecond timestamp.
    CreatedTime float64
    Creation time, millisecond timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedTime float64
    Modify time, millisecond timestamp.
    createdTime Double
    Creation time, millisecond timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedTime Double
    Modify time, millisecond timestamp.
    createdTime number
    Creation time, millisecond timestamp.
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedTime number
    Modify time, millisecond timestamp.
    created_time float
    Creation time, millisecond timestamp.
    id str
    The provider-assigned unique ID for this managed resource.
    modified_time float
    Modify time, millisecond timestamp.
    createdTime Number
    Creation time, millisecond timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedTime Number
    Modify time, millisecond timestamp.

    Look up Existing MqttUser Resource

    Get an existing MqttUser 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?: MqttUserState, opts?: CustomResourceOptions): MqttUser
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_time: Optional[float] = None,
            instance_id: Optional[str] = None,
            modified_time: Optional[float] = None,
            mqtt_user_id: Optional[str] = None,
            password: Optional[str] = None,
            remark: Optional[str] = None,
            username: Optional[str] = None) -> MqttUser
    func GetMqttUser(ctx *Context, name string, id IDInput, state *MqttUserState, opts ...ResourceOption) (*MqttUser, error)
    public static MqttUser Get(string name, Input<string> id, MqttUserState? state, CustomResourceOptions? opts = null)
    public static MqttUser get(String name, Output<String> id, MqttUserState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:MqttUser    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:
    CreatedTime double
    Creation time, millisecond timestamp.
    InstanceId string
    Instance ID.
    ModifiedTime double
    Modify time, millisecond timestamp.
    MqttUserId string
    ID of the resource.
    Password string
    Password, when this field is empty, the backend will generate it by default.
    Remark string
    Note that the length should not exceed 128 characters.
    Username string
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    CreatedTime float64
    Creation time, millisecond timestamp.
    InstanceId string
    Instance ID.
    ModifiedTime float64
    Modify time, millisecond timestamp.
    MqttUserId string
    ID of the resource.
    Password string
    Password, when this field is empty, the backend will generate it by default.
    Remark string
    Note that the length should not exceed 128 characters.
    Username string
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    createdTime Double
    Creation time, millisecond timestamp.
    instanceId String
    Instance ID.
    modifiedTime Double
    Modify time, millisecond timestamp.
    mqttUserId String
    ID of the resource.
    password String
    Password, when this field is empty, the backend will generate it by default.
    remark String
    Note that the length should not exceed 128 characters.
    username String
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    createdTime number
    Creation time, millisecond timestamp.
    instanceId string
    Instance ID.
    modifiedTime number
    Modify time, millisecond timestamp.
    mqttUserId string
    ID of the resource.
    password string
    Password, when this field is empty, the backend will generate it by default.
    remark string
    Note that the length should not exceed 128 characters.
    username string
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    created_time float
    Creation time, millisecond timestamp.
    instance_id str
    Instance ID.
    modified_time float
    Modify time, millisecond timestamp.
    mqtt_user_id str
    ID of the resource.
    password str
    Password, when this field is empty, the backend will generate it by default.
    remark str
    Note that the length should not exceed 128 characters.
    username str
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.
    createdTime Number
    Creation time, millisecond timestamp.
    instanceId String
    Instance ID.
    modifiedTime Number
    Modify time, millisecond timestamp.
    mqttUserId String
    ID of the resource.
    password String
    Password, when this field is empty, the backend will generate it by default.
    remark String
    Note that the length should not exceed 128 characters.
    username String
    Username, cannot be empty, only supports uppercase and lowercase letter separators ("_", "-"), cannot exceed 32 characters.

    Import

    MQTT user can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/mqttUser:MqttUser example mqtt-zxjwkr98#tf-example
    

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

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack