TopicArgs

data class TopicArgs(val comment: Output<String>? = null, val lifeCycle: Output<Int>? = null, val name: Output<String>? = null, val projectName: Output<String>? = null, val recordSchema: Output<Map<String, Any>>? = null, val recordType: Output<String>? = null, val shardCount: Output<Int>? = null) : ConvertibleToJava<TopicArgs>

The topic is the basic unit of Datahub data source and is used to define one kind of data or stream. It contains a set of subscriptions. You can manage the datahub source of an application by using topics. Refer to details.

NOTE: Available since v1.19.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.datahub.Project;
import com.pulumi.alicloud.datahub.ProjectArgs;
import com.pulumi.alicloud.datahub.Topic;
import com.pulumi.alicloud.datahub.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 config = ctx.config();
final var name = config.get("name").orElse("tf_example");
var example = new Project("example", ProjectArgs.builder()
.comment("created by terraform")
.build());
var exampleBlob = new Topic("exampleBlob", TopicArgs.builder()
.projectName(example.name())
.recordType("BLOB")
.shardCount(3)
.lifeCycle(7)
.comment("created by terraform")
.build());
var exampleTuple = new Topic("exampleTuple", TopicArgs.builder()
.projectName(example.name())
.recordType("TUPLE")
.recordSchema(Map.ofEntries(
Map.entry("bigint_field", "BIGINT"),
Map.entry("timestamp_field", "TIMESTAMP"),
Map.entry("string_field", "STRING"),
Map.entry("double_field", "DOUBLE"),
Map.entry("boolean_field", "BOOLEAN")
))
.shardCount(3)
.lifeCycle(7)
.comment("created by terraform")
.build());
}
}

Import

Datahub topic can be imported using the ID, e.g.

$ pulumi import alicloud:datahub/topic:Topic example tf_datahub_project:tf_datahub_topic

Constructors

Link copied to clipboard
fun TopicArgs(comment: Output<String>? = null, lifeCycle: Output<Int>? = null, name: Output<String>? = null, projectName: Output<String>? = null, recordSchema: Output<Map<String, Any>>? = null, recordType: Output<String>? = null, shardCount: Output<Int>? = null)

Functions

Link copied to clipboard
open override fun toJava(): TopicArgs

Properties

Link copied to clipboard
val comment: Output<String>? = null

Comment of the datahub topic. It cannot be longer than 255 characters. Notes: Currently life_cycle can not be modified and it will be supported in the next future.

Link copied to clipboard
val lifeCycle: Output<Int>? = null

How many days this topic lives. The permitted range of values is 1, 7. The default value is 3.

Link copied to clipboard
val name: Output<String>? = null

The name of the datahub topic. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.

Link copied to clipboard
val projectName: Output<String>? = null

The name of the datahub project that this topic belongs to. It is case-insensitive.

Link copied to clipboard
val recordSchema: Output<Map<String, Any>>? = null

Schema of this topic, required only for TUPLE topic. Supported data types (case-insensitive) are:

Link copied to clipboard
val recordType: Output<String>? = null

The type of this topic. Its value must be one of {BLOB, TUPLE}. For BLOB topic, data will be organized as binary and encoded by BASE64. For TUPLE topic, data has fixed schema. The default value is "TUPLE" with a schema {STRING}.

Link copied to clipboard
val shardCount: Output<Int>? = null

The number of shards this topic contains. The permitted range of values is 1, 10. The default value is 1.