-
Notifications
You must be signed in to change notification settings - Fork 139
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
feat(fastly_alert): implement resource and documentation #810
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7bea591
feat(fastly_alerts): implement resource and documentation
darin-nee 798617c
feat(fastly_alerts): fix docs
darin-nee 5306e92
feat(fastly_alert): align descriptions with API docs, add to interfac…
darin-nee 0121082
feat(fastly_alert): remove from tests/interface since fastly_alert un…
darin-nee 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 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,77 @@ | ||
--- | ||
layout: "fastly" | ||
page_title: "Fastly: alert" | ||
sidebar_current: "docs-fastly-resource-alert" | ||
description: |- | ||
Provides a Fastly Alert. Alerts send notifications to custom integrations (e.g., Slack channels, PagerDuty, Microsoft Teams and New Relic) when an observed metric either exceeds or falls below a threshold. | ||
--- | ||
|
||
# fastly_alert | ||
|
||
Provides a Fastly Alert. Alerts send notifications to custom integrations (e.g., Slack channels, PagerDuty, Microsoft Teams and New Relic) when an observed metric either exceeds or falls below a threshold. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "fastly_service_vcl" "example" { | ||
name = "my_vcl_service" | ||
|
||
domain { | ||
name = "demo.example.com" | ||
} | ||
|
||
force_destroy = true | ||
} | ||
|
||
resource "fastly_alert" "example" { | ||
name = "my_vcl_service error rate" | ||
service_id = fastly_service_vcl.example.id | ||
source = "stats" | ||
metric = "status_5xx_rate" | ||
|
||
evaluation_strategy { | ||
type = "above_threshold" | ||
period = "5m" | ||
threshold = 0.1 | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `evaluation_strategy` (Block List, Min: 1, Max: 1) Evaluation strategy for the Alert. (see [below for nested schema](#nestedblock--evaluation_strategy)) | ||
- `metric` (String) The name of the metric to monitor for Alert evaluation. For detailed information on metrics available for monitoring, see [Fastly Alerts API Documentation](https://developer.fastly.com/reference/api/observability/alerts/definition/). | ||
- `name` (String) Summary text of the Alert. | ||
- `service_id` (String) ID of the Fastly Service that the Alert monitors. | ||
- `source` (String) The metric source. One of: `stats`, `origins`, `domains`. | ||
|
||
### Optional | ||
|
||
- `description` (String) Text body included in Alert notifications. | ||
- `dimensions` (Block List, Max: 1) Dimension filters applied to the metric. (see [below for nested schema](#nestedblock--dimensions)) | ||
- `integration_ids` (Set of String) Set of IDs of integrations that Alert notifications will be sent to. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedblock--evaluation_strategy"></a> | ||
### Nested Schema for `evaluation_strategy` | ||
|
||
Required: | ||
|
||
- `period` (String) The length of time to evaluate whether the conditions have been met. The data is polled every minute. One of: `5m`, `15m`, `30m`. | ||
- `threshold` (Number) Threshold used to trigger. | ||
- `type` (String) Type of strategy to use to evaluate. One of: `above_threshold`, `below_threshold`. | ||
|
||
|
||
<a id="nestedblock--dimensions"></a> | ||
### Nested Schema for `dimensions` | ||
|
||
Optional: | ||
|
||
- `domains` (Set of String) Names of a subset of domains defined on the service that the Alert monitors. | ||
- `origins` (Set of String) Addresses of a subset of backends defined on the service that the Alert monitors. |
This file contains 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,15 @@ | ||
resource "fastly_service_vcl" "myservice" { | ||
#... | ||
} | ||
|
||
resource "fastly_alert" "demo" { | ||
name = "myservice error rate" | ||
service_id = fastly_service_vcl.myservice.id | ||
source = "stats" | ||
metric = "status_5xx_rate" | ||
evaluation_strategy { | ||
type = "above_threshold" | ||
period = "5m" | ||
threshold = 0.1 | ||
} | ||
} |
This file contains 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darin-nee There is also
object
= "definition" that is returned in the response, also read-onlyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's in the API response and elided in the Terraform schema.