1. Packages
  2. Selectel Provider
  3. API Docs
  4. DbaasKafkaTopicV1
selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel

selectel.DbaasKafkaTopicV1

Explore with Pulumi AI

selectel logo
selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel

    Creates and manages a topic in a Kafka datastore using public API v1. For more information about managing topics in Kafka, see the official Selectel documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const topic1 = new selectel.DbaasKafkaTopicV1("topic1", {
        projectId: selectel_vpc_project_v2.project_1.id,
        region: "ru-3",
        datastoreId: selectel_dbaas_kafka_datastore_v1.datastore_1.id,
        partitions: 1,
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    topic1 = selectel.DbaasKafkaTopicV1("topic1",
        project_id=selectel_vpc_project_v2["project_1"]["id"],
        region="ru-3",
        datastore_id=selectel_dbaas_kafka_datastore_v1["datastore_1"]["id"],
        partitions=1)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v6/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := selectel.NewDbaasKafkaTopicV1(ctx, "topic1", &selectel.DbaasKafkaTopicV1Args{
    			ProjectId:   pulumi.Any(selectel_vpc_project_v2.Project_1.Id),
    			Region:      pulumi.String("ru-3"),
    			DatastoreId: pulumi.Any(selectel_dbaas_kafka_datastore_v1.Datastore_1.Id),
    			Partitions:  pulumi.Float64(1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var topic1 = new Selectel.DbaasKafkaTopicV1("topic1", new()
        {
            ProjectId = selectel_vpc_project_v2.Project_1.Id,
            Region = "ru-3",
            DatastoreId = selectel_dbaas_kafka_datastore_v1.Datastore_1.Id,
            Partitions = 1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.DbaasKafkaTopicV1;
    import com.pulumi.selectel.DbaasKafkaTopicV1Args;
    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) {
            var topic1 = new DbaasKafkaTopicV1("topic1", DbaasKafkaTopicV1Args.builder()
                .projectId(selectel_vpc_project_v2.project_1().id())
                .region("ru-3")
                .datastoreId(selectel_dbaas_kafka_datastore_v1.datastore_1().id())
                .partitions(1)
                .build());
    
        }
    }
    
    resources:
      topic1:
        type: selectel:DbaasKafkaTopicV1
        properties:
          projectId: ${selectel_vpc_project_v2.project_1.id}
          region: ru-3
          datastoreId: ${selectel_dbaas_kafka_datastore_v1.datastore_1.id}
          partitions: 1
    

    Create DbaasKafkaTopicV1 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DbaasKafkaTopicV1(name: string, args: DbaasKafkaTopicV1Args, opts?: CustomResourceOptions);
    @overload
    def DbaasKafkaTopicV1(resource_name: str,
                          args: DbaasKafkaTopicV1Args,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def DbaasKafkaTopicV1(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          datastore_id: Optional[str] = None,
                          partitions: Optional[float] = None,
                          project_id: Optional[str] = None,
                          region: Optional[str] = None,
                          dbaas_kafka_topic_v1_id: Optional[str] = None,
                          name: Optional[str] = None,
                          timeouts: Optional[DbaasKafkaTopicV1TimeoutsArgs] = None)
    func NewDbaasKafkaTopicV1(ctx *Context, name string, args DbaasKafkaTopicV1Args, opts ...ResourceOption) (*DbaasKafkaTopicV1, error)
    public DbaasKafkaTopicV1(string name, DbaasKafkaTopicV1Args args, CustomResourceOptions? opts = null)
    public DbaasKafkaTopicV1(String name, DbaasKafkaTopicV1Args args)
    public DbaasKafkaTopicV1(String name, DbaasKafkaTopicV1Args args, CustomResourceOptions options)
    
    type: selectel:DbaasKafkaTopicV1
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args DbaasKafkaTopicV1Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args DbaasKafkaTopicV1Args
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args DbaasKafkaTopicV1Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DbaasKafkaTopicV1Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DbaasKafkaTopicV1Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var dbaasKafkaTopicV1Resource = new Selectel.DbaasKafkaTopicV1("dbaasKafkaTopicV1Resource", new()
    {
        DatastoreId = "string",
        Partitions = 0,
        ProjectId = "string",
        Region = "string",
        DbaasKafkaTopicV1Id = "string",
        Name = "string",
        Timeouts = new Selectel.Inputs.DbaasKafkaTopicV1TimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := selectel.NewDbaasKafkaTopicV1(ctx, "dbaasKafkaTopicV1Resource", &selectel.DbaasKafkaTopicV1Args{
    	DatastoreId:         pulumi.String("string"),
    	Partitions:          pulumi.Float64(0),
    	ProjectId:           pulumi.String("string"),
    	Region:              pulumi.String("string"),
    	DbaasKafkaTopicV1Id: pulumi.String("string"),
    	Name:                pulumi.String("string"),
    	Timeouts: &selectel.DbaasKafkaTopicV1TimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    var dbaasKafkaTopicV1Resource = new DbaasKafkaTopicV1("dbaasKafkaTopicV1Resource", DbaasKafkaTopicV1Args.builder()
        .datastoreId("string")
        .partitions(0)
        .projectId("string")
        .region("string")
        .dbaasKafkaTopicV1Id("string")
        .name("string")
        .timeouts(DbaasKafkaTopicV1TimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    dbaas_kafka_topic_v1_resource = selectel.DbaasKafkaTopicV1("dbaasKafkaTopicV1Resource",
        datastore_id="string",
        partitions=0,
        project_id="string",
        region="string",
        dbaas_kafka_topic_v1_id="string",
        name="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        })
    
    const dbaasKafkaTopicV1Resource = new selectel.DbaasKafkaTopicV1("dbaasKafkaTopicV1Resource", {
        datastoreId: "string",
        partitions: 0,
        projectId: "string",
        region: "string",
        dbaasKafkaTopicV1Id: "string",
        name: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: selectel:DbaasKafkaTopicV1
    properties:
        datastoreId: string
        dbaasKafkaTopicV1Id: string
        name: string
        partitions: 0
        projectId: string
        region: string
        timeouts:
            create: string
            delete: string
            update: string
    

    DbaasKafkaTopicV1 Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The DbaasKafkaTopicV1 resource accepts the following input properties:

    DatastoreId string
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    Partitions double
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    DbaasKafkaTopicV1Id string
    Name string
    Topic name. Changing this creates a new topic.
    Timeouts DbaasKafkaTopicV1Timeouts
    DatastoreId string
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    Partitions float64
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    DbaasKafkaTopicV1Id string
    Name string
    Topic name. Changing this creates a new topic.
    Timeouts DbaasKafkaTopicV1TimeoutsArgs
    datastoreId String
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    partitions Double
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    projectId String
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    dbaasKafkaTopicV1Id String
    name String
    Topic name. Changing this creates a new topic.
    timeouts DbaasKafkaTopicV1Timeouts
    datastoreId string
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    partitions number
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    projectId string
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region string
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    dbaasKafkaTopicV1Id string
    name string
    Topic name. Changing this creates a new topic.
    timeouts DbaasKafkaTopicV1Timeouts
    datastore_id str
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    partitions float
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    project_id str
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region str
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    dbaas_kafka_topic_v1_id str
    name str
    Topic name. Changing this creates a new topic.
    timeouts DbaasKafkaTopicV1TimeoutsArgs
    datastoreId String
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    partitions Number
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    projectId String
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    dbaasKafkaTopicV1Id String
    name String
    Topic name. Changing this creates a new topic.
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DbaasKafkaTopicV1 resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Topic status.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Topic status.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Topic status.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Topic status.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    Topic status.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Topic status.

    Look up Existing DbaasKafkaTopicV1 Resource

    Get an existing DbaasKafkaTopicV1 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: DbaasKafkaTopicV1State, opts?: CustomResourceOptions): DbaasKafkaTopicV1
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            datastore_id: Optional[str] = None,
            dbaas_kafka_topic_v1_id: Optional[str] = None,
            name: Optional[str] = None,
            partitions: Optional[float] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            status: Optional[str] = None,
            timeouts: Optional[DbaasKafkaTopicV1TimeoutsArgs] = None) -> DbaasKafkaTopicV1
    func GetDbaasKafkaTopicV1(ctx *Context, name string, id IDInput, state *DbaasKafkaTopicV1State, opts ...ResourceOption) (*DbaasKafkaTopicV1, error)
    public static DbaasKafkaTopicV1 Get(string name, Input<string> id, DbaasKafkaTopicV1State? state, CustomResourceOptions? opts = null)
    public static DbaasKafkaTopicV1 get(String name, Output<String> id, DbaasKafkaTopicV1State state, CustomResourceOptions options)
    resources:  _:    type: selectel:DbaasKafkaTopicV1    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DatastoreId string
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    DbaasKafkaTopicV1Id string
    Name string
    Topic name. Changing this creates a new topic.
    Partitions double
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    Status string
    Topic status.
    Timeouts DbaasKafkaTopicV1Timeouts
    DatastoreId string
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    DbaasKafkaTopicV1Id string
    Name string
    Topic name. Changing this creates a new topic.
    Partitions float64
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    Status string
    Topic status.
    Timeouts DbaasKafkaTopicV1TimeoutsArgs
    datastoreId String
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    dbaasKafkaTopicV1Id String
    name String
    Topic name. Changing this creates a new topic.
    partitions Double
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    projectId String
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    status String
    Topic status.
    timeouts DbaasKafkaTopicV1Timeouts
    datastoreId string
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    dbaasKafkaTopicV1Id string
    name string
    Topic name. Changing this creates a new topic.
    partitions number
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    projectId string
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region string
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    status string
    Topic status.
    timeouts DbaasKafkaTopicV1Timeouts
    datastore_id str
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    dbaas_kafka_topic_v1_id str
    name str
    Topic name. Changing this creates a new topic.
    partitions float
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    project_id str
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region str
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    status str
    Topic status.
    timeouts DbaasKafkaTopicV1TimeoutsArgs
    datastoreId String
    Unique identifier of the associated datastore. Changing this creates a new topic. Retrieved from the selectel_dbaas_kafka_datastore_v1.
    dbaasKafkaTopicV1Id String
    name String
    Topic name. Changing this creates a new topic.
    partitions Number
    Number of partitions in a topic. The available range is from 1 to 4 000. You cannot increase the number of partitions in the existing topic. Learn more about Partitions.
    projectId String
    Unique identifier of the associated project. Changing this creates a new topic. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the database is located, for example, ru-3. Changing this creates a new topic. Learn more about available pools in the Availability matrix.
    status String
    Topic status.
    timeouts Property Map

    Supporting Types

    DbaasKafkaTopicV1Timeouts, DbaasKafkaTopicV1TimeoutsArgs

    Create string
    Delete string
    Update string
    Create string
    Delete string
    Update string
    create String
    delete String
    update String
    create string
    delete string
    update string
    create str
    delete str
    update str
    create String
    delete String
    update String

    Import

    You can import a topic:

    export OS_DOMAIN_NAME=<account_id>

    export OS_USERNAME=

    export OS_PASSWORD=

    export INFRA_PROJECT_ID=<selectel_project_id>

    export INFRA_REGION=<selectel_pool>

    $ pulumi import selectel:index/dbaasKafkaTopicV1:DbaasKafkaTopicV1 topic_1 <topic_id>
    

    where:

    • <account_id> — Selectel account ID. The account ID is in the top right corner of the Control panel. Learn more about Registration.

    • <username> — Name of the service user. To get the name, in the Control panel, go to Identity & Access ManagementUser management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service users.

    • <password> — Password of the service user.

    • <selectel_project_id> — Unique identifier of the associated project. To get the ID, in the Control panel, go to Cloud Platform ⟶ project name ⟶ copy the ID of the required project. Learn more about Projects.

    • <selectel_pool> — Pool where the cluster is located, for example, ru-3. To get information about the pool, in the Control panel, go to Cloud PlatformManaged Databases. The pool is in the Pool column.

    • <topic_id> — Unique identifier of the topic, for example, b311ce58-2658-46b5-b733-7a0f418703f2. To get the topic ID in the Control panel, go to Cloud PlatformManaged Databases ⟶ the cluster page ⟶ the Topics tab. The topic ID is under the topic name.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    selectel selectel/terraform-provider-selectel
    License
    Notes
    This Pulumi package is based on the selectel Terraform Provider.
    selectel logo
    selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel