Skip to content

Commit

Permalink
Update terraform provider
Browse files Browse the repository at this point in the history
  • Loading branch information
impart-security committed Apr 9, 2024
1 parent cde1b28 commit cc2c13c
Show file tree
Hide file tree
Showing 30 changed files with 4,823 additions and 55 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.5.0] - 2024-04-09

- Add impart_rule_script_dependencies resource

## [0.4.0] - 2024-03-28

- Add impart_connector Terraform data source
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.5.0
4 changes: 2 additions & 2 deletions docs/resources/monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Manage a monitor.
resource "impart_monitor" "test_event" {
name = "terraform_event_monitor"
description = "test event monitor"
notification_template_ids = [impart_notification_template.test.id]
notification_template_ids = [resource.impart_notification_template.test.id]
conditions = [
{
threshold = 1,
Expand All @@ -38,7 +38,7 @@ resource "impart_monitor" "test_event" {
resource "impart_monitor" "test_metric" {
name = "terraform_event_monitor"
description = "test event monitor"
notification_template_ids = [impart_notification_template.test.id]
notification_template_ids = [resource.impart_notification_template.test.id]
conditions = [
{
threshold = 1,
Expand Down
39 changes: 39 additions & 0 deletions docs/resources/rule_script_dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "impart_rule_script_dependencies Resource - impart"
subcategory: ""
description: |-
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.
---

# impart_rule_script_dependencies (Resource)

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.

## Example Usage

```terraform
resource "impart_rule_script_dependencies" "example" {
dependencies = [
{
"rule_script_id" : resource.impart_rule_script.example_1.id,
"depends_on_rule_script_ids" : [resource.impart_rule_script.example_2.id]
}
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `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))

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

Required:

- `depends_on_rule_script_ids` (List of String) IDs of the rule script this rule depends on.
- `rule_script_id` (String) The ID of the rule script
4 changes: 2 additions & 2 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ resource "impart_notification_template" "test" {
resource "impart_monitor" "test_event" {
name = "terraform_event_monitor"
description = "test event monitor"
notification_template_ids = [impart_notification_template.test.id]
notification_template_ids = [resource.impart_notification_template.test.id]
conditions = [
{
threshold = 1,
Expand All @@ -65,7 +65,7 @@ resource "impart_monitor" "test_event" {
resource "impart_monitor" "test_metric" {
name = "terraform_event_monitor"
description = "test event monitor"
notification_template_ids = [impart_notification_template.test.id]
notification_template_ids = [resource.impart_notification_template.test.id]
conditions = [
{
threshold = 1,
Expand Down
7 changes: 6 additions & 1 deletion examples/resources/impart_log_binding/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
resource "impart_log_binding" "example" {
name = "log_binding_example"
pattern_type = "grok"
# Example patterns
# for api gateway log format: $context.requestTime "$context.httpMethod $context.path $context.protocol" $context.status $context.identity.sourceIp $context.requestId
# %%{HTTPDATE:timestamp} "(?:%%{WORD:http_method}|-) (?:%%{GREEDYDATA:request}|-) (?:HTTP/%%{NUMBER:httpversion}|-( )?)" (?:%%{NUMBER:response_code}|-)
# for aws loadbalancer access logs
# %%{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})?
pattern = <<EOF
%%{HTTPDATE:timestamp} "(?:%%{WORD:http_method}|-) (?:%%{GREEDYDATA:request}|-) (?:HTTP/%%{NUMBER:httpversion}|-( )?)" (?:%%{NUMBER:response_code}|-)
<pattern>
EOF
logstream_id = "logstream_id"
spec_id = resource.impart_spec.example.id
Expand Down
4 changes: 2 additions & 2 deletions examples/resources/impart_monitor/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resource "impart_monitor" "test_event" {
name = "terraform_event_monitor"
description = "test event monitor"
notification_template_ids = [impart_notification_template.test.id]
notification_template_ids = [resource.impart_notification_template.test.id]
conditions = [
{
threshold = 1,
Expand All @@ -23,7 +23,7 @@ resource "impart_monitor" "test_event" {
resource "impart_monitor" "test_metric" {
name = "terraform_event_monitor"
description = "test event monitor"
notification_template_ids = [impart_notification_template.test.id]
notification_template_ids = [resource.impart_notification_template.test.id]
conditions = [
{
threshold = 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "impart_rule_script_dependencies" "example" {
dependencies = [
{
"rule_script_id" : resource.impart_rule_script.example_1.id,
"depends_on_rule_script_ids" : [resource.impart_rule_script.example_2.id]
}
]
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/hashicorp/terraform-plugin-go v0.22.1
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
golang.org/x/oauth2 v0.18.0
golang.org/x/oauth2 v0.19.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI=
golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8=
golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg=
golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
210 changes: 210 additions & 0 deletions internal/client/api_rules_dependencies.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cc2c13c

Please sign in to comment.