alicloud.rocketmq.Group
Explore with Pulumi AI
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
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const config = new pulumi.Config();
const name = config.get("name") || "GID-tf-example";
const groupName = config.get("groupName") || "GID-tf-example";
const _default = new random.index.Integer("default", {
min: 10000,
max: 99999,
});
const defaultInstance = new alicloud.rocketmq.Instance("default", {instanceName: `${name}-${_default.result}`});
const defaultGroup = new alicloud.rocketmq.Group("default", {
groupName: groupName,
instanceId: defaultInstance.id,
remark: "dafault_ons_group_remark",
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "GID-tf-example"
group_name = config.get("groupName")
if group_name is None:
group_name = "GID-tf-example"
default = random.index.Integer("default",
min=10000,
max=99999)
default_instance = alicloud.rocketmq.Instance("default", instance_name=f"{name}-{default['result']}")
default_group = alicloud.rocketmq.Group("default",
group_name=group_name,
instance_id=default_instance.id,
remark="dafault_ons_group_remark")
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rocketmq"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"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 := "GID-tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
groupName := "GID-tf-example"
if param := cfg.Get("groupName"); param != "" {
groupName = param
}
_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
if err != nil {
return err
}
defaultInstance, err := rocketmq.NewInstance(ctx, "default", &rocketmq.InstanceArgs{
InstanceName: pulumi.Sprintf("%v-%v", name, _default.Result),
})
if err != nil {
return err
}
_, err = rocketmq.NewGroup(ctx, "default", &rocketmq.GroupArgs{
GroupName: pulumi.String(groupName),
InstanceId: defaultInstance.ID(),
Remark: pulumi.String("dafault_ons_group_remark"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "GID-tf-example";
var groupName = config.Get("groupName") ?? "GID-tf-example";
var @default = new Random.Index.Integer("default", new()
{
Min = 10000,
Max = 99999,
});
var defaultInstance = new AliCloud.RocketMQ.Instance("default", new()
{
InstanceName = $"{name}-{@default.Result}",
});
var defaultGroup = new AliCloud.RocketMQ.Group("default", new()
{
GroupName = groupName,
InstanceId = defaultInstance.Id,
Remark = "dafault_ons_group_remark",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
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("GID-tf-example");
final var groupName = config.get("groupName").orElse("GID-tf-example");
var default_ = new Integer("default", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.instanceName(String.format("%s-%s", name,default_.result()))
.build());
var defaultGroup = new Group("defaultGroup", GroupArgs.builder()
.groupName(groupName)
.instanceId(defaultInstance.id())
.remark("dafault_ons_group_remark")
.build());
}
}
configuration:
name:
type: string
default: GID-tf-example
groupName:
type: string
default: GID-tf-example
resources:
default:
type: random:integer
properties:
min: 10000
max: 99999
defaultInstance:
type: alicloud:rocketmq:Instance
name: default
properties:
instanceName: ${name}-${default.result}
defaultGroup:
type: alicloud:rocketmq:Group
name: default
properties:
groupName: ${groupName}
instanceId: ${defaultInstance.id}
remark: dafault_ons_group_remark
Create Group Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Group(name: string, args: GroupArgs, opts?: CustomResourceOptions);
@overload
def Group(resource_name: str,
args: GroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Group(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
group_id: Optional[str] = None,
group_name: Optional[str] = None,
group_type: Optional[str] = None,
read_enable: Optional[bool] = None,
remark: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewGroup(ctx *Context, name string, args GroupArgs, opts ...ResourceOption) (*Group, error)
public Group(string name, GroupArgs args, CustomResourceOptions? opts = null)
type: alicloud:rocketmq:Group
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 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplegroupResourceResourceFromRocketmqgroup = new AliCloud.RocketMQ.Group("examplegroupResourceResourceFromRocketmqgroup", new()
{
InstanceId = "string",
GroupName = "string",
GroupType = "string",
ReadEnable = false,
Remark = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := rocketmq.NewGroup(ctx, "examplegroupResourceResourceFromRocketmqgroup", &rocketmq.GroupArgs{
InstanceId: pulumi.String("string"),
GroupName: pulumi.String("string"),
GroupType: pulumi.String("string"),
ReadEnable: pulumi.Bool(false),
Remark: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var examplegroupResourceResourceFromRocketmqgroup = new Group("examplegroupResourceResourceFromRocketmqgroup", GroupArgs.builder()
.instanceId("string")
.groupName("string")
.groupType("string")
.readEnable(false)
.remark("string")
.tags(Map.of("string", "string"))
.build());
examplegroup_resource_resource_from_rocketmqgroup = alicloud.rocketmq.Group("examplegroupResourceResourceFromRocketmqgroup",
instance_id="string",
group_name="string",
group_type="string",
read_enable=False,
remark="string",
tags={
"string": "string",
})
const examplegroupResourceResourceFromRocketmqgroup = new alicloud.rocketmq.Group("examplegroupResourceResourceFromRocketmqgroup", {
instanceId: "string",
groupName: "string",
groupType: "string",
readEnable: false,
remark: "string",
tags: {
string: "string",
},
});
type: alicloud:rocketmq:Group
properties:
groupName: string
groupType: string
instanceId: string
readEnable: false
remark: string
tags:
string: string
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:
- Instance
Id string - ID of the ONS Instance that owns the groups.
- Group
Id string - Replaced by
group_name
after version 1.98.0. - Group
Name 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 (_). - Group
Type string - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - 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 string
- This attribute is a concise description of group. The length cannot exceed 256.
- Dictionary<string, string>
- 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 string - ID of the ONS Instance that owns the groups.
- Group
Id string - Replaced by
group_name
after version 1.98.0. - Group
Name 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 (_). - Group
Type string - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - 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 string
- This attribute is a concise description of group. The length cannot exceed 256.
- map[string]string
- 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 String - ID of the ONS Instance that owns the groups.
- group
Id String - Replaced by
group_name
after version 1.98.0. - group
Name 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 (_). - group
Type String - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - read
Enable 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.
- Map<String,String>
- 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 string - ID of the ONS Instance that owns the groups.
- group
Id string - Replaced by
group_name
after version 1.98.0. - group
Name 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 (_). - group
Type string - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - read
Enable 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.
- {[key: string]: string}
- 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. - 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 totcp
. - 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.
- Mapping[str, str]
- 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 String - ID of the ONS Instance that owns the groups.
- group
Id String - Replaced by
group_name
after version 1.98.0. - group
Name 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 (_). - group
Type String - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - read
Enable 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.
- Map<String>
- 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 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, str]] = 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.
- Group
Id string - Replaced by
group_name
after version 1.98.0. - Group
Name 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 (_). - Group
Type string - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - Instance
Id string - 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 string
- This attribute is a concise description of group. The length cannot exceed 256.
- Dictionary<string, string>
- 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 string - Replaced by
group_name
after version 1.98.0. - Group
Name 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 (_). - Group
Type string - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - Instance
Id string - 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 string
- This attribute is a concise description of group. The length cannot exceed 256.
- map[string]string
- 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 String - Replaced by
group_name
after version 1.98.0. - group
Name 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 (_). - group
Type String - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - instance
Id String - ID of the ONS Instance that owns the groups.
- read
Enable 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.
- Map<String,String>
- 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 string - Replaced by
group_name
after version 1.98.0. - group
Name 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 (_). - group
Type string - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - instance
Id string - ID of the ONS Instance that owns the groups.
- read
Enable 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.
- {[key: string]: string}
- 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. - 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 totcp
. - 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.
- Mapping[str, str]
- 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 String - Replaced by
group_name
after version 1.98.0. - group
Name 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 (_). - group
Type String - Specify the protocol applicable to the created Group ID. Valid values:
tcp
,http
. Default totcp
. - instance
Id String - ID of the ONS Instance that owns the groups.
- read
Enable 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.
- Map<String>
- 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
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.