@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
217 lines (216 loc) • 7.39 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a resource to manage kafka topic
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.ecs.getZones({});
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-test-subnet",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* vpcId: fooVpc.id,
* });
* const fooInstance = new volcengine.kafka.Instance("fooInstance", {
* instanceName: "acc-test-kafka",
* instanceDescription: "tf-test",
* version: "2.2.2",
* computeSpec: "kafka.20xrate.hw",
* subnetId: fooSubnet.id,
* userName: "tf-user",
* userPassword: "tf-pass!@q1",
* chargeType: "PostPaid",
* storageSpace: 300,
* partitionNumber: 350,
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* parameters: [
* {
* parameterName: "MessageMaxByte",
* parameterValue: "12",
* },
* {
* parameterName: "LogRetentionHours",
* parameterValue: "70",
* },
* ],
* });
* const fooSaslUser = new volcengine.kafka.SaslUser("fooSaslUser", {
* userName: "acc-test-user",
* instanceId: fooInstance.id,
* userPassword: "suqsnis123!",
* description: "tf-test",
* allAuthority: true,
* passwordType: "Scram",
* });
* const fooTopic = new volcengine.kafka.Topic("fooTopic", {
* topicName: "acc-test-topic",
* instanceId: fooInstance.id,
* description: "tf-test",
* partitionNumber: 15,
* replicaNumber: 3,
* parameters: {
* minInsyncReplicaNumber: 2,
* messageMaxByte: 10,
* logRetentionHours: 96,
* },
* allAuthority: false,
* accessPolicies: [{
* userName: fooSaslUser.userName,
* accessPolicy: "Pub",
* }],
* });
* ```
*
* ## Import
*
* KafkaTopic can be imported using the instance_id:topic_name, e.g.
*
* ```sh
* $ pulumi import volcengine:kafka/topic:Topic default kafka-cnoeeapetf4s****:topic
* ```
*/
export declare class Topic extends pulumi.CustomResource {
/**
* Get an existing Topic resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TopicState, opts?: pulumi.CustomResourceOptions): Topic;
/**
* Returns true if the given object is an instance of Topic. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Topic;
/**
* The access policies info of the kafka topic. This field only valid when the value of the AllAuthority is false.
*/
readonly accessPolicies: pulumi.Output<outputs.kafka.TopicAccessPolicy[] | undefined>;
/**
* Whether the kafka topic is configured to be accessible by all users. Default: true.
*/
readonly allAuthority: pulumi.Output<boolean | undefined>;
/**
* The description of the kafka topic.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The instance id of the kafka topic.
*/
readonly instanceId: pulumi.Output<string>;
/**
* The parameters of the kafka topic.
*/
readonly parameters: pulumi.Output<outputs.kafka.TopicParameters>;
/**
* The number of partition in kafka topic. The value range in 1-300. This field can only be adjusted up but not down.
*/
readonly partitionNumber: pulumi.Output<number>;
/**
* The number of replica in kafka topic. The value can be 2 or 3. Default is 3.
*/
readonly replicaNumber: pulumi.Output<number | undefined>;
/**
* The name of the kafka topic.
*/
readonly topicName: pulumi.Output<string>;
/**
* Create a Topic resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: TopicArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Topic resources.
*/
export interface TopicState {
/**
* The access policies info of the kafka topic. This field only valid when the value of the AllAuthority is false.
*/
accessPolicies?: pulumi.Input<pulumi.Input<inputs.kafka.TopicAccessPolicy>[]>;
/**
* Whether the kafka topic is configured to be accessible by all users. Default: true.
*/
allAuthority?: pulumi.Input<boolean>;
/**
* The description of the kafka topic.
*/
description?: pulumi.Input<string>;
/**
* The instance id of the kafka topic.
*/
instanceId?: pulumi.Input<string>;
/**
* The parameters of the kafka topic.
*/
parameters?: pulumi.Input<inputs.kafka.TopicParameters>;
/**
* The number of partition in kafka topic. The value range in 1-300. This field can only be adjusted up but not down.
*/
partitionNumber?: pulumi.Input<number>;
/**
* The number of replica in kafka topic. The value can be 2 or 3. Default is 3.
*/
replicaNumber?: pulumi.Input<number>;
/**
* The name of the kafka topic.
*/
topicName?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Topic resource.
*/
export interface TopicArgs {
/**
* The access policies info of the kafka topic. This field only valid when the value of the AllAuthority is false.
*/
accessPolicies?: pulumi.Input<pulumi.Input<inputs.kafka.TopicAccessPolicy>[]>;
/**
* Whether the kafka topic is configured to be accessible by all users. Default: true.
*/
allAuthority?: pulumi.Input<boolean>;
/**
* The description of the kafka topic.
*/
description?: pulumi.Input<string>;
/**
* The instance id of the kafka topic.
*/
instanceId: pulumi.Input<string>;
/**
* The parameters of the kafka topic.
*/
parameters?: pulumi.Input<inputs.kafka.TopicParameters>;
/**
* The number of partition in kafka topic. The value range in 1-300. This field can only be adjusted up but not down.
*/
partitionNumber: pulumi.Input<number>;
/**
* The number of replica in kafka topic. The value can be 2 or 3. Default is 3.
*/
replicaNumber?: pulumi.Input<number>;
/**
* The name of the kafka topic.
*/
topicName: pulumi.Input<string>;
}