Skip to content

Commit

Permalink
Merge pull request #143 from k-yomo/add-example-for-replica-index
Browse files Browse the repository at this point in the history
Add replica index example to the doc
  • Loading branch information
k-yomo authored Nov 14, 2022
2 parents c17851e + d93e0ba commit 5065aa6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docs/resources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ A configuration for an index.
## Example Usage

```terraform
resource "algolia_index" "example" {
name = "example"
resource "algolia_index" "primary" {
name = "primary-index"
attributes_config {
searchable_attributes = [
"title",
Expand Down Expand Up @@ -52,6 +52,12 @@ resource "algolia_index" "example" {
remove_stop_words_for = ["en"]
}
}
resource "algolia_index" "replica" {
name = "replica-index"
primary_index_name = algolia_index.primary.name
// Configure settings for this replica
}
```

<!-- schema generated by tfplugindocs -->
Expand Down
10 changes: 8 additions & 2 deletions examples/resources/algolia_index/resource.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "algolia_index" "example" {
name = "example"
resource "algolia_index" "primary" {
name = "primary-index"
attributes_config {
searchable_attributes = [
"title",
Expand Down Expand Up @@ -37,3 +37,9 @@ resource "algolia_index" "example" {
remove_stop_words_for = ["en"]
}
}

resource "algolia_index" "replica" {
name = "replica-index"
primary_index_name = algolia_index.primary.name
// Configure settings for this replica
}

0 comments on commit 5065aa6

Please sign in to comment.