Giter VIP home page Giter VIP logo

terraform-provider-algolia's Introduction

Terraform Provider Algolia

License: MPL-2.0 Tests Workflow codecov Go Report Card

Terraform Provider for Algolia.

Documentation

Full, comprehensive documentation is available on the Terraform website:

https://registry.terraform.io/providers/k-yomo/algolia/latest/docs

Using the provider

Set an environment variable ALGOLIA_API_KEY to store your Algolia API key.

$ export ALGOLIA_API_KEY=<your api key>

The example below demonstrates the following operations:

  • create index
  • create rule for the index
  • create api key to search the index
terraform {
  required_providers {
    algolia = {
      source = "k-yomo/algolia"
      version = ">= 0.1.0, < 1.0.0"
    }
  }
}

provider "algolia" {
  app_id = "XXXXXXXXXX"
}

resource "algolia_index" "example" {
  name = "example"
  attributes_config {
    searchable_attributes = [
      "title",
      "category,tag",
      "unordered(description)",
    ]
    attributes_for_faceting = [
      "category"
    ]
    unretrievable_attributes = [
      "author_email"
    ]
    attributes_to_retrieve = [
      "title",
      "category",
      "tag",
      "description",
      "body"
    ]
  }

  ranking_config {
    ranking = [
      "words",
      "proximity"
    ]
  }

  faceting_config {
    max_values_per_facet = 50
    sort_facet_values_by = "alpha"
  }

  languages_config {
    remove_stop_words_for = ["en"]
  }
}

resource "algolia_rule" "example" {
  index_name = algolia_index.example.name
  object_id = "example-rule"

  conditions {
    pattern = "{facet:category}"
    anchoring = "contains"
  }

  consequence {
    params {
      automatic_facet_filters {
        facet = "category"
        disjunctive = true
      }
    }
  }
}


resource "algolia_api_key" "example" {
  acl = [
    "search",
    "browse"
  ]
  expires_at = "2030-01-01T00:00:00Z"
  max_hits_per_query = 100
  max_queries_per_ip_per_hour = 10000
  description = "This is a example api key"
  indexes = [algolia_index.example.name]
  referers = ["https://algolia.com/\\*"]
}

Supported resources

Contributing

I appreciate your help!

To contribute, please read the Contributing to Terraform - Algolia Provider

terraform-provider-algolia's People

Contributors

k-yomo avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.