diff --git a/provider/provider.go b/provider/provider.go index 19a3c82..cc4df2e 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -14,14 +14,14 @@ func Provider() *schema.Provider { Schema: map[string]*schema.Schema{ "url": { Type: schema.TypeString, - Required: true, + Optional: true, DefaultFunc: schema.EnvDefaultFunc("ELASTICSEARCH_ENDPOINT", nil), Description: "The URL for the Elasticsearch instance.", }, "token": { Type: schema.TypeString, - Required: true, Sensitive: true, + Optional: true, DefaultFunc: schema.EnvDefaultFunc("ELASTICSEARCH_API_KEY", nil), Description: "The token for API authentication.", }, diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index eec3054..553218a 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -39,6 +39,6 @@ export ELASTICSEARCH_API_KEY=token The following arguments are supported: -* `url` - (Required) Url to the ElasticSsearch API -* `token` - (Required) Authentication token to the ElasticSearch API +* `url` - (Option) Url to the Elasticsearch API. Default is `ELASTICSEARCH_ENDPOINT` environment variable. +* `token` - (Option) Authentication token to the ElasticSearch API. Default is `ELASTICSEARCH_API_KEY` environment variable. * `insecure` - (Optional) Skip server certification verification