Skip to content

Commit cc2c13c

Browse files
author
impart-security
committed
Update terraform provider
1 parent cde1b28 commit cc2c13c

30 files changed

+4823
-55
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [0.5.0] - 2024-04-09
4+
5+
- Add impart_rule_script_dependencies resource
6+
37
## [0.4.0] - 2024-03-28
48

59
- Add impart_connector Terraform data source

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0
1+
0.5.0

docs/resources/monitor.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Manage a monitor.
1717
resource "impart_monitor" "test_event" {
1818
name = "terraform_event_monitor"
1919
description = "test event monitor"
20-
notification_template_ids = [impart_notification_template.test.id]
20+
notification_template_ids = [resource.impart_notification_template.test.id]
2121
conditions = [
2222
{
2323
threshold = 1,
@@ -38,7 +38,7 @@ resource "impart_monitor" "test_event" {
3838
resource "impart_monitor" "test_metric" {
3939
name = "terraform_event_monitor"
4040
description = "test event monitor"
41-
notification_template_ids = [impart_notification_template.test.id]
41+
notification_template_ids = [resource.impart_notification_template.test.id]
4242
conditions = [
4343
{
4444
threshold = 1,
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "impart_rule_script_dependencies Resource - impart"
4+
subcategory: ""
5+
description: |-
6+
Manage rule script dependencies. There should only ever be one instance of this resource in a workspace at once, because it manages rule script dependencies at an organization level.
7+
---
8+
9+
# impart_rule_script_dependencies (Resource)
10+
11+
Manage rule script dependencies. There should only ever be one instance of this resource in a workspace at once, because it manages rule script dependencies at an organization level.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "impart_rule_script_dependencies" "example" {
17+
dependencies = [
18+
{
19+
"rule_script_id" : resource.impart_rule_script.example_1.id,
20+
"depends_on_rule_script_ids" : [resource.impart_rule_script.example_2.id]
21+
}
22+
]
23+
}
24+
```
25+
26+
<!-- schema generated by tfplugindocs -->
27+
## Schema
28+
29+
### Required
30+
31+
- `dependencies` (Attributes List) An array of rule scripts and the other ids of the rules they depend on before executing. (see [below for nested schema](#nestedatt--dependencies))
32+
33+
<a id="nestedatt--dependencies"></a>
34+
### Nested Schema for `dependencies`
35+
36+
Required:
37+
38+
- `depends_on_rule_script_ids` (List of String) IDs of the rule script this rule depends on.
39+
- `rule_script_id` (String) The ID of the rule script

examples/provider/provider.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ resource "impart_notification_template" "test" {
4545
resource "impart_monitor" "test_event" {
4646
name = "terraform_event_monitor"
4747
description = "test event monitor"
48-
notification_template_ids = [impart_notification_template.test.id]
48+
notification_template_ids = [resource.impart_notification_template.test.id]
4949
conditions = [
5050
{
5151
threshold = 1,
@@ -65,7 +65,7 @@ resource "impart_monitor" "test_event" {
6565
resource "impart_monitor" "test_metric" {
6666
name = "terraform_event_monitor"
6767
description = "test event monitor"
68-
notification_template_ids = [impart_notification_template.test.id]
68+
notification_template_ids = [resource.impart_notification_template.test.id]
6969
conditions = [
7070
{
7171
threshold = 1,

examples/resources/impart_log_binding/resource.tf

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
resource "impart_log_binding" "example" {
33
name = "log_binding_example"
44
pattern_type = "grok"
5+
# Example patterns
6+
# for api gateway log format: $context.requestTime "$context.httpMethod $context.path $context.protocol" $context.status $context.identity.sourceIp $context.requestId
7+
# %%{HTTPDATE:timestamp} "(?:%%{WORD:http_method}|-) (?:%%{GREEDYDATA:request}|-) (?:HTTP/%%{NUMBER:httpversion}|-( )?)" (?:%%{NUMBER:response_code}|-)
8+
# for aws loadbalancer access logs
9+
# %%{TIMESTAMP_ISO8601:timestamp} %%{NOTSPACE:loadbalancer} %%{IP:client_ip}:%{NUMBER:client_port} (?:%{IP:backend_ip}:%{NUMBER:backend_port}|-) %%{NUMBER:request_processing_time} %%{NUMBER:backend_processing_time} %%{NUMBER:response_processing_time} (?:%{NUMBER:response_code}|-) (?:%{NUMBER:backend_status_code}|-) %%{NUMBER:received_bytes} %%{NUMBER:sent_bytes} "(?:%{WORD:http_method}|-) (?:%{GREEDYDATA:request}|-) (?:HTTP/%{NUMBER:http_version}|-( )?)" "%{DATA:user_agent}"( %%{NOTSPACE:ssl_cipher} %%{NOTSPACE:ssl_protocol})?
510
pattern = <<EOF
6-
%%{HTTPDATE:timestamp} "(?:%%{WORD:http_method}|-) (?:%%{GREEDYDATA:request}|-) (?:HTTP/%%{NUMBER:httpversion}|-( )?)" (?:%%{NUMBER:response_code}|-)
11+
<pattern>
712
EOF
813
logstream_id = "logstream_id"
914
spec_id = resource.impart_spec.example.id

examples/resources/impart_monitor/resource.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
resource "impart_monitor" "test_event" {
33
name = "terraform_event_monitor"
44
description = "test event monitor"
5-
notification_template_ids = [impart_notification_template.test.id]
5+
notification_template_ids = [resource.impart_notification_template.test.id]
66
conditions = [
77
{
88
threshold = 1,
@@ -23,7 +23,7 @@ resource "impart_monitor" "test_event" {
2323
resource "impart_monitor" "test_metric" {
2424
name = "terraform_event_monitor"
2525
description = "test event monitor"
26-
notification_template_ids = [impart_notification_template.test.id]
26+
notification_template_ids = [resource.impart_notification_template.test.id]
2727
conditions = [
2828
{
2929
threshold = 1,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "impart_rule_script_dependencies" "example" {
2+
dependencies = [
3+
{
4+
"rule_script_id" : resource.impart_rule_script.example_1.id,
5+
"depends_on_rule_script_ids" : [resource.impart_rule_script.example_2.id]
6+
}
7+
]
8+
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/hashicorp/terraform-plugin-go v0.22.1
99
github.com/hashicorp/terraform-plugin-log v0.9.0
1010
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
11-
golang.org/x/oauth2 v0.18.0
11+
golang.org/x/oauth2 v0.19.0
1212
)
1313

1414
require (

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
214214
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
215215
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
216216
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
217-
golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI=
218-
golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8=
217+
golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg=
218+
golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8=
219219
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
220220
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
221221
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

internal/client/api_rules_dependencies.go

+210
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)