-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from dheeruk12/main
What's new in this release: 1.Added GlobalEventRouter, GlobalEventRoutingRules 2.Added Custom Roles 3.Updated zenduty-go-sdk v0.1.7 4.Code refactor for improved maintainability.
- Loading branch information
Showing
43 changed files
with
1,522 additions
and
770 deletions.
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,76 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "Zenduty: CustomRole" | ||
subcategory: "" | ||
description: |- | ||
Provides a Zenduty CustomRole Resource. This allows CustomRole(rbac) to be created, updated, deleted. | ||
--- | ||
|
||
# Resource : zenduty_account_role | ||
|
||
Provides a Zenduty CustomRole Resource. This allows CustomRole(rbac) to be created, updated, deleted. | ||
|
||
|
||
## Example Usage | ||
```hcl | ||
resource "zenduty_account_role" "sre" { | ||
description = "view all incidents in account" | ||
name = "sre" | ||
permissions = [ | ||
"incident_read", | ||
] | ||
} | ||
``` | ||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Argument Reference | ||
|
||
* `name` (Required) - Name of the CustomRoke | ||
* `description` (Required) - | ||
* `permissions` (Required) - List of permissions this role is granted | ||
|
||
### Permissions | ||
|
||
Please refer to the following link for detailed documentation https://docs.zenduty.com/rbac | ||
|
||
- "analytics_read", | ||
- "escalation_policy_read", | ||
- "escalation_policy_write", | ||
- "incident_read", | ||
- "incident_write", | ||
- "incident_role_read", | ||
- "incident_role_write", | ||
- "integration_read", | ||
- "integration_write", | ||
- "maintenance_read", | ||
- "maintenance_write", | ||
- "member_read", | ||
- "member_write", | ||
- "postmortem_read", | ||
- "postmortem_write", | ||
- "priority_read", | ||
- "priority_write", | ||
- "schedule_read", | ||
- "schedule_write", | ||
- "service_read", | ||
- "service_write", | ||
- "sla_read", | ||
- "sla_write", | ||
- "stakeholder_template_read", | ||
- "stakeholder_template_write", | ||
- "tag_read", | ||
- "tag_write", | ||
- "task_template_read", | ||
- "task_template_write", | ||
- "team_read", | ||
|
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The UniqueID of the Zenduty Account Role. | ||
|
||
|
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
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,42 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "Zenduty: AssignAccountRole" | ||
subcategory: "" | ||
description: |- | ||
Provides a Zenduty AssignAccountRole Resource. This allows you to assign role to user | ||
--- | ||
|
||
# Resource : zenduty_assign_account_role | ||
|
||
This Resource allows you to assign a custom role to user | ||
|
||
--- | ||
|
||
## Example Usage | ||
```hcl | ||
resource "zenduty_account_role" "sre" { | ||
description = "view all incidents in account" | ||
name = "sre" | ||
permissions = [ | ||
"incident_read", | ||
] | ||
} | ||
data "zenduty_user" "user1" { | ||
email = "[email protected]" | ||
} | ||
resource "zenduty_assign_account_role" "demouser" { | ||
username = data.zenduty_user.user1.users[0].username | ||
account_role = zenduty_account_role.sre.id | ||
} | ||
``` | ||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Argument Reference | ||
|
||
* `username` (Required) - Username of the User | ||
* `account_role`(Required) - UniqueID of the AccountRole |
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,58 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "Zenduty: GlobalRouter" | ||
subcategory: "" | ||
description: |- | ||
Provides a Zenduty GlobalRouter Resource. This allows you to users to create a Router.which allows you to route alerts based on the rules | ||
--- | ||
|
||
# Resource : zenduty_globalrouter | ||
|
||
An Global Router allows users to create a Router. The Router evaluates events sent to this Router against each of its rules, one at a time, and routes the event to a specific Integration based on the first rule that matches. | ||
|
||
--- | ||
|
||
## Example Usage | ||
```hcl | ||
resource "zenduty_globalrouter" "router" { | ||
name = "demorouter" | ||
description = "This is a demo router" | ||
} | ||
``` | ||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Argument Reference | ||
|
||
* `name` (Required) - Name of the Router | ||
* `description`(Required) - Description of the Router | ||
* `is_optional` (Optional) - Enable or Disable the router | ||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The ID of the GlobalRouter. | ||
* `integration_key` - The integration key of the GlobalRouter. | ||
|
||
|
||
## Import | ||
|
||
GlobalRouter can be imported using the `router_id`(ie. UniqueID of the router), e.g. | ||
|
||
```hcl | ||
resource "zenduty_globalrouter" "router" { | ||
} | ||
``` | ||
|
||
`$ terraform import zenduty_globalrouter.router router_id` | ||
|
||
`$ terraform state show zenduty_globalrouter.router` | ||
|
||
`copy the output data and paste inside zenduty_globalrouter.router resource block and remove the id,integration_key attribute` | ||
|
||
`$ terraform plan` to verify the import |
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,76 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "Zenduty: GlobalRoutingRule" | ||
subcategory: "" | ||
description: |- | ||
Provides a Zenduty GlobalRoutingRule Resource. This allows you to users to create routing rules.which allows you to route alerts based on the rules | ||
--- | ||
|
||
# Resource : zenduty_globalrouting_rule | ||
|
||
An Global Router allows users to create routing rules. The Router evaluates events sent to this Router against each of its rules, one at a time, and routes the event to a specific Integration based on the first rule that matches. | ||
|
||
--- | ||
|
||
## Example Usage | ||
```hcl | ||
resource "zenduty_globalrouter" "router" { | ||
name = "demorouter" | ||
description = "This is a demo router" | ||
} | ||
resource "zenduty_globalrouting_rule" "demorules" { | ||
router_id = zenduty_globalrouter.router.id | ||
name = "demorule" | ||
rule_json = "" | ||
actions { | ||
action_type = 0 | ||
integration = "unique_id of integration" | ||
} | ||
} | ||
resource "zenduty_globalrouting_rule" "supressrule" { | ||
router_id = zenduty_globalrouter.router.id | ||
name = "supress" | ||
rule_json = "" | ||
actions { | ||
action_type = 1 | ||
} | ||
} | ||
``` | ||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Argument Reference | ||
|
||
* `name` (Required) - Name of the Routing Rule | ||
* `router_id` - UniqueID of the GlobalRouter | ||
* `rule_json` (Required)(string) - The rule json of the routing rule.You cannot construct the rule json in terraform as of now.One can construct the rule json in Zenduty's UI.Create an dummy alert rule in Zenduty and copy the rule_json from the UI. | ||
* `actions` (Optional) - The actions to be performed when the rule matches.values are `0` route to integration `1` supress the alert | ||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The ID of the GlobalRouterRule. | ||
|
||
|
||
## Import | ||
|
||
GlobalRouterRule can be imported using the `router_id/rule_id`(ie. UniqueID of the router,rule), e.g. | ||
|
||
```hcl | ||
resource "zenduty_globalrouting_rule" "rule1" { | ||
} | ||
``` | ||
|
||
`$ terraform import zenduty_globalrouting_rule.rule1 router_id/rule_id` | ||
|
||
`$ terraform state show zenduty_globalrouting_rule.rule1` | ||
|
||
`copy the output data and paste inside zenduty_globalrouting_rule.rule1 resource block and remove the id attribute` | ||
|
||
`$ terraform plan` to verify the import |
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.