published on Monday, May 25, 2026 by elastic
published on Monday, May 25, 2026 by elastic
Manage a user-declared subset of index mappings on an existing Elasticsearch index. Destroy is a no-op — field mappings are not removed.
Create ElasticsearchIndexMappings Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ElasticsearchIndexMappings(name: string, args: ElasticsearchIndexMappingsArgs, opts?: CustomResourceOptions);@overload
def ElasticsearchIndexMappings(resource_name: str,
args: ElasticsearchIndexMappingsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ElasticsearchIndexMappings(resource_name: str,
opts: Optional[ResourceOptions] = None,
index: Optional[str] = None,
mappings: Optional[str] = None,
elasticsearch_connections: Optional[Sequence[ElasticsearchIndexMappingsElasticsearchConnectionArgs]] = None)func NewElasticsearchIndexMappings(ctx *Context, name string, args ElasticsearchIndexMappingsArgs, opts ...ResourceOption) (*ElasticsearchIndexMappings, error)public ElasticsearchIndexMappings(string name, ElasticsearchIndexMappingsArgs args, CustomResourceOptions? opts = null)
public ElasticsearchIndexMappings(String name, ElasticsearchIndexMappingsArgs args)
public ElasticsearchIndexMappings(String name, ElasticsearchIndexMappingsArgs args, CustomResourceOptions options)
type: elasticstack:ElasticsearchIndexMappings
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "elasticstack_elasticsearchindexmappings" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ElasticsearchIndexMappingsArgs
- 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 ElasticsearchIndexMappingsArgs
- 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 ElasticsearchIndexMappingsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ElasticsearchIndexMappingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ElasticsearchIndexMappingsArgs
- 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 elasticsearchIndexMappingsResource = new Elasticstack.ElasticsearchIndexMappings("elasticsearchIndexMappingsResource", new()
{
Index = "string",
Mappings = "string",
ElasticsearchConnections = new[]
{
new Elasticstack.Inputs.ElasticsearchIndexMappingsElasticsearchConnectionArgs
{
ApiKey = "string",
BearerToken = "string",
CaData = "string",
CaFile = "string",
CertData = "string",
CertFile = "string",
Endpoints = new[]
{
"string",
},
EsClientAuthentication = "string",
Headers =
{
{ "string", "string" },
},
Insecure = false,
KeyData = "string",
KeyFile = "string",
Password = "string",
Username = "string",
},
},
});
example, err := elasticstack.NewElasticsearchIndexMappings(ctx, "elasticsearchIndexMappingsResource", &elasticstack.ElasticsearchIndexMappingsArgs{
Index: pulumi.String("string"),
Mappings: pulumi.String("string"),
ElasticsearchConnections: elasticstack.ElasticsearchIndexMappingsElasticsearchConnectionArray{
&elasticstack.ElasticsearchIndexMappingsElasticsearchConnectionArgs{
ApiKey: pulumi.String("string"),
BearerToken: pulumi.String("string"),
CaData: pulumi.String("string"),
CaFile: pulumi.String("string"),
CertData: pulumi.String("string"),
CertFile: pulumi.String("string"),
Endpoints: pulumi.StringArray{
pulumi.String("string"),
},
EsClientAuthentication: pulumi.String("string"),
Headers: pulumi.StringMap{
"string": pulumi.String("string"),
},
Insecure: pulumi.Bool(false),
KeyData: pulumi.String("string"),
KeyFile: pulumi.String("string"),
Password: pulumi.String("string"),
Username: pulumi.String("string"),
},
},
})
resource "elasticstack_elasticsearchindexmappings" "elasticsearchIndexMappingsResource" {
index = "string"
mappings = "string"
elasticsearch_connections {
api_key = "string"
bearer_token = "string"
ca_data = "string"
ca_file = "string"
cert_data = "string"
cert_file = "string"
endpoints = ["string"]
es_client_authentication = "string"
headers = {
"string" = "string"
}
insecure = false
key_data = "string"
key_file = "string"
password = "string"
username = "string"
}
}
var elasticsearchIndexMappingsResource = new ElasticsearchIndexMappings("elasticsearchIndexMappingsResource", ElasticsearchIndexMappingsArgs.builder()
.index("string")
.mappings("string")
.elasticsearchConnections(ElasticsearchIndexMappingsElasticsearchConnectionArgs.builder()
.apiKey("string")
.bearerToken("string")
.caData("string")
.caFile("string")
.certData("string")
.certFile("string")
.endpoints("string")
.esClientAuthentication("string")
.headers(Map.of("string", "string"))
.insecure(false)
.keyData("string")
.keyFile("string")
.password("string")
.username("string")
.build())
.build());
elasticsearch_index_mappings_resource = elasticstack.ElasticsearchIndexMappings("elasticsearchIndexMappingsResource",
index="string",
mappings="string",
elasticsearch_connections=[{
"api_key": "string",
"bearer_token": "string",
"ca_data": "string",
"ca_file": "string",
"cert_data": "string",
"cert_file": "string",
"endpoints": ["string"],
"es_client_authentication": "string",
"headers": {
"string": "string",
},
"insecure": False,
"key_data": "string",
"key_file": "string",
"password": "string",
"username": "string",
}])
const elasticsearchIndexMappingsResource = new elasticstack.ElasticsearchIndexMappings("elasticsearchIndexMappingsResource", {
index: "string",
mappings: "string",
elasticsearchConnections: [{
apiKey: "string",
bearerToken: "string",
caData: "string",
caFile: "string",
certData: "string",
certFile: "string",
endpoints: ["string"],
esClientAuthentication: "string",
headers: {
string: "string",
},
insecure: false,
keyData: "string",
keyFile: "string",
password: "string",
username: "string",
}],
});
type: elasticstack:ElasticsearchIndexMappings
properties:
elasticsearchConnections:
- apiKey: string
bearerToken: string
caData: string
caFile: string
certData: string
certFile: string
endpoints:
- string
esClientAuthentication: string
headers:
string: string
insecure: false
keyData: string
keyFile: string
password: string
username: string
index: string
mappings: string
ElasticsearchIndexMappings 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 ElasticsearchIndexMappings resource accepts the following input properties:
- Index string
- Name of the target Elasticsearch index.
- Mappings string
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op). - Elasticsearch
Connections List<ElasticsearchIndex Mappings Elasticsearch Connection> - Elasticsearch connection configuration block.
- Index string
- Name of the target Elasticsearch index.
- Mappings string
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op). - Elasticsearch
Connections []ElasticsearchIndex Mappings Elasticsearch Connection Args - Elasticsearch connection configuration block.
- index string
- Name of the target Elasticsearch index.
- mappings string
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op). - elasticsearch_
connections list(object) - Elasticsearch connection configuration block.
- index String
- Name of the target Elasticsearch index.
- mappings String
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op). - elasticsearch
Connections List<ElasticsearchIndex Mappings Elasticsearch Connection> - Elasticsearch connection configuration block.
- index string
- Name of the target Elasticsearch index.
- mappings string
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op). - elasticsearch
Connections ElasticsearchIndex Mappings Elasticsearch Connection[] - Elasticsearch connection configuration block.
- index str
- Name of the target Elasticsearch index.
- mappings str
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op). - elasticsearch_
connections Sequence[ElasticsearchIndex Mappings Elasticsearch Connection Args] - Elasticsearch connection configuration block.
- index String
- Name of the target Elasticsearch index.
- mappings String
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op). - elasticsearch
Connections List<Property Map> - Elasticsearch connection configuration block.
Outputs
All input properties are implicitly available as output properties. Additionally, the ElasticsearchIndexMappings 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 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 ElasticsearchIndexMappings Resource
Get an existing ElasticsearchIndexMappings 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?: ElasticsearchIndexMappingsState, opts?: CustomResourceOptions): ElasticsearchIndexMappings@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
elasticsearch_connections: Optional[Sequence[ElasticsearchIndexMappingsElasticsearchConnectionArgs]] = None,
index: Optional[str] = None,
mappings: Optional[str] = None) -> ElasticsearchIndexMappingsfunc GetElasticsearchIndexMappings(ctx *Context, name string, id IDInput, state *ElasticsearchIndexMappingsState, opts ...ResourceOption) (*ElasticsearchIndexMappings, error)public static ElasticsearchIndexMappings Get(string name, Input<string> id, ElasticsearchIndexMappingsState? state, CustomResourceOptions? opts = null)public static ElasticsearchIndexMappings get(String name, Output<String> id, ElasticsearchIndexMappingsState state, CustomResourceOptions options)resources: _: type: elasticstack:ElasticsearchIndexMappings get: id: ${id}import {
to = elasticstack_elasticsearchindexmappings.example
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.
- Elasticsearch
Connections List<ElasticsearchIndex Mappings Elasticsearch Connection> - Elasticsearch connection configuration block.
- Index string
- Name of the target Elasticsearch index.
- Mappings string
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op).
- Elasticsearch
Connections []ElasticsearchIndex Mappings Elasticsearch Connection Args - Elasticsearch connection configuration block.
- Index string
- Name of the target Elasticsearch index.
- Mappings string
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op).
- elasticsearch_
connections list(object) - Elasticsearch connection configuration block.
- index string
- Name of the target Elasticsearch index.
- mappings string
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op).
- elasticsearch
Connections List<ElasticsearchIndex Mappings Elasticsearch Connection> - Elasticsearch connection configuration block.
- index String
- Name of the target Elasticsearch index.
- mappings String
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op).
- elasticsearch
Connections ElasticsearchIndex Mappings Elasticsearch Connection[] - Elasticsearch connection configuration block.
- index string
- Name of the target Elasticsearch index.
- mappings string
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op).
- elasticsearch_
connections Sequence[ElasticsearchIndex Mappings Elasticsearch Connection Args] - Elasticsearch connection configuration block.
- index str
- Name of the target Elasticsearch index.
- mappings str
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op).
- elasticsearch
Connections List<Property Map> - Elasticsearch connection configuration block.
- index String
- Name of the target Elasticsearch index.
- mappings String
- JSON mappings object to manage on the index. All top-level keys (
properties,dynamic,_source,dynamic_templates,runtime, etc.) are supported. Only the keys and fields declared here are tracked; dynamic extras added by Elasticsearch are ignored. Destroying this resource does not remove mappings from the index (a no-op).
Supporting Types
ElasticsearchIndexMappingsElasticsearchConnection, ElasticsearchIndexMappingsElasticsearchConnectionArgs
- Api
Key string - API Key to use for authentication to Elasticsearch
- Bearer
Token string - Bearer Token to use for authentication to Elasticsearch
- Ca
Data string - PEM-encoded custom Certificate Authority certificate
- Ca
File string - Path to a custom Certificate Authority certificate
- Cert
Data string - PEM encoded certificate for client auth
- Cert
File string - Path to a file containing the PEM encoded certificate for client auth
- Endpoints List<string>
- Es
Client stringAuthentication - ES Client Authentication field to be used with the JWT token
- Headers Dictionary<string, string>
- A list of headers to be sent with each request to Elasticsearch.
- Insecure bool
- Disable TLS certificate validation
- Key
Data string - PEM encoded private key for client auth
- Key
File string - Path to a file containing the PEM encoded private key for client auth
- Password string
- Password to use for API authentication to Elasticsearch.
- Username string
- Username to use for API authentication to Elasticsearch.
- Api
Key string - API Key to use for authentication to Elasticsearch
- Bearer
Token string - Bearer Token to use for authentication to Elasticsearch
- Ca
Data string - PEM-encoded custom Certificate Authority certificate
- Ca
File string - Path to a custom Certificate Authority certificate
- Cert
Data string - PEM encoded certificate for client auth
- Cert
File string - Path to a file containing the PEM encoded certificate for client auth
- Endpoints []string
- Es
Client stringAuthentication - ES Client Authentication field to be used with the JWT token
- Headers map[string]string
- A list of headers to be sent with each request to Elasticsearch.
- Insecure bool
- Disable TLS certificate validation
- Key
Data string - PEM encoded private key for client auth
- Key
File string - Path to a file containing the PEM encoded private key for client auth
- Password string
- Password to use for API authentication to Elasticsearch.
- Username string
- Username to use for API authentication to Elasticsearch.
- api_
key string - API Key to use for authentication to Elasticsearch
- bearer_
token string - Bearer Token to use for authentication to Elasticsearch
- ca_
data string - PEM-encoded custom Certificate Authority certificate
- ca_
file string - Path to a custom Certificate Authority certificate
- cert_
data string - PEM encoded certificate for client auth
- cert_
file string - Path to a file containing the PEM encoded certificate for client auth
- endpoints list(string)
- es_
client_ stringauthentication - ES Client Authentication field to be used with the JWT token
- headers map(string)
- A list of headers to be sent with each request to Elasticsearch.
- insecure bool
- Disable TLS certificate validation
- key_
data string - PEM encoded private key for client auth
- key_
file string - Path to a file containing the PEM encoded private key for client auth
- password string
- Password to use for API authentication to Elasticsearch.
- username string
- Username to use for API authentication to Elasticsearch.
- api
Key String - API Key to use for authentication to Elasticsearch
- bearer
Token String - Bearer Token to use for authentication to Elasticsearch
- ca
Data String - PEM-encoded custom Certificate Authority certificate
- ca
File String - Path to a custom Certificate Authority certificate
- cert
Data String - PEM encoded certificate for client auth
- cert
File String - Path to a file containing the PEM encoded certificate for client auth
- endpoints List<String>
- es
Client StringAuthentication - ES Client Authentication field to be used with the JWT token
- headers Map<String,String>
- A list of headers to be sent with each request to Elasticsearch.
- insecure Boolean
- Disable TLS certificate validation
- key
Data String - PEM encoded private key for client auth
- key
File String - Path to a file containing the PEM encoded private key for client auth
- password String
- Password to use for API authentication to Elasticsearch.
- username String
- Username to use for API authentication to Elasticsearch.
- api
Key string - API Key to use for authentication to Elasticsearch
- bearer
Token string - Bearer Token to use for authentication to Elasticsearch
- ca
Data string - PEM-encoded custom Certificate Authority certificate
- ca
File string - Path to a custom Certificate Authority certificate
- cert
Data string - PEM encoded certificate for client auth
- cert
File string - Path to a file containing the PEM encoded certificate for client auth
- endpoints string[]
- es
Client stringAuthentication - ES Client Authentication field to be used with the JWT token
- headers {[key: string]: string}
- A list of headers to be sent with each request to Elasticsearch.
- insecure boolean
- Disable TLS certificate validation
- key
Data string - PEM encoded private key for client auth
- key
File string - Path to a file containing the PEM encoded private key for client auth
- password string
- Password to use for API authentication to Elasticsearch.
- username string
- Username to use for API authentication to Elasticsearch.
- api_
key str - API Key to use for authentication to Elasticsearch
- bearer_
token str - Bearer Token to use for authentication to Elasticsearch
- ca_
data str - PEM-encoded custom Certificate Authority certificate
- ca_
file str - Path to a custom Certificate Authority certificate
- cert_
data str - PEM encoded certificate for client auth
- cert_
file str - Path to a file containing the PEM encoded certificate for client auth
- endpoints Sequence[str]
- es_
client_ strauthentication - ES Client Authentication field to be used with the JWT token
- headers Mapping[str, str]
- A list of headers to be sent with each request to Elasticsearch.
- insecure bool
- Disable TLS certificate validation
- key_
data str - PEM encoded private key for client auth
- key_
file str - Path to a file containing the PEM encoded private key for client auth
- password str
- Password to use for API authentication to Elasticsearch.
- username str
- Username to use for API authentication to Elasticsearch.
- api
Key String - API Key to use for authentication to Elasticsearch
- bearer
Token String - Bearer Token to use for authentication to Elasticsearch
- ca
Data String - PEM-encoded custom Certificate Authority certificate
- ca
File String - Path to a custom Certificate Authority certificate
- cert
Data String - PEM encoded certificate for client auth
- cert
File String - Path to a file containing the PEM encoded certificate for client auth
- endpoints List<String>
- es
Client StringAuthentication - ES Client Authentication field to be used with the JWT token
- headers Map<String>
- A list of headers to be sent with each request to Elasticsearch.
- insecure Boolean
- Disable TLS certificate validation
- key
Data String - PEM encoded private key for client auth
- key
File String - Path to a file containing the PEM encoded private key for client auth
- password String
- Password to use for API authentication to Elasticsearch.
- username String
- Username to use for API authentication to Elasticsearch.
Package Details
- Repository
- elasticstack elastic/terraform-provider-elasticstack
- License
- Notes
- This Pulumi package is based on the
elasticstackTerraform Provider.
published on Monday, May 25, 2026 by elastic