Topic

class Topic : KotlinCustomResource

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

Properties

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

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 createTime: Output<String>

Create time of the datahub topic. It is a human-readable string rather than 64-bits UTC.

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

Last modify time of the datahub topic. It is the same as create_time at the beginning. It is also a human-readable string rather than 64-bits UTC.

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

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>

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>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val recordSchema: Output<Map<String, Any>>?

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

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

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>?

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

Link copied to clipboard
val urn: Output<String>