Skip to content

Commit

Permalink
Generated docs (#634)
Browse files Browse the repository at this point in the history
* Install tfplugindocs

* Add docs template for deployment resource

* Add docs template for keystore resource

* Add docs template for extension resource

* Add docs template for traffic filter resource

* Add docs template for traffic filter association resource

* Add docs template for snapshot repository resource

* Add docs template for traffic filter data source

* Add docs template for stack data source

* Add docs template for deployments source

* Add docs template for deployment source

* Index template

* Ensure the docs in master are up to date

* Generate docs

* Fix acceptance tests

* PR feedback
  • Loading branch information
tobio committed May 4, 2023
1 parent 983a50e commit b3ccfc2
Show file tree
Hide file tree
Showing 80 changed files with 2,751 additions and 1,409 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/changelog_generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
go-version: 1.19
id: go

- run: make changelog vendor
- run: make docs-generate changelog vendor
- name: Commit & Push changes
run: |
if [[ ! -z $(git status --porcelain) ]]; then
git config --local user.email elasticcloudclients@elastic.co
git config --local user.name elasticcloudclients
git add CHANGELOG.md NOTICE
git commit -m "Update CHANGELOG.md and NOTICE"
git add docs/ CHANGELOG.md NOTICE
git commit -m "Update documentation, CHANGELOG.md, and NOTICE"
git push
fi
5 changes: 5 additions & 0 deletions build/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ install: build
@ mkdir -p $(shell dirname $(PLUGIN_LOCATION)/$(PLUGIN_0.13))
@ cp $(BINARY_LOCATION) $(PLUGIN_LOCATION)/$(PLUGIN_0.13)
@ echo "-> Copied terraform provider to $(PLUGIN_LOCATION)/$(PLUGIN_0.13)"

## Generate Terraform docs
.PHONY: docs-generate
docs-generate: tools ## Generate documentation for the provider
@ $(GOBIN)/tfplugindocs
9 changes: 9 additions & 0 deletions build/Makefile.deps
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ VERSION_GOLANGCILINT:=v1.50.0
VERSION_GORELEASER:=v1.15.2
VERSION_GOCHANGELOG:=v0.0.0-20201005170154-56335215ce3a
VERSION_VERSIONBUMP:=v1.1.0
VERSION_TFPLUGINDOCS:=v0.14.1

deps: $(GOBIN)/go-licenser $(GOBIN)/golangci-lint

Expand Down Expand Up @@ -59,3 +60,11 @@ $(VERSION_DIR)/.version-versionbump-$(VERSION_VERSIONBUMP): | $(VERSION_DIR)
$(GOBIN)/versionbump: $(VERSION_DIR)/.version-versionbump-$(VERSION_VERSIONBUMP) | $(GOBIN)
@ echo "-> Installing versionbump..."
@ go install github.com/crosseyed/versionbump/cmd/versionbump@$(VERSION_VERSIONBUMP)

$(VERSION_DIR)/.version-tfplugindocs-$(VERSION_TFPLUGINDOCS): | $(VERSION_DIR)
@ rm -f $(VERSION_DIR)/.version-tfplugindocs-*
@ echo $(VERSION_TFPLUGINDOCS) > $(VERSION_DIR)/.version-tfplugindocs-$(VERSION_TFPLUGINDOCS)

$(GOBIN)/tfplugindocs: $(VERSION_DIR)/.version-tfplugindocs-$(VERSION_TFPLUGINDOCS) | $(GOBIN)
@ echo "-> Installing tfplugindocs..."
@ go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@$(VERSION_TFPLUGINDOCS)
2 changes: 1 addition & 1 deletion build/Makefile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VERSION_TERRAFMT:=v0.5.2
VERSION_TFPROVIDERLINT:=v0.28.1

## Installs the required static checks for terraform.
tools: $(GOBIN)/tfproviderdocs $(GOBIN)/terrafmt $(GOBIN)/tfproviderlint
tools: $(GOBIN)/tfproviderdocs $(GOBIN)/terrafmt $(GOBIN)/tfproviderlint $(GOBIN)/tfplugindocs


$(VERSION_DIR)/.version-tfproviderdocs-$(VERSION_TFPROVIDERDOCS): | $(VERSION_DIR)
Expand Down
207 changes: 207 additions & 0 deletions docs/data-sources/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
---
page_title: "Elastic Cloud: ec_deployment Data Source"
description: |-
Use this data source to retrieve information about an existing Elastic Cloud deployment.
---

# Data Source: ec_deployment

Use this data source to retrieve information about an existing Elastic Cloud deployment.

## Example Usage

```terraform
data "ec_deployment" "example" {
id = "f759065e5e64e9f3546f6c44f2743893"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) The unique ID of the deployment.

### Read-Only

- `alias` (String) Deployment alias.
- `apm` (Attributes List) Instance configuration of the APM type. (see [below for nested schema](#nestedatt--apm))
- `deployment_template_id` (String) ID of the deployment template this deployment is based off.
- `elasticsearch` (Attributes List) Instance configuration of the Elasticsearch Elasticsearch resource. (see [below for nested schema](#nestedatt--elasticsearch))
- `enterprise_search` (Attributes List) Instance configuration of the Enterprise Search type. (see [below for nested schema](#nestedatt--enterprise_search))
- `healthy` (Boolean) Overall health status of the deployment.
- `integrations_server` (Attributes List) Instance configuration of the Integrations Server type. (see [below for nested schema](#nestedatt--integrations_server))
- `kibana` (Attributes List) Instance configuration of the Kibana type. (see [below for nested schema](#nestedatt--kibana))
- `name` (String) The name of the deployment.
- `observability` (Attributes List) Observability settings. Information about logs and metrics shipped to a dedicated deployment. (see [below for nested schema](#nestedatt--observability))
- `region` (String) Region where the deployment is hosted.
- `tags` (Map of String) Key value map of arbitrary string tags.
- `traffic_filter` (List of String) Traffic filter block, which contains a list of traffic filter rule identifiers.

<a id="nestedatt--apm"></a>
### Nested Schema for `apm`

Read-Only:

- `elasticsearch_cluster_ref_id` (String) The locally-unique user-specified id of an APM Resource.
- `healthy` (Boolean) APM resource health status.
- `http_endpoint` (String) HTTP endpoint for the APM resource.
- `https_endpoint` (String) HTTPS endpoint for the APM resource.
- `ref_id` (String) A locally-unique friendly alias for this APM resource.
- `resource_id` (String) The resource unique identifier.
- `status` (String) APM resource status (for example, "started", "stopped", etc).
- `topology` (Attributes List) Node topology element definition. (see [below for nested schema](#nestedatt--apm--topology))
- `version` (String) Elastic stack version.

<a id="nestedatt--apm--topology"></a>
### Nested Schema for `apm.topology`

Read-Only:

- `instance_configuration_id` (String) Controls the allocation of this topology element as well as allowed sizes and node_types. It needs to match the ID of an existing instance configuration.
- `size` (String) Amount of "size_resource" in Gigabytes. For example "4g".
- `size_resource` (String) Type of resource ("memory" or "storage")
- `zone_count` (Number) Number of zones in which nodes will be placed.



<a id="nestedatt--elasticsearch"></a>
### Nested Schema for `elasticsearch`

Read-Only:

- `autoscale` (String) Whether or not Elasticsearch autoscaling is enabled.
- `cloud_id` (String) The cloud ID, an encoded string that provides other Elastic services with the necessary information to connect to this Elasticsearch and Kibana. See [Configure Beats and Logstash with Cloud ID](https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html) for more information.
- `healthy` (Boolean) Elasticsearch resource health status.
- `http_endpoint` (String) HTTP endpoint for the Elasticsearch resource.
- `https_endpoint` (String) HTTPS endpoint for the Elasticsearch resource.
- `ref_id` (String) A locally-unique friendly alias for this Elasticsearch cluster.
- `resource_id` (String) The resource unique identifier.
- `status` (String) Elasticsearch resource status (for example, "started", "stopped", etc).
- `topology` (Attributes List) Node topology element definition. (see [below for nested schema](#nestedatt--elasticsearch--topology))
- `version` (String) Elastic stack version.

<a id="nestedatt--elasticsearch--topology"></a>
### Nested Schema for `elasticsearch.topology`

Read-Only:

- `autoscaling` (Attributes List) Optional Elasticsearch autoscaling settings, such a maximum and minimum size and resources. (see [below for nested schema](#nestedatt--elasticsearch--topology--autoscaling))
- `instance_configuration_id` (String) Controls the allocation of this topology element as well as allowed sizes and node_types. It needs to match the ID of an existing instance configuration.
- `node_roles` (Set of String) Defines the list of Elasticsearch node roles assigned to the topology element. This is supported from v7.10, and required from v8.
- `node_type_data` (Boolean) Defines whether this node can hold data (<8.0).
- `node_type_ingest` (Boolean) Defines whether this node can run an ingest pipeline (<8.0).
- `node_type_master` (Boolean) Defines whether this node can be elected master (<8.0).
- `node_type_ml` (Boolean) Defines whether this node can run ML jobs (<8.0).
- `size` (String) Amount of "size_resource" per topology element in Gigabytes. For example "4g".
- `size_resource` (String) Type of resource ("memory" or "storage")
- `zone_count` (Number) Number of zones in which nodes will be placed.

<a id="nestedatt--elasticsearch--topology--autoscaling"></a>
### Nested Schema for `elasticsearch.topology.autoscaling`

Read-Only:

- `max_size` (String) Maximum size the tier can scale up to, e.g "64g".
- `max_size_resource` (String) Resource type used when specifying the maximum size the tier can scale up to.
- `min_size` (String) Minimum size the tier can scale down to when bidirectional autoscaling is supported.
- `min_size_resource` (String) Resource type used when specifying the minimum size the tier can scale down to when bidirectional autoscaling is supported.
- `policy_override_json` (String) An arbitrary JSON object overriding the default autoscaling policy. Don't set unless you really know what you are doing.




<a id="nestedatt--enterprise_search"></a>
### Nested Schema for `enterprise_search`

Read-Only:

- `elasticsearch_cluster_ref_id` (String) A locally-unique friendly alias for an Elasticsearch resource in this deployment.
- `healthy` (Boolean) Enterprise Search resource health status.
- `http_endpoint` (String) HTTP endpoint for the Enterprise Search resource.
- `https_endpoint` (String) HTTPS endpoint for the Enterprise Search resource.
- `ref_id` (String) A locally-unique friendly alias for this Enterprise Search resource.
- `resource_id` (String) The resource unique identifier.
- `status` (String) Enterprise Search resource status (for example, "started", "stopped", etc).
- `topology` (Attributes List) Node topology element definition. (see [below for nested schema](#nestedatt--enterprise_search--topology))
- `version` (String) Elastic stack version.

<a id="nestedatt--enterprise_search--topology"></a>
### Nested Schema for `enterprise_search.topology`

Read-Only:

- `instance_configuration_id` (String) Controls the allocation of this topology element as well as allowed sizes and node_types. It needs to match the ID of an existing instance configuration.
- `node_type_appserver` (Boolean) Defines whether this instance should run as application/API server.
- `node_type_connector` (Boolean) Defines whether this instance should run as connector.
- `node_type_worker` (Boolean) Defines whether this instance should run as background worker.
- `size` (String) Amount of "size_resource" in Gigabytes. For example "4g".
- `size_resource` (String) Type of resource ("memory" or "storage")
- `zone_count` (Number) Number of zones in which nodes will be placed.



<a id="nestedatt--integrations_server"></a>
### Nested Schema for `integrations_server`

Read-Only:

- `elasticsearch_cluster_ref_id` (String) A locally-unique friendly alias for an Elasticsearch resource in this deployment.
- `healthy` (Boolean) Resource kind health status.
- `http_endpoint` (String) HTTP endpoint for the resource kind.
- `https_endpoint` (String) HTTPS endpoint for the resource kind.
- `ref_id` (String) A locally-unique friendly alias for this Integrations Server resource.
- `resource_id` (String) The resource unique identifier.
- `status` (String) Resource kind status (for example, "started", "stopped", etc).
- `topology` (Attributes List) Node topology element definition. (see [below for nested schema](#nestedatt--integrations_server--topology))
- `version` (String) Elastic stack version.

<a id="nestedatt--integrations_server--topology"></a>
### Nested Schema for `integrations_server.topology`

Read-Only:

- `instance_configuration_id` (String) Controls the allocation of this topology element as well as allowed sizes and node_types. It needs to match the ID of an existing instance configuration.
- `size` (String) Amount of "size_resource" in Gigabytes. For example "4g".
- `size_resource` (String) Type of resource ("memory" or "storage")
- `zone_count` (Number) Number of zones in which nodes will be placed.



<a id="nestedatt--kibana"></a>
### Nested Schema for `kibana`

Read-Only:

- `elasticsearch_cluster_ref_id` (String) A locally-unique friendly alias for an Elasticsearch resource in this deployment.
- `healthy` (Boolean) Kibana resource health status.
- `http_endpoint` (String) HTTP endpoint for the Kibana resource.
- `https_endpoint` (String) HTTPS endpoint for the Kibana resource.
- `ref_id` (String) A locally-unique friendly alias for this Kibana resource.
- `resource_id` (String) The resource unique identifier.
- `status` (String) Kibana resource status (for example, "started", "stopped", etc).
- `topology` (Attributes List) Node topology element definition. (see [below for nested schema](#nestedatt--kibana--topology))
- `version` (String) Elastic stack version.

<a id="nestedatt--kibana--topology"></a>
### Nested Schema for `kibana.topology`

Read-Only:

- `instance_configuration_id` (String) Controls the allocation of this topology element as well as allowed sizes and node_types. It needs to match the ID of an existing instance configuration.
- `size` (String) Amount of size_resource in Gigabytes. For example "4g".
- `size_resource` (String) Type of resource ("memory" or "storage")
- `zone_count` (Number) Number of zones in which nodes will be placed.



<a id="nestedatt--observability"></a>
### Nested Schema for `observability`

Read-Only:

- `deployment_id` (String) Destination deployment ID for the shipped logs and monitoring metrics.
- `logs` (Boolean) Defines whether logs are shipped to the destination deployment.
- `metrics` (Boolean) Defines whether metrics are shipped to the destination deployment.
- `ref_id` (String) Elasticsearch resource kind ref_id of the destination deployment.
131 changes: 131 additions & 0 deletions docs/data-sources/deployments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
page_title: "Elastic Cloud: ec_deployments Data Source"
description: |-
Use this data source to retrieve a list of IDs for the deployment and resource kinds, based on the specified query.
---

# Data Source: ec_deployments

Use this data source to retrieve a list of IDs for the deployment and resource kinds, based on the specified query.

## Example Usage

```terraform
data "ec_deployments" "example" {
name_prefix = "test"
deployment_template_id = "azure-compute-optimized"
size = 200
tags = {
"foo" = "bar"
}
elasticsearch {
healthy = "true"
}
kibana {
status = "started"
}
integrations_server {
version = "8.0.0"
}
enterprise_search {
healthy = "true"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `apm` (Block List) Filter by APM resource kind status or configuration. (see [below for nested schema](#nestedblock--apm))
- `deployment_template_id` (String) Filter the result set by the ID of the deployment template the deployment is based off.
- `elasticsearch` (Block List) Filter by Elasticsearch resource kind status or configuration. (see [below for nested schema](#nestedblock--elasticsearch))
- `enterprise_search` (Block List) Filter by Enterprise Search resource kind status or configuration. (see [below for nested schema](#nestedblock--enterprise_search))
- `healthy` (String) Filter the result set by their health status.
- `integrations_server` (Block List) Filter by Integrations Server resource kind status or configuration. (see [below for nested schema](#nestedblock--integrations_server))
- `kibana` (Block List) Filter by Kibana resource kind status or configuration. (see [below for nested schema](#nestedblock--kibana))
- `name_prefix` (String) Prefix to filter the returned deployment list by.
- `size` (Number) The maximum number of deployments to return. Defaults to `100`.
- `tags` (Map of String) Filter the result set by their assigned tags.

### Read-Only

- `deployments` (Attributes List) List of deployments which match the specified query. (see [below for nested schema](#nestedatt--deployments))
- `id` (String) Unique identifier of this data source.
- `return_count` (Number) The number of deployments actually returned.

<a id="nestedblock--apm"></a>
### Nested Schema for `apm`

Optional:

- `healthy` (String) Overall health status of the resource instances.
- `status` (String) Resource kind status. Can be one of `initializing`, `stopping`, `stopped`, `rebooting`, `restarting`.
- `version` (String) Elastic stack version.


<a id="nestedblock--elasticsearch"></a>
### Nested Schema for `elasticsearch`

Optional:

- `healthy` (String) Overall health status of the resource instances.
- `status` (String) Resource kind status. Can be one of `initializing`, `stopping`, `stopped`, `rebooting`, `restarting`.
- `version` (String) Elastic stack version.


<a id="nestedblock--enterprise_search"></a>
### Nested Schema for `enterprise_search`

Optional:

- `healthy` (String) Overall health status of the resource instances.
- `status` (String) Resource kind status. Can be one of `initializing`, `stopping`, `stopped`, `rebooting`, `restarting`.
- `version` (String) Elastic stack version.


<a id="nestedblock--integrations_server"></a>
### Nested Schema for `integrations_server`

Optional:

- `healthy` (String) Overall health status of the resource instances.
- `status` (String) Resource kind status. Can be one of `initializing`, `stopping`, `stopped`, `rebooting`, `restarting`.
- `version` (String) Elastic stack version.


<a id="nestedblock--kibana"></a>
### Nested Schema for `kibana`

Optional:

- `healthy` (String) Overall health status of the resource instances.
- `status` (String) Resource kind status. Can be one of `initializing`, `stopping`, `stopped`, `rebooting`, `restarting`.
- `version` (String) Elastic stack version.


<a id="nestedatt--deployments"></a>
### Nested Schema for `deployments`

Read-Only:

- `alias` (String) Deployment alias.
- `apm_ref_id` (String) The APM resource reference.
- `apm_resource_id` (String) The APM resource unique ID.
- `deployment_id` (String) The deployment unique ID.
- `elasticsearch_ref_id` (String) The Elasticsearch resource reference.
- `elasticsearch_resource_id` (String) The Elasticsearch resource unique ID.
- `enterprise_search_ref_id` (String) The Enterprise Search resource reference.
- `enterprise_search_resource_id` (String) The Enterprise Search resource unique ID.
- `integrations_server_ref_id` (String) The Integrations Server resource reference.
- `integrations_server_resource_id` (String) The Integrations Server resource unique ID.
- `kibana_ref_id` (String) The Kibana resource reference.
- `kibana_resource_id` (String) The Kibana resource unique ID.
- `name` (String) The name of the deployment.
Loading

0 comments on commit b3ccfc2

Please sign in to comment.