Topic

class Topic : KotlinCustomResource

Provides an ALIKAFKA topic resource, see What is Alikafka topic .

NOTE: Available since v1.56.0. NOTE: Only the following regions support create alikafka topic. `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

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.Topic;
import com.pulumi.alicloud.alikafka.TopicArgs;
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 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 defaultTopic = new Topic("defaultTopic", TopicArgs.builder()
.instanceId(defaultInstance.id())
.topic("example-topic")
.localTopic("false")
.compactTopic("false")
.partitionNum("12")
.remark("dafault_kafka_topic_remark")
.build());
}
}

Import

ALIKAFKA TOPIC can be imported using the id, e.g.

$ pulumi import alicloud:alikafka/topic:Topic topic alikafka_post-cn-123455abc:topicName

Properties

Link copied to clipboard
val compactTopic: Output<Boolean>?

Whether the topic is compactTopic or not. Compact topic must be a localTopic.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instanceId: Output<String>

InstanceId of your Kafka resource, the topic will create in this instance.

Link copied to clipboard
val localTopic: Output<Boolean>?

Whether the topic is localTopic or not.

Link copied to clipboard
val partitionNum: Output<Int>?

The number of partitions of the topic. The number should between 1 and 48.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val remark: Output<String>

This attribute is a concise description of topic. The length cannot exceed 64.

Link copied to clipboard
val tags: Output<Map<String, Any>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val topic: Output<String>

Name of the topic. Two topics on a single instance cannot have the same name. The length cannot exceed 64 characters.

Link copied to clipboard
val urn: Output<String>