Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

Group

Provides an ONS group resource.

For more information about how to use it, see RocketMQ Group Management API.

NOTE: Available in 1.53.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "onsInstanceName";
        var groupName = config.Get("groupName") ?? "GID-onsGroupDatasourceName";
        var defaultInstance = new AliCloud.RocketMQ.Instance("defaultInstance", new AliCloud.RocketMQ.InstanceArgs
        {
            Remark = "default_ons_instance_remark",
        });
        var defaultGroup = new AliCloud.RocketMQ.Group("defaultGroup", new AliCloud.RocketMQ.GroupArgs
        {
            GroupName = groupName,
            InstanceId = defaultInstance.Id,
            Remark = "dafault_ons_group_remark",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rocketmq"
	"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 := "onsInstanceName"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		groupName := "GID-onsGroupDatasourceName"
		if param := cfg.Get("groupName"); param != "" {
			groupName = param
		}
		defaultInstance, err := rocketmq.NewInstance(ctx, "defaultInstance", &rocketmq.InstanceArgs{
			Remark: pulumi.String("default_ons_instance_remark"),
		})
		if err != nil {
			return err
		}
		_, err = rocketmq.NewGroup(ctx, "defaultGroup", &rocketmq.GroupArgs{
			GroupName:  pulumi.String(groupName),
			InstanceId: defaultInstance.ID(),
			Remark:     pulumi.String("dafault_ons_group_remark"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.rocketmq.Instance;
import com.pulumi.alicloud.rocketmq.InstanceArgs;
import com.pulumi.alicloud.rocketmq.Group;
import com.pulumi.alicloud.rocketmq.GroupArgs;
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("onsInstanceName");
        final var groupName = config.get("groupName").orElse("GID-onsGroupDatasourceName");
        var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
            .remark("default_ons_instance_remark")
            .build());

        var defaultGroup = new Group("defaultGroup", GroupArgs.builder()        
            .groupName(groupName)
            .instanceId(defaultInstance.id())
            .remark("dafault_ons_group_remark")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "onsInstanceName"
group_name = config.get("groupName")
if group_name is None:
    group_name = "GID-onsGroupDatasourceName"
default_instance = alicloud.rocketmq.Instance("defaultInstance", remark="default_ons_instance_remark")
default_group = alicloud.rocketmq.Group("defaultGroup",
    group_name=group_name,
    instance_id=default_instance.id,
    remark="dafault_ons_group_remark")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "onsInstanceName";
const groupName = config.get("groupName") || "GID-onsGroupDatasourceName";
const defaultInstance = new alicloud.rocketmq.Instance("defaultInstance", {remark: "default_ons_instance_remark"});
const defaultGroup = new alicloud.rocketmq.Group("defaultGroup", {
    groupName: groupName,
    instanceId: defaultInstance.id,
    remark: "dafault_ons_group_remark",
});
configuration:
  name:
    type: string
    default: onsInstanceName
  groupName:
    type: string
    default: GID-onsGroupDatasourceName
resources:
  defaultInstance:
    type: alicloud:rocketmq:Instance
    properties:
      remark: default_ons_instance_remark
  defaultGroup:
    type: alicloud:rocketmq:Group
    properties:
      groupName: ${groupName}
      instanceId: ${defaultInstance.id}
      remark: dafault_ons_group_remark

Create a Group Resource

new Group(name: string, args: GroupArgs, opts?: CustomResourceOptions);
@overload
def Group(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          group_id: Optional[str] = None,
          group_name: Optional[str] = None,
          group_type: Optional[str] = None,
          instance_id: Optional[str] = None,
          read_enable: Optional[bool] = None,
          remark: Optional[str] = None,
          tags: Optional[Mapping[str, Any]] = None)
@overload
def Group(resource_name: str,
          args: GroupArgs,
          opts: Optional[ResourceOptions] = None)
func NewGroup(ctx *Context, name string, args GroupArgs, opts ...ResourceOption) (*Group, error)
public Group(string name, GroupArgs args, CustomResourceOptions? opts = null)
public Group(String name, GroupArgs args)
public Group(String name, GroupArgs args, CustomResourceOptions options)
type: alicloud:rocketmq:Group
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args GroupArgs
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 GroupArgs
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 GroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Group Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Group resource accepts the following input properties:

InstanceId string

ID of the ONS Instance that owns the groups.

GroupId string

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

GroupName string

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

GroupType string

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

ReadEnable bool

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

Remark string

This attribute is a concise description of group. The length cannot exceed 256.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
InstanceId string

ID of the ONS Instance that owns the groups.

GroupId string

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

GroupName string

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

GroupType string

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

ReadEnable bool

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

Remark string

This attribute is a concise description of group. The length cannot exceed 256.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
instanceId String

ID of the ONS Instance that owns the groups.

groupId String

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

groupName String

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

groupType String

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

readEnable Boolean

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

remark String

This attribute is a concise description of group. The length cannot exceed 256.

tags Map<String,Object>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
instanceId string

ID of the ONS Instance that owns the groups.

groupId string

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

groupName string

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

groupType string

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

readEnable boolean

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

remark string

This attribute is a concise description of group. The length cannot exceed 256.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
instance_id str

ID of the ONS Instance that owns the groups.

group_id str

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

group_name str

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

group_type str

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

read_enable bool

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

remark str

This attribute is a concise description of group. The length cannot exceed 256.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
instanceId String

ID of the ONS Instance that owns the groups.

groupId String

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

groupName String

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

groupType String

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

readEnable Boolean

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

remark String

This attribute is a concise description of group. The length cannot exceed 256.

tags Map<Any>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.

Outputs

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

Get an existing Group 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?: GroupState, opts?: CustomResourceOptions): Group
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        group_id: Optional[str] = None,
        group_name: Optional[str] = None,
        group_type: Optional[str] = None,
        instance_id: Optional[str] = None,
        read_enable: Optional[bool] = None,
        remark: Optional[str] = None,
        tags: Optional[Mapping[str, Any]] = None) -> Group
func GetGroup(ctx *Context, name string, id IDInput, state *GroupState, opts ...ResourceOption) (*Group, error)
public static Group Get(string name, Input<string> id, GroupState? state, CustomResourceOptions? opts = null)
public static Group get(String name, Output<String> id, GroupState 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:
GroupId string

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

GroupName string

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

GroupType string

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

InstanceId string

ID of the ONS Instance that owns the groups.

ReadEnable bool

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

Remark string

This attribute is a concise description of group. The length cannot exceed 256.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
GroupId string

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

GroupName string

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

GroupType string

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

InstanceId string

ID of the ONS Instance that owns the groups.

ReadEnable bool

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

Remark string

This attribute is a concise description of group. The length cannot exceed 256.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
groupId String

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

groupName String

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

groupType String

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

instanceId String

ID of the ONS Instance that owns the groups.

readEnable Boolean

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

remark String

This attribute is a concise description of group. The length cannot exceed 256.

tags Map<String,Object>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
groupId string

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

groupName string

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

groupType string

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

instanceId string

ID of the ONS Instance that owns the groups.

readEnable boolean

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

remark string

This attribute is a concise description of group. The length cannot exceed 256.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
group_id str

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

group_name str

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

group_type str

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

instance_id str

ID of the ONS Instance that owns the groups.

read_enable bool

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

remark str

This attribute is a concise description of group. The length cannot exceed 256.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
groupId String

Replaced by group_name after version 1.98.0.

Deprecated:

Field 'group_id' has been deprecated from version 1.98.0. Use 'group_name' instead.

groupName String

Name of the group. Two groups on a single instance cannot have the same name. A group_name starts with "GID_" or "GID-", and contains letters, numbers, hyphens (-), and underscores (_).

groupType String

Specify the protocol applicable to the created Group ID. Valid values: tcp, http. Default to tcp.

instanceId String

ID of the ONS Instance that owns the groups.

readEnable Boolean

This attribute is used to set the message reading enabled or disabled. It can only be set after the group is used by the client.

remark String

This attribute is a concise description of group. The length cannot exceed 256.

tags Map<Any>

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.

Import

ONS GROUP can be imported using the id, e.g.

 $ pulumi import alicloud:rocketmq/group:Group group MQ_INST_1234567890_Baso1234567:GID-onsGroupDemo

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.