UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

261 lines (260 loc) 7.49 kB
import * as pulumi from "@pulumi/pulumi"; import * as outputs from "../types/output"; /** * Use this data source to query detailed information of kafka topics * ## 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", * }], * }); * const default = volcengine.kafka.getTopicsOutput({ * instanceId: fooTopic.instanceId, * }); * ``` */ export declare function getTopics(args: GetTopicsArgs, opts?: pulumi.InvokeOptions): Promise<GetTopicsResult>; /** * A collection of arguments for invoking getTopics. */ export interface GetTopicsArgs { /** * The id of kafka instance. */ instanceId: string; /** * A Name Regex of kafka topic. */ nameRegex?: string; /** * File name where to save data source results. */ outputFile?: string; /** * The number of partition in kafka topic. */ partitionNumber?: number; /** * The number of replica in kafka topic. */ replicaNumber?: number; /** * The name of kafka topic. This field supports fuzzy query. */ topicName?: string; /** * When a user name is specified, only the access policy of the specified user for this Topic will be returned. */ userName?: string; } /** * A collection of values returned by getTopics. */ export interface GetTopicsResult { /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly instanceId: string; readonly nameRegex?: string; readonly outputFile?: string; /** * The number of partition in the kafka topic. */ readonly partitionNumber?: number; /** * The number of replica in the kafka topic. */ readonly replicaNumber?: number; /** * The name of the kafka topic. */ readonly topicName?: string; /** * The collection of query. */ readonly topics: outputs.kafka.GetTopicsTopic[]; /** * The total count of query. */ readonly totalCount: number; /** * The name of SASL user. */ readonly userName?: string; } /** * Use this data source to query detailed information of kafka topics * ## 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", * }], * }); * const default = volcengine.kafka.getTopicsOutput({ * instanceId: fooTopic.instanceId, * }); * ``` */ export declare function getTopicsOutput(args: GetTopicsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetTopicsResult>; /** * A collection of arguments for invoking getTopics. */ export interface GetTopicsOutputArgs { /** * The id of kafka instance. */ instanceId: pulumi.Input<string>; /** * A Name Regex of kafka topic. */ nameRegex?: pulumi.Input<string>; /** * File name where to save data source results. */ outputFile?: pulumi.Input<string>; /** * The number of partition in kafka topic. */ partitionNumber?: pulumi.Input<number>; /** * The number of replica in kafka topic. */ replicaNumber?: pulumi.Input<number>; /** * The name of kafka topic. This field supports fuzzy query. */ topicName?: pulumi.Input<string>; /** * When a user name is specified, only the access policy of the specified user for this Topic will be returned. */ userName?: pulumi.Input<string>; }