1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ElasticsearchIndex
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.ElasticsearchIndex

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a elasticsearch index

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const index = new tencentcloud.ElasticsearchIndex("index", {
        indexMetaJson: "{\"mappings\":{},\"settings\":{\"index.number_of_replicas\":1,\"index.number_of_shards\":1,\"index.refresh_interval\":\"30s\"}}",
        indexName: "test-es-index",
        indexType: "normal",
        instanceId: "es-xxxxxx",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    index = tencentcloud.ElasticsearchIndex("index",
        index_meta_json="{\"mappings\":{},\"settings\":{\"index.number_of_replicas\":1,\"index.number_of_shards\":1,\"index.refresh_interval\":\"30s\"}}",
        index_name="test-es-index",
        index_type="normal",
        instance_id="es-xxxxxx")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewElasticsearchIndex(ctx, "index", &tencentcloud.ElasticsearchIndexArgs{
    			IndexMetaJson: pulumi.String("{\"mappings\":{},\"settings\":{\"index.number_of_replicas\":1,\"index.number_of_shards\":1,\"index.refresh_interval\":\"30s\"}}"),
    			IndexName:     pulumi.String("test-es-index"),
    			IndexType:     pulumi.String("normal"),
    			InstanceId:    pulumi.String("es-xxxxxx"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var index = new Tencentcloud.ElasticsearchIndex("index", new()
        {
            IndexMetaJson = "{\"mappings\":{},\"settings\":{\"index.number_of_replicas\":1,\"index.number_of_shards\":1,\"index.refresh_interval\":\"30s\"}}",
            IndexName = "test-es-index",
            IndexType = "normal",
            InstanceId = "es-xxxxxx",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ElasticsearchIndex;
    import com.pulumi.tencentcloud.ElasticsearchIndexArgs;
    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 index = new ElasticsearchIndex("index", ElasticsearchIndexArgs.builder()
                .indexMetaJson("{\"mappings\":{},\"settings\":{\"index.number_of_replicas\":1,\"index.number_of_shards\":1,\"index.refresh_interval\":\"30s\"}}")
                .indexName("test-es-index")
                .indexType("normal")
                .instanceId("es-xxxxxx")
                .build());
    
        }
    }
    
    resources:
      index:
        type: tencentcloud:ElasticsearchIndex
        properties:
          indexMetaJson: '{"mappings":{},"settings":{"index.number_of_replicas":1,"index.number_of_shards":1,"index.refresh_interval":"30s"}}'
          indexName: test-es-index
          indexType: normal
          instanceId: es-xxxxxx
    

    Create ElasticsearchIndex Resource

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

    Constructor syntax

    new ElasticsearchIndex(name: string, args: ElasticsearchIndexArgs, opts?: CustomResourceOptions);
    @overload
    def ElasticsearchIndex(resource_name: str,
                           args: ElasticsearchIndexArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ElasticsearchIndex(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           index_name: Optional[str] = None,
                           index_type: Optional[str] = None,
                           instance_id: Optional[str] = None,
                           elasticsearch_index_id: Optional[str] = None,
                           index_meta_json: Optional[str] = None)
    func NewElasticsearchIndex(ctx *Context, name string, args ElasticsearchIndexArgs, opts ...ResourceOption) (*ElasticsearchIndex, error)
    public ElasticsearchIndex(string name, ElasticsearchIndexArgs args, CustomResourceOptions? opts = null)
    public ElasticsearchIndex(String name, ElasticsearchIndexArgs args)
    public ElasticsearchIndex(String name, ElasticsearchIndexArgs args, CustomResourceOptions options)
    
    type: tencentcloud:ElasticsearchIndex
    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 ElasticsearchIndexArgs
    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 ElasticsearchIndexArgs
    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 ElasticsearchIndexArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ElasticsearchIndexArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ElasticsearchIndexArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ElasticsearchIndex 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 ElasticsearchIndex resource accepts the following input properties:

    IndexName string
    index name to create.
    IndexType string
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    InstanceId string
    es instance id.
    ElasticsearchIndexId string
    ID of the resource.
    IndexMetaJson string
    Create index metadata JSON, such as mappings, settings.
    IndexName string
    index name to create.
    IndexType string
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    InstanceId string
    es instance id.
    ElasticsearchIndexId string
    ID of the resource.
    IndexMetaJson string
    Create index metadata JSON, such as mappings, settings.
    indexName String
    index name to create.
    indexType String
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    instanceId String
    es instance id.
    elasticsearchIndexId String
    ID of the resource.
    indexMetaJson String
    Create index metadata JSON, such as mappings, settings.
    indexName string
    index name to create.
    indexType string
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    instanceId string
    es instance id.
    elasticsearchIndexId string
    ID of the resource.
    indexMetaJson string
    Create index metadata JSON, such as mappings, settings.
    index_name str
    index name to create.
    index_type str
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    instance_id str
    es instance id.
    elasticsearch_index_id str
    ID of the resource.
    index_meta_json str
    Create index metadata JSON, such as mappings, settings.
    indexName String
    index name to create.
    indexType String
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    instanceId String
    es instance id.
    elasticsearchIndexId String
    ID of the resource.
    indexMetaJson String
    Create index metadata JSON, such as mappings, settings.

    Outputs

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

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

    Look up Existing ElasticsearchIndex Resource

    Get an existing ElasticsearchIndex 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?: ElasticsearchIndexState, opts?: CustomResourceOptions): ElasticsearchIndex
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            elasticsearch_index_id: Optional[str] = None,
            index_meta_json: Optional[str] = None,
            index_name: Optional[str] = None,
            index_type: Optional[str] = None,
            instance_id: Optional[str] = None) -> ElasticsearchIndex
    func GetElasticsearchIndex(ctx *Context, name string, id IDInput, state *ElasticsearchIndexState, opts ...ResourceOption) (*ElasticsearchIndex, error)
    public static ElasticsearchIndex Get(string name, Input<string> id, ElasticsearchIndexState? state, CustomResourceOptions? opts = null)
    public static ElasticsearchIndex get(String name, Output<String> id, ElasticsearchIndexState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:ElasticsearchIndex    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:
    ElasticsearchIndexId string
    ID of the resource.
    IndexMetaJson string
    Create index metadata JSON, such as mappings, settings.
    IndexName string
    index name to create.
    IndexType string
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    InstanceId string
    es instance id.
    ElasticsearchIndexId string
    ID of the resource.
    IndexMetaJson string
    Create index metadata JSON, such as mappings, settings.
    IndexName string
    index name to create.
    IndexType string
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    InstanceId string
    es instance id.
    elasticsearchIndexId String
    ID of the resource.
    indexMetaJson String
    Create index metadata JSON, such as mappings, settings.
    indexName String
    index name to create.
    indexType String
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    instanceId String
    es instance id.
    elasticsearchIndexId string
    ID of the resource.
    indexMetaJson string
    Create index metadata JSON, such as mappings, settings.
    indexName string
    index name to create.
    indexType string
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    instanceId string
    es instance id.
    elasticsearch_index_id str
    ID of the resource.
    index_meta_json str
    Create index metadata JSON, such as mappings, settings.
    index_name str
    index name to create.
    index_type str
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    instance_id str
    es instance id.
    elasticsearchIndexId String
    ID of the resource.
    indexMetaJson String
    Create index metadata JSON, such as mappings, settings.
    indexName String
    index name to create.
    indexType String
    type of the index to be created. auto: autonomous index. normal: indicates a common index.
    instanceId String
    es instance id.

    Import

    elasticsearch index can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/elasticsearchIndex:ElasticsearchIndex index index_id
    

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

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack