Skip to content

Commit

Permalink
feat: add support for edge router policy resource and data source
Browse files Browse the repository at this point in the history
  • Loading branch information
nenkoru committed Jan 14, 2025
1 parent e7fc8d0 commit 29b2ef1
Show file tree
Hide file tree
Showing 13 changed files with 876 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/data-sources/edge_router_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ziti_edge_router_policy Data Source - terraform-provider-ziti"
subcategory: ""
description: |-
A datasource to define a service edge router policy of Ziti
---

# ziti_edge_router_policy (Data Source)

A datasource to define a service edge router policy of Ziti

## Example Usage

```terraform
data "ziti_edge_router_policy" "test_reference_ziti_edge_router_policy" {
most_recent = true
filter = "name contains \"test\""
}
```

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

### Optional

- `filter` (String) ZitiQl filter query
- `id` (String) Example identifier
- `most_recent` (Boolean) A flag which controls whether to get the first result from the filter query
- `name` (String) Name of a config

### Read-Only

- `edge_router_roles` (List of String) Edge router roles list.
- `identity_roles` (List of String) Service roles list.
- `semantic` (String) Semantic for posture checks of the service
- `tags` (Map of String) Tags of the service.
30 changes: 30 additions & 0 deletions docs/data-sources/edge_router_policy_ids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ziti_edge_router_policy_ids Data Source - terraform-provider-ziti"
subcategory: ""
description: |-
Ziti Intercept Config Data Source
---

# ziti_edge_router_policy_ids (Data Source)

Ziti Intercept Config Data Source

## Example Usage

```terraform
data "ziti_edge_router_policy_ids" "test_reference_ziti_edge_policy_ids" {
filter = "name contains \"test\""
}
```

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

### Required

- `filter` (String) ZitiQl filter query

### Read-Only

- `ids` (List of String) An array of allowed addresses that could be forwarded.
6 changes: 6 additions & 0 deletions docs/data-sources/service_edge_router_policy_ids.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ description: |-

Ziti Intercept Config Data Source

## Example Usage

```terraform
data "ziti_service_edge_router_policy_ids" "test_reference_ziti_service_policy_ids" {
filter = "name contains \"test\""
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
70 changes: 70 additions & 0 deletions docs/resources/edge_router_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ziti_edge_router_policy Resource - terraform-provider-ziti"
subcategory: ""
description: |-
A resource to define a host.v1 config of Ziti
---

# ziti_edge_router_policy (Resource)

A resource to define a host.v1 config of Ziti

## Example Usage

```terraform
resource "ziti_host_config_v1" "forward_protocol_host" {
name = "forward_protocol.host.v1"
address = "localhost"
port = 5432
forward_protocol = true
allowed_protocols = ["tcp", "udp"]
}
resource "ziti_service" "test_service" {
name = "test_service"
configs = [ziti_host_config_v1.forward_protocol_host.id]
}
resource "ziti_identity" "test_ziti_identity" {
name = "test_identity"
tags = {
test_value = "test"
}
app_data = {
test_app_data = "test_app_data"
}
role_attributes = ["test"]
service_hosting_costs = {
"${ziti_service.test_service.id}" = 10
}
}
resource "ziti_edge_router_policy" "test_ziti_edge_router_policy" {
name = "test_ziti_service_edge_router_policy"
semantic = "AllOf"
tags = {
test_value = "test"
}
edge_router_roles = ["#all"]
identity_roles = ["#all"]
}
```

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

### Required

- `name` (String) Name of the service

### Optional

- `edge_router_roles` (List of String) Edge Router roles list.
- `identity_roles` (List of String) Service roles list.
- `semantic` (String) Semantic for posture checks of the service
- `tags` (Map of String) Tags of the service.

### Read-Only

- `id` (String) Name of the service
4 changes: 4 additions & 0 deletions examples/data-sources/ziti_edge_router_policy/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "ziti_edge_router_policy" "test_reference_ziti_edge_router_policy" {
most_recent = true
filter = "name contains \"test\""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "ziti_edge_router_policy_ids" "test_reference_ziti_edge_policy_ids" {
filter = "name contains \"test\""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "ziti_service_edge_router_policy_ids" "test_reference_ziti_service_policy_ids" {
filter = "name contains \"test\""
}
36 changes: 36 additions & 0 deletions examples/resources/ziti_edge_router_policy/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
resource "ziti_host_config_v1" "forward_protocol_host" {
name = "forward_protocol.host.v1"
address = "localhost"
port = 5432
forward_protocol = true
allowed_protocols = ["tcp", "udp"]
}

resource "ziti_service" "test_service" {
name = "test_service"
configs = [ziti_host_config_v1.forward_protocol_host.id]
}

resource "ziti_identity" "test_ziti_identity" {
name = "test_identity"
tags = {
test_value = "test"
}
app_data = {
test_app_data = "test_app_data"
}
role_attributes = ["test"]
service_hosting_costs = {
"${ziti_service.test_service.id}" = 10
}
}

resource "ziti_edge_router_policy" "test_ziti_edge_router_policy" {
name = "test_ziti_service_edge_router_policy"
semantic = "AllOf"
tags = {
test_value = "test"
}
edge_router_roles = ["#all"]
identity_roles = ["#all"]
}
Loading

0 comments on commit 29b2ef1

Please sign in to comment.