-
Notifications
You must be signed in to change notification settings - Fork 121
Kibana action connectors #306
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
Merged
Merged
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
a0d8723
Kibana action connectors
dimuon e6a8853
Acc test for Kibana action connector
dimuon dc54742
make secrets optional
dimuon 926cb61
Fixes and improvements
dimuon 999c7fc
Improve code generation for kibana action connectors
dimuon f948faa
Using swagger-codegen for kibana actions connectors
dimuon 6b6c9d0
Switch to ogen for kibana connectors generation
dimuon 5a55d4e
add 400 http error to specs
dimuon 5a74dfb
Fixes for connectors specs
dimuon 59fbfa1
fixes
dimuon 8202acd
Code generation based on ogen and modified bundled.yaml
dimuon e3d7055
Switch code generation for Kibana connectors to oapi-codegen.
dimuon 5b947df
fix lint errors
dimuon 8ee5134
suppress diff for configs when the only diff is default values
dimuon c05c7af
fix acc test
dimuon 4e011c1
fix test
dimuon 880c57f
support all types of connectors in create
dimuon b793928
customizeDiff for connector config
dimuon 886efe6
WIP: email connector
dimuon 5c80f4c
remove commented out code from bundled.yaml
dimuon 24b1690
email connector
dimuon a58626f
remove obsolete comment
dimuon 1437742
update for the remaining connector types
dimuon dae146e
response => model and config defaults (WIP)
dimuon 29039ac
default configs
dimuon e8389ae
Merge remote-tracking branch 'upstream/main' into kibana-action-conne…
dimuon 90f923d
update test
dimuon f4f3985
renaming
dimuon d90f5fe
refactoring
dimuon c21091b
acc test for cases-webhook
dimuon 858af1e
acc test for email
dimuon 5d5ec6d
improve acc test for cases-webhook
dimuon 0bbbe6d
improve acc tests
dimuon 9a44455
acc test for jira
dimuon bbbe713
acc tests for opsgenie and pagerduty
dimuon 4940790
acc test for resilient
dimuon db32a5d
increase minimum supported version for opsgenie
dimuon 41415e7
acc tests refactoring
dimuon 0b4127f
acc test for server-log
dimuon 3acaa4a
acc test for servicenow
dimuon 8540413
acc test for servicenow-itom
dimuon 731f216
fix acc test
dimuon e78c67d
fix acc test
dimuon 90ee63a
fix acc test
dimuon dff0e60
acc test for servicenow-sir
dimuon 60c7dfc
acc test for slack
dimuon 91d81bb
acc test for swimlane
dimuon b758fd8
acc test for teams
dimuon 130c95c
acc test for tines
dimuon 6241ddd
acc test for webhook
dimuon 938172c
acc test for xmatters
dimuon 175bc13
fix matrix acc test
dimuon 7cbc45d
unit test for connectorResponseToModel
dimuon 824fe3f
Merge remote-tracking branch 'upstream/main' into kibana-action-conne…
dimuon 58eac4c
update go.mod
dimuon ec39434
Merge remote-tracking branch 'upstream/main' into kibana-action-conne…
dimuon fa07370
address PR review
dimuon d12e73f
readme for modified specs
dimuon baec3cc
readme for the modified specs
dimuon 5e9f87f
fix Makefile
dimuon 9a1c1dc
move connectors client generation to tools
dimuon c076b83
formatting
dimuon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "elasticstack_kibana_action_connector Resource - terraform-provider-elasticstack" | ||
subcategory: "" | ||
description: |- | ||
Creates a Kibana action connector. See https://www.elastic.co/guide/en/kibana/8.7/action-types.html | ||
--- | ||
|
||
# elasticstack_kibana_action_connector (Resource) | ||
|
||
Creates a Kibana action connector. See https://www.elastic.co/guide/en/kibana/8.7/action-types.html | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "elasticstack" { | ||
elasticsearch {} | ||
} | ||
|
||
resource "elasticstack_kibana_action_connector" "example" { | ||
name = "%s" | ||
config = jsonencode({ | ||
index = ".kibana" | ||
refresh = true | ||
}) | ||
connector_type_id = ".index" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `connector_type_id` (String) The ID of the connector type, e.g. `.index`. | ||
- `name` (String) The name of the connector. While this name does not have to be unique, a distinctive name can help you identify a connector. | ||
|
||
### Optional | ||
|
||
- `config` (String) The configuration for the connector. Configuration properties vary depending on the connector type. | ||
- `connector_id` (String) A UUID v1 or v4 to use instead of a randomly generated ID. | ||
- `secrets` (String) The secrets configuration for the connector. Secrets configuration properties vary depending on the connector type. | ||
- `space_id` (String) An identifier for the space. If space_id is not provided, the default space is used. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `is_deprecated` (Boolean) Indicates whether the connector type is deprecated. | ||
- `is_missing_secrets` (Boolean) Indicates whether secrets are missing for the connector. | ||
- `is_preconfigured` (Boolean) Indicates whether it is a preconfigured connector. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import elasticstack_kibana_action_connector.my_connector <space id>/<connector id> | ||
``` |
1 change: 1 addition & 0 deletions
1
examples/resources/elasticstack_kibana_action_connector/import.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import elasticstack_kibana_action_connector.my_connector <space id>/<connector id> |
12 changes: 12 additions & 0 deletions
12
examples/resources/elasticstack_kibana_action_connector/resource.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
provider "elasticstack" { | ||
elasticsearch {} | ||
} | ||
|
||
resource "elasticstack_kibana_action_connector" "example" { | ||
name = "%s" | ||
config = jsonencode({ | ||
index = ".kibana" | ||
refresh = true | ||
}) | ||
connector_type_id = ".index" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[OpenAPI specs](./bundled.yaml) is copied from [Kibana repo](https://raw.githubusercontent.com/elastic/kibana/8.7/x-pack/plugins/actions/docs/openapi/bundled.yaml) with some modifications: | ||
|
||
- added mapping section for discriminator field in `POST` `/s/{spaceId}/api/actions/connector`; | ||
- added explicit object definitions for `400`, `401` and `404` errors (`oapi-codegen` doesn't generate proper code for embedded anonymous objects in some cases) - `bad_request_error`, `authorization_error` and `object_not_found_error`; | ||
- added missing `oneOf` types in `requestBody` for `PUT` `/s/{spaceId}/api/actions/connector/{connectorId}` - the original `bundled.yaml` misses some connector types in the `PUT` `requestBody` defintion: | ||
- `update_connector_request_email`; | ||
- `update_connector_request_pagerduty`; | ||
- `update_connector_request_servicenow_sir`; | ||
- `update_connector_request_slack`; | ||
- `update_connector_request_teams`; | ||
- `update_connector_request_tines`; | ||
- `update_connector_request_webhook`; | ||
- `update_connector_request_xmatters`. | ||
- response definitions of `/s/{spaceId}/api/actions/connector/{connectorId}/_execute` and `/s/{spaceId}/api/actions/action/{actionId}/_execute` are modified from embedded object definitions to named ones `run_connector_general_response` and `legacy_run_connector_general_response`; | ||
- specified properties for following types. The original `bundled.yaml` defines them as dynamic objects (`additionalProperties: true`): | ||
- `config_propeties_email`; | ||
- `config_properties_pagerduty`; | ||
- `config_properties_tines`; | ||
- `config_properties_webhook`; | ||
- `config_properties_xmatters`; | ||
- `is_deprecated` is marked as optional field (it's required field in the vanilla `bundled.yaml`) in the following objects (Kibana responses may omit it): | ||
- `connector_response_properties_cases_webhook`; | ||
- `connector_response_properties_email`; | ||
- `connector_response_properties_index`; | ||
- `connector_response_properties_jira`; | ||
- `connector_response_properties_opsgenie`; | ||
- `connector_response_properties_pagerduty`; | ||
- `connector_response_properties_resilient`; | ||
- `connector_response_properties_serverlog`; | ||
- `connector_response_properties_servicenow`; | ||
- `connector_response_properties_servicenow_itom`; | ||
- `connector_response_properties_servicenow_sir`; | ||
- `connector_response_properties_slack`; | ||
- `connector_response_properties_swimlane`; | ||
- `connector_response_properties_teams`; | ||
- `connector_response_properties_tines`; | ||
- `connector_response_properties_webhook`; | ||
- `connector_response_properties_xmatters`. | ||
- added mapping section for discriminator field in `connector_response_properties`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.