Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for remote_indicies to elasticstack_elasticsearch_security_role & elasticstack_kibana_security_role #723

Merged
merged 14 commits into from
Aug 26, 2024
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Add the `alert_delay` field to the Create Rule API ([#715](https://github.com/elastic/terraform-provider-elasticstack/pull/715))
- Add support for data_stream `lifecycle` template settings ([#724](https://github.com/elastic/terraform-provider-elasticstack/pull/724))
- Fix a provider panic when `elasticstack_kibana_action_connector` reads a non-existant connector ([#729](https://github.com/elastic/terraform-provider-elasticstack/pull/729))
- Add support for `remote_indicies` to `elasticstack_elasticsearch_security_role` & `elasticstack_kibana_security_role` (#723)[https://github.com/elastic/terraform-provider-elasticstack/pull/723]

## [0.11.6] - 2024-08-20

Expand Down
22 changes: 22 additions & 0 deletions docs/data-sources/elasticsearch_security_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ output "role" {
- `id` (String) Internal identifier of the resource
- `indices` (Set of Object) A list of indices permissions entries. (see [below for nested schema](#nestedatt--indices))
- `metadata` (String) Optional meta-data.
- `remote_indices` (Set of Object) A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model. (see [below for nested schema](#nestedatt--remote_indices))

<a id="nestedblock--elasticsearch_connection"></a>
### Nested Schema for `elasticsearch_connection`
Expand Down Expand Up @@ -95,3 +96,24 @@ Read-Only:

- `except` (Set of String)
- `grant` (Set of String)



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

Read-Only:

- `clusters` (Set of String)
- `field_security` (List of Object) (see [below for nested schema](#nestedobjatt--remote_indices--field_security))
- `names` (Set of String)
- `privileges` (Set of String)
- `query` (String)

<a id="nestedobjatt--remote_indices--field_security"></a>
### Nested Schema for `remote_indices.field_security`

Read-Only:

- `except` (Set of String)
- `grant` (Set of String)
22 changes: 22 additions & 0 deletions docs/data-sources/kibana_security_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Read-Only:

- `cluster` (Set of String)
- `indices` (Set of Object) (see [below for nested schema](#nestedobjatt--elasticsearch--indices))
- `remote_indices` (Set of Object) (see [below for nested schema](#nestedobjatt--elasticsearch--remote_indices))
- `run_as` (Set of String)

<a id="nestedobjatt--elasticsearch--indices"></a>
Expand All @@ -69,6 +70,27 @@ Read-Only:



<a id="nestedobjatt--elasticsearch--remote_indices"></a>
### Nested Schema for `elasticsearch.remote_indices`

Read-Only:

- `clusters` (Set of String)
- `field_security` (List of Object) (see [below for nested schema](#nestedobjatt--elasticsearch--remote_indices--field_security))
- `names` (Set of String)
- `privileges` (Set of String)
- `query` (String)

<a id="nestedobjatt--elasticsearch--remote_indices--field_security"></a>
### Nested Schema for `elasticsearch.remote_indices.field_security`

Read-Only:

- `except` (Set of String)
- `grant` (Set of String)




<a id="nestedatt--kibana"></a>
### Nested Schema for `kibana`
Expand Down
25 changes: 25 additions & 0 deletions docs/resources/elasticsearch_security_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ output "role" {
- `global` (String) An object defining global privileges.
- `indices` (Block Set) A list of indices permissions entries. (see [below for nested schema](#nestedblock--indices))
- `metadata` (String) Optional meta-data.
- `remote_indices` (Block Set) A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model. (see [below for nested schema](#nestedblock--remote_indices))
- `run_as` (Set of String) A list of users that the owners of this role can impersonate.

### Read-Only
Expand Down Expand Up @@ -117,6 +118,30 @@ Optional:
- `except` (Set of String) List of the fields to which the grants will not be applied.
- `grant` (Set of String) List of the fields to grant the access to.



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

Required:

- `clusters` (Set of String) A list of cluster aliases to which the permissions in this entry apply.
- `names` (Set of String) A list of indices (or index name patterns) to which the permissions in this entry apply.
- `privileges` (Set of String) The index level privileges that the owners of the role have on the specified indices.

Optional:

- `field_security` (Block List, Max: 1) The document fields that the owners of the role have read access to. (see [below for nested schema](#nestedblock--remote_indices--field_security))
- `query` (String) A search query that defines the documents the owners of the role have read access to.

<a id="nestedblock--remote_indices--field_security"></a>
### Nested Schema for `remote_indices.field_security`

Optional:

- `except` (Set of String) List of the fields to which the grants will not be applied.
- `grant` (Set of String) List of the fields to grant the access to.

## Import

Import is supported using the following syntax:
Expand Down
43 changes: 43 additions & 0 deletions docs/resources/kibana_security_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ resource "elasticstack_kibana_security_role" "example" {
names = ["test"]
privileges = ["create", "read", "write"]
}
remote_indices {
field_security {
grant = ["test"]
except = []
}
names = ["test"]
clusters = ["test-cluster"]
privileges = ["create", "read", "write"]
}
}
kibana {
base = ["all"]
Expand Down Expand Up @@ -60,6 +69,15 @@ resource "elasticstack_kibana_security_role" "example" {
names = ["test"]
privileges = ["create", "read", "write"]
}
remote_indices {
field_security {
grant = ["test"]
except = []
}
names = ["test"]
clusters = ["test-cluster"]
privileges = ["create", "read", "write"]
}
}
kibana {
feature {
Expand Down Expand Up @@ -116,6 +134,7 @@ Optional:

- `cluster` (Set of String) List of the cluster privileges.
- `indices` (Block Set) A list of indices permissions entries. (see [below for nested schema](#nestedblock--elasticsearch--indices))
- `remote_indices` (Block Set) A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model. (see [below for nested schema](#nestedblock--elasticsearch--remote_indices))
- `run_as` (Set of String) A list of usernames the owners of this role can impersonate.

<a id="nestedblock--elasticsearch--indices"></a>
Expand All @@ -141,6 +160,30 @@ Optional:



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

Required:

- `clusters` (Set of String) A list of cluster aliases to which the permissions in this entry apply.
- `names` (Set of String) A list of indices (or index name patterns) to which the permissions in this entry apply.
- `privileges` (Set of String) The index level privileges that the owners of the role have on the specified indices.

Optional:

- `field_security` (Block List, Max: 1) The document fields that the owners of the role have read access to. (see [below for nested schema](#nestedblock--elasticsearch--remote_indices--field_security))
- `query` (String) A search query that defines the documents the owners of the role have read access to.

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

Optional:

- `except` (Set of String) List of the fields to which the grants will not be applied.
- `grant` (Set of String) List of the fields to grant the access to.




<a id="nestedblock--kibana"></a>
### Nested Schema for `kibana`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ resource "elasticstack_kibana_security_role" "example" {
names = ["test"]
privileges = ["create", "read", "write"]
}
remote_indices {
field_security {
grant = ["test"]
except = []
}
names = ["test"]
clusters = ["test-cluster"]
privileges = ["create", "read", "write"]
}
}
kibana {
base = ["all"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ resource "elasticstack_kibana_security_role" "example" {
names = ["test"]
privileges = ["create", "read", "write"]
}
remote_indices {
field_security {
grant = ["test"]
except = []
}
names = ["test"]
clusters = ["test-cluster"]
privileges = ["create", "read", "write"]
}
}
kibana {
feature {
Expand Down
Loading
Loading