Skip to content

Commit

Permalink
Fix example in readme to reflect code
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
phillbaker authored Nov 17, 2017
1 parent 70a3502 commit d427670
Showing 1 changed file with 47 additions and 18 deletions.
65 changes: 47 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ See [the docs for more information](https://www.terraform.io/docs/plugins/basics

## Usage

```
```tf
provider "elasticsearch" {
url = "https://search-foo-bar-pqrhr4w3u4dzervg41frow4mmy.us-east-1.es.amazonaws.com" # Don't include port at the end for aws
aws_access_key = ""
Expand All @@ -28,26 +28,55 @@ provider "elasticsearch" {
resource "elasticsearch_index_template" "test" {
name = "terraform-test"
template = "tf-*"
order = 1
settings {
index.number_of_shards = 5
}
mapping {
type = "reports"
date_property {
name = "created_at"
format = "EEE MMM dd HH:mm:ss Z YYYY"
}
keyword_property {
name = "subject"
body = <<EOF
{
"template": "logstash-*",
"version": 50001,
"settings": {
"index.refresh_interval": "5s"
},
"mappings": {
"_default_": {
"_all": {"enabled": true, "norms": false},
"dynamic_templates": [ {
"message_field": {
"path_match": "message",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"norms": false
}
}
}, {
"string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "text", "norms": false,
"fields": {
"keyword": { "type": "keyword" }
}
}
}
} ],
"properties": {
"@timestamp": { "type": "date", "include_in_all": false },
"@version": { "type": "keyword", "include_in_all": false },
"geoip" : {
"dynamic": true,
"properties": {
"ip": { "type": "ip" },
"location": { "type": "geo_point" },
"latitude": { "type": "half_float" },
"longitude": { "type": "half_float" }
}
}
}
}
}
}
EOF
}
# A saved search, visualization or dashboard
resource "elasticsearch_kibana_object" "test_dashboard" {
Expand Down

0 comments on commit d427670

Please sign in to comment.