alicloud.alikafka.ConsumerGroup
Explore with Pulumi AI
Provides an ALIKAFKA consumer group resource, see What is alikafka consumer group.
NOTE: Available since v1.56.0.
NOTE: Only the following regions support create alikafka consumer group. [
cn-hangzhou
,cn-beijing
,cn-shenzhen
,cn-shanghai
,cn-qingdao
,cn-hongkong
,cn-huhehaote
,cn-zhangjiakou
,cn-chengdu
,cn-heyuan
,ap-southeast-1
,ap-southeast-3
,ap-southeast-5
,ap-south-1
,ap-northeast-1
,eu-central-1
,eu-west-1
,us-west-1
,us-east-1
]
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf_example";
var defaultZones = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
{
CidrBlock = "172.16.0.0/12",
});
var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
{
VpcId = defaultNetwork.Id,
CidrBlock = "172.16.0.0/24",
ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
var defaultInstance = new AliCloud.AliKafka.Instance("defaultInstance", new()
{
PartitionNum = 50,
DiskType = 1,
DiskSize = 500,
DeployType = 5,
IoMax = 20,
VswitchId = defaultSwitch.Id,
});
var defaultConsumerGroup = new AliCloud.AliKafka.ConsumerGroup("defaultConsumerGroup", new()
{
ConsumerId = name,
InstanceId = defaultInstance.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/alikafka"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"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 := "tf_example"
if param := cfg.Get("name"); param != "" {
name = param
}
defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
CidrBlock: pulumi.String("172.16.0.0/12"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
VpcId: defaultNetwork.ID(),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: *pulumi.String(defaultZones.Zones[0].Id),
})
if err != nil {
return err
}
defaultInstance, err := alikafka.NewInstance(ctx, "defaultInstance", &alikafka.InstanceArgs{
PartitionNum: pulumi.Int(50),
DiskType: pulumi.Int(1),
DiskSize: pulumi.Int(500),
DeployType: pulumi.Int(5),
IoMax: pulumi.Int(20),
VswitchId: defaultSwitch.ID(),
})
if err != nil {
return err
}
_, err = alikafka.NewConsumerGroup(ctx, "defaultConsumerGroup", &alikafka.ConsumerGroupArgs{
ConsumerId: pulumi.String(name),
InstanceId: defaultInstance.ID(),
})
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.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.alikafka.Instance;
import com.pulumi.alicloud.alikafka.InstanceArgs;
import com.pulumi.alicloud.alikafka.ConsumerGroup;
import com.pulumi.alicloud.alikafka.ConsumerGroupArgs;
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("tf_example");
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.cidrBlock("172.16.0.0/12")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.cidrBlock("172.16.0.0/24")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.partitionNum("50")
.diskType("1")
.diskSize("500")
.deployType("5")
.ioMax("20")
.vswitchId(defaultSwitch.id())
.build());
var defaultConsumerGroup = new ConsumerGroup("defaultConsumerGroup", ConsumerGroupArgs.builder()
.consumerId(name)
.instanceId(defaultInstance.id())
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf_example"
default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/12")
default_switch = alicloud.vpc.Switch("defaultSwitch",
vpc_id=default_network.id,
cidr_block="172.16.0.0/24",
zone_id=default_zones.zones[0].id)
default_instance = alicloud.alikafka.Instance("defaultInstance",
partition_num=50,
disk_type=1,
disk_size=500,
deploy_type=5,
io_max=20,
vswitch_id=default_switch.id)
default_consumer_group = alicloud.alikafka.ConsumerGroup("defaultConsumerGroup",
consumer_id=name,
instance_id=default_instance.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf_example";
const defaultZones = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {cidrBlock: "172.16.0.0/12"});
const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
vpcId: defaultNetwork.id,
cidrBlock: "172.16.0.0/24",
zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
});
const defaultInstance = new alicloud.alikafka.Instance("defaultInstance", {
partitionNum: 50,
diskType: 1,
diskSize: 500,
deployType: 5,
ioMax: 20,
vswitchId: defaultSwitch.id,
});
const defaultConsumerGroup = new alicloud.alikafka.ConsumerGroup("defaultConsumerGroup", {
consumerId: name,
instanceId: defaultInstance.id,
});
configuration:
name:
type: string
default: tf_example
resources:
defaultNetwork:
type: alicloud:vpc:Network
properties:
cidrBlock: 172.16.0.0/12
defaultSwitch:
type: alicloud:vpc:Switch
properties:
vpcId: ${defaultNetwork.id}
cidrBlock: 172.16.0.0/24
zoneId: ${defaultZones.zones[0].id}
defaultInstance:
type: alicloud:alikafka:Instance
properties:
partitionNum: '50'
diskType: '1'
diskSize: '500'
deployType: '5'
ioMax: '20'
vswitchId: ${defaultSwitch.id}
defaultConsumerGroup:
type: alicloud:alikafka:ConsumerGroup
properties:
consumerId: ${name}
instanceId: ${defaultInstance.id}
variables:
defaultZones:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
Create ConsumerGroup Resource
new ConsumerGroup(name: string, args: ConsumerGroupArgs, opts?: CustomResourceOptions);
@overload
def ConsumerGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
consumer_id: Optional[str] = None,
description: Optional[str] = None,
instance_id: Optional[str] = None,
tags: Optional[Mapping[str, Any]] = None)
@overload
def ConsumerGroup(resource_name: str,
args: ConsumerGroupArgs,
opts: Optional[ResourceOptions] = None)
func NewConsumerGroup(ctx *Context, name string, args ConsumerGroupArgs, opts ...ResourceOption) (*ConsumerGroup, error)
public ConsumerGroup(string name, ConsumerGroupArgs args, CustomResourceOptions? opts = null)
public ConsumerGroup(String name, ConsumerGroupArgs args)
public ConsumerGroup(String name, ConsumerGroupArgs args, CustomResourceOptions options)
type: alicloud:alikafka:ConsumerGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ConsumerGroupArgs
- 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 ConsumerGroupArgs
- 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 ConsumerGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ConsumerGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ConsumerGroupArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ConsumerGroup 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 ConsumerGroup resource accepts the following input properties:
- Consumer
Id string ID of the consumer group. The length cannot exceed 64 characters.
- Instance
Id string ID of the ALIKAFKA Instance that owns the groups.
- Description string
The description of the resource.
- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Consumer
Id string ID of the consumer group. The length cannot exceed 64 characters.
- Instance
Id string ID of the ALIKAFKA Instance that owns the groups.
- Description string
The description of the resource.
- map[string]interface{}
A mapping of tags to assign to the resource.
- consumer
Id String ID of the consumer group. The length cannot exceed 64 characters.
- instance
Id String ID of the ALIKAFKA Instance that owns the groups.
- description String
The description of the resource.
- Map<String,Object>
A mapping of tags to assign to the resource.
- consumer
Id string ID of the consumer group. The length cannot exceed 64 characters.
- instance
Id string ID of the ALIKAFKA Instance that owns the groups.
- description string
The description of the resource.
- {[key: string]: any}
A mapping of tags to assign to the resource.
- consumer_
id str ID of the consumer group. The length cannot exceed 64 characters.
- instance_
id str ID of the ALIKAFKA Instance that owns the groups.
- description str
The description of the resource.
- Mapping[str, Any]
A mapping of tags to assign to the resource.
- consumer
Id String ID of the consumer group. The length cannot exceed 64 characters.
- instance
Id String ID of the ALIKAFKA Instance that owns the groups.
- description String
The description of the resource.
- Map<Any>
A mapping of tags to assign to the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ConsumerGroup 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 ConsumerGroup Resource
Get an existing ConsumerGroup 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?: ConsumerGroupState, opts?: CustomResourceOptions): ConsumerGroup
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
consumer_id: Optional[str] = None,
description: Optional[str] = None,
instance_id: Optional[str] = None,
tags: Optional[Mapping[str, Any]] = None) -> ConsumerGroup
func GetConsumerGroup(ctx *Context, name string, id IDInput, state *ConsumerGroupState, opts ...ResourceOption) (*ConsumerGroup, error)
public static ConsumerGroup Get(string name, Input<string> id, ConsumerGroupState? state, CustomResourceOptions? opts = null)
public static ConsumerGroup get(String name, Output<String> id, ConsumerGroupState 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.
- Consumer
Id string ID of the consumer group. The length cannot exceed 64 characters.
- Description string
The description of the resource.
- Instance
Id string ID of the ALIKAFKA Instance that owns the groups.
- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Consumer
Id string ID of the consumer group. The length cannot exceed 64 characters.
- Description string
The description of the resource.
- Instance
Id string ID of the ALIKAFKA Instance that owns the groups.
- map[string]interface{}
A mapping of tags to assign to the resource.
- consumer
Id String ID of the consumer group. The length cannot exceed 64 characters.
- description String
The description of the resource.
- instance
Id String ID of the ALIKAFKA Instance that owns the groups.
- Map<String,Object>
A mapping of tags to assign to the resource.
- consumer
Id string ID of the consumer group. The length cannot exceed 64 characters.
- description string
The description of the resource.
- instance
Id string ID of the ALIKAFKA Instance that owns the groups.
- {[key: string]: any}
A mapping of tags to assign to the resource.
- consumer_
id str ID of the consumer group. The length cannot exceed 64 characters.
- description str
The description of the resource.
- instance_
id str ID of the ALIKAFKA Instance that owns the groups.
- Mapping[str, Any]
A mapping of tags to assign to the resource.
- consumer
Id String ID of the consumer group. The length cannot exceed 64 characters.
- description String
The description of the resource.
- instance
Id String ID of the ALIKAFKA Instance that owns the groups.
- Map<Any>
A mapping of tags to assign to the resource.
Import
ALIKAFKA GROUP can be imported using the id, e.g.
$ pulumi import alicloud:alikafka/consumerGroup:ConsumerGroup group alikafka_post-cn-123455abc:consumerId
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.