-
Notifications
You must be signed in to change notification settings - Fork 108
feat(synthetics): support for private location resource #696
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
biscout42
merged 17 commits into
elastic:main
from
biscout42:kibana-synthetics-monitor-resource
Aug 6, 2024
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1d23c21
feat(synthetics): support for private location resource
biscout42 b6461b3
Merge branch 'main' into kibana-synthetics-monitor-resource
biscout42 1c0bf92
add open TODOs
biscout42 87f59eb
wip: inital test with `terraform-plugin-testing`. Hit the error: `fla…
biscout42 aea0047
try to use terraform-plugin-sdk and add synthetics stack versions to …
biscout42 df5ff82
Merge branch 'main' into kibana-synthetics-monitor-resource
biscout42 96aced1
make lint happy
biscout42 f8bbe26
fixing AttributeName("geo").AttributeName("lat"): must have Required,…
biscout42 26ecfbd
make docs-generate
biscout42 3e52b8d
try to fix:
biscout42 4d1d7fe
fixed private location schema
biscout42 279ff74
make lint happy
biscout42 2fbefce
add schema tests
biscout42 ffdef90
reduce scope to private location only
biscout42 8340a37
handle 404 case
biscout42 5742d9d
test optional params
biscout42 4d04848
add documentation and updated read.me
biscout42 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
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,76 @@ | ||
--- | ||
subcategory: "Kibana" | ||
layout: "" | ||
page_title: "Elasticstack: elasticstack_kibana_synthetics_private_location Resource" | ||
description: |- | ||
Creates or updates a Kibana synthetics private location. | ||
--- | ||
|
||
# Resource: elasticstack_kibana_synthetics_private_location | ||
|
||
Creates or updates a Kibana synthetics private location. | ||
See [Monitor via a private agent](https://www.elastic.co/guide/en/observability/current/synthetics-private-location.html#monitor-via-private-agent) | ||
and [api docs](https://www.elastic.co/guide/en/kibana/current/create-private-location-api.html) | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "elasticstack" { | ||
fleet {} | ||
kibana {} | ||
} | ||
|
||
resource "elasticstack_fleet_agent_policy" "sample" { | ||
name = "Sample Agent Policy" | ||
namespace = "default" | ||
description = "A sample agent policy" | ||
monitor_logs = true | ||
monitor_metrics = true | ||
skip_destroy = false | ||
} | ||
|
||
resource "elasticstack_kibana_synthetics_private_location" "example" { | ||
label = "example label" | ||
space_id = "default" | ||
agent_policy_id = elasticstack_fleet_agent_policy.sample.policy_id | ||
tags = ["tag-a", "tag-b"] | ||
geo = { | ||
lat = 40.7128 | ||
lon = 74.0060 | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `agent_policy_id` (String) The ID of the agent policy associated with the private location. To create a private location for synthetics monitor you need to create an agent policy in fleet and use its agentPolicyId | ||
- `label` (String) A label for the private location, used as unique identifier | ||
|
||
### Optional | ||
|
||
- `geo` (Attributes) Geographic coordinates (WGS84) for the location (see [below for nested schema](#nestedatt--geo)) | ||
- `space_id` (String) An identifier for the space. If space_id is not provided, the default space is used. | ||
- `tags` (List of String) An array of tags to categorize the private location. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Generated id for the private location. For monitor setup please use private location label. | ||
|
||
<a id="nestedatt--geo"></a> | ||
### Nested Schema for `geo` | ||
|
||
Required: | ||
|
||
- `lat` (Number) The latitude of the location. | ||
- `lon` (Number) The longitude of the location. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import elasticstack_kibana_synthetics_private_location.my_location <private_location_id> | ||
``` |
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,74 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "elasticstack_kibana_synthetics_private_location Resource - terraform-provider-elasticstack" | ||
subcategory: "" | ||
description: |- | ||
Synthetics private location config, see https://www.elastic.co/guide/en/kibana/current/create-private-location-api.html for more details | ||
--- | ||
|
||
# elasticstack_kibana_synthetics_private_location (Resource) | ||
|
||
Synthetics private location config, see https://www.elastic.co/guide/en/kibana/current/create-private-location-api.html for more details | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "elasticstack" { | ||
fleet {} | ||
kibana {} | ||
} | ||
|
||
resource "elasticstack_fleet_agent_policy" "sample" { | ||
name = "Sample Agent Policy" | ||
namespace = "default" | ||
description = "A sample agent policy" | ||
monitor_logs = true | ||
monitor_metrics = true | ||
skip_destroy = false | ||
} | ||
|
||
resource "elasticstack_kibana_synthetics_private_location" "example" { | ||
label = "example label" | ||
space_id = "default" | ||
agent_policy_id = elasticstack_fleet_agent_policy.sample.policy_id | ||
tags = ["tag-a", "tag-b"] | ||
geo = { | ||
lat = 40.7128 | ||
lon = 74.0060 | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `agent_policy_id` (String) The ID of the agent policy associated with the private location. To create a private location for synthetics monitor you need to create an agent policy in fleet and use its agentPolicyId | ||
- `label` (String) A label for the private location, used as unique identifier | ||
|
||
### Optional | ||
|
||
- `geo` (Attributes) Geographic coordinates (WGS84) for the location (see [below for nested schema](#nestedatt--geo)) | ||
- `space_id` (String) An identifier for the space. If space_id is not provided, the default space is used. | ||
- `tags` (List of String) An array of tags to categorize the private location. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Generated id for the private location. For monitor setup please use private location label. | ||
|
||
<a id="nestedatt--geo"></a> | ||
### Nested Schema for `geo` | ||
|
||
Required: | ||
|
||
- `lat` (Number) The latitude of the location. | ||
- `lon` (Number) The longitude of the location. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import elasticstack_kibana_synthetics_private_location.my_location <private_location_id> | ||
``` |
1 change: 1 addition & 0 deletions
1
examples/resources/elasticstack_kibana_synthetics_private_location/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_synthetics_private_location.my_location <private_location_id> |
24 changes: 24 additions & 0 deletions
24
examples/resources/elasticstack_kibana_synthetics_private_location/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,24 @@ | ||
provider "elasticstack" { | ||
fleet {} | ||
kibana {} | ||
} | ||
|
||
resource "elasticstack_fleet_agent_policy" "sample" { | ||
name = "Sample Agent Policy" | ||
namespace = "default" | ||
description = "A sample agent policy" | ||
monitor_logs = true | ||
monitor_metrics = true | ||
skip_destroy = false | ||
} | ||
|
||
resource "elasticstack_kibana_synthetics_private_location" "example" { | ||
label = "example label" | ||
space_id = "default" | ||
agent_policy_id = elasticstack_fleet_agent_policy.sample.policy_id | ||
tags = ["tag-a", "tag-b"] | ||
geo = { | ||
lat = 40.7128 | ||
lon = 74.0060 | ||
} | ||
} |
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
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.