Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
docs: add missing schema descriptions
Browse files Browse the repository at this point in the history
closes #3
  • Loading branch information
Toalaah committed Oct 16, 2023
1 parent 1670bf6 commit f42ea24
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 24 deletions.
24 changes: 17 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "routeros-firewall-list Provider"
subcategory: ""
description: |-
A provider for declaratively managing firewall lists on RouterOS devices.
---

# routeros-firewall-list Provider


A provider for declaratively managing firewall lists on RouterOS devices.

## Example Usage

Expand All @@ -28,15 +28,25 @@ provider "routeros-firewall-list" {
ca_certificate = "./ca.pem" # env fallback: ROS_CA_CERTIFICATE
insecure = false # env fallback: ROS_INSECURE
}
resource "routeros-firewall-list_rule_ordering" "rules" {
rule_type = "filter"
rules = [
"*A",
"*B",
"*C",
"*9",
]
}
```

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

### Optional

- `ca_certificate` (String) Example provider attribute
- `hosturl` (String) Example provider attribute
- `insecure` (Boolean) Example provider attribute
- `password` (String, Sensitive) Example provider attribute
- `username` (String) Example provider attribute
- `ca_certificate` (String) Path to the CA root certificate
- `hosturl` (String) Address of the host device. Do not specify the protocol or port, these are hard-coded to 'https' and '443' respectively
- `insecure` (Boolean) Whether to skip verifying the SSL certificate used by the API service
- `password` (String, Sensitive) Password to use for API authentication
- `username` (String) Username to use for API authentication
23 changes: 22 additions & 1 deletion docs/resources/rule_ordering.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ description: |-

Firewall rule ordering


## Example Usage

```terraform
# Enforces specified order for firewall rules in "filter" category
resource "routeros-firewall-list_rule_ordering" "rules" {
rule_type = "filter"
rules = [
"*A",
"*B",
"*C",
"*9",
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -23,3 +36,11 @@ Firewall rule ordering
### Read-Only

- `id` (String) Identifier of resource

## Import

Import is supported using the following syntax:

```shell
# This resource is not importable :(
```
10 changes: 10 additions & 0 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ provider "routeros-firewall-list" {
ca_certificate = "./ca.pem" # env fallback: ROS_CA_CERTIFICATE
insecure = false # env fallback: ROS_INSECURE
}

resource "routeros-firewall-list_rule_ordering" "rules" {
rule_type = "filter"
rules = [
"*A",
"*B",
"*C",
"*9",
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This resource is not importable
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enforces specified order for firewall rules in "filter" category
resource "routeros-firewall-list_rule_ordering" "this" {
resource "routeros-firewall-list_rule_ordering" "rules" {
rule_type = "filter"
rules = [
"*A",
Expand Down
22 changes: 12 additions & 10 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,34 @@ func (p *RouterosFWFLProvider) Metadata(ctx context.Context, req provider.Metada

func (p *RouterosFWFLProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "A provider for declaratively managing firewall lists on RouterOS devices",
MarkdownDescription: "A provider for declaratively managing firewall lists on RouterOS devices.",
Attributes: map[string]schema.Attribute{
"hosturl": schema.StringAttribute{
MarkdownDescription: "Example provider attribute",
Optional: true,
Description: "TODO",
Description: "Address of the host device. Do not specify the protocol or port, these are hard-coded to 'https' and '443' respectively",
MarkdownDescription: "Address of the host device. Do not specify the protocol or port, these are hard-coded to 'https' and '443' respectively",
},
"username": schema.StringAttribute{
MarkdownDescription: "Example provider attribute",
Optional: true,
Description: "TODO",
Description: "Username to use for API authentication",
MarkdownDescription: "Username to use for API authentication",
},
"password": schema.StringAttribute{
MarkdownDescription: "Example provider attribute",
Optional: true,
Sensitive: true,
Description: "TODO",
Description: "Password to use for API authentication",
MarkdownDescription: "Password to use for API authentication",
},
"ca_certificate": schema.StringAttribute{
MarkdownDescription: "Example provider attribute",
Optional: true,
Description: "TODO",
MarkdownDescription: "Path to the CA root certificate",
Description: "Path to the CA root certificate",
},
"insecure": schema.BoolAttribute{
MarkdownDescription: "Example provider attribute",
Optional: true,
Description: "TODO",
Description: "Whether to skip verifying the SSL certificate used by the API service",
MarkdownDescription: "Whether to skip verifying the SSL certificate used by the API service",
},
},
}
Expand Down
8 changes: 4 additions & 4 deletions internal/provider/resource_rule_ordering.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ func (r *FirewallRuleOrderingResource) Configure(ctx context.Context, req resour
func (r *FirewallRuleOrderingResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "Firewall rule ordering",
Description: "TODO",
Description: "Firewall rule ordering",
Attributes: map[string]schema.Attribute{
"rule_type": schema.StringAttribute{
MarkdownDescription: "The rule type to apply ordering to",
Description: "TODO",
Description: "The rule type to apply ordering to",
Required: true,
Validators: []validator.String{
stringvalidator.OneOf("filter", "nat", "mangle", "raw"),
Expand All @@ -90,12 +90,12 @@ func (r *FirewallRuleOrderingResource) Schema(ctx context.Context, req resource.
"rules": schema.ListAttribute{
ElementType: types.StringType,
MarkdownDescription: "List of rules arranged in their desired order",
Description: "TODO",
Description: "List of rules arranged in their desired order",
Required: true,
},
"id": schema.StringAttribute{
Computed: true,
Description: "TODO",
Description: "Identifier of resource",
MarkdownDescription: "Identifier of resource",
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func main() {
flag.Parse()

opts := providerserver.ServeOpts{
// TODO: Update this string with the published name of your provider.
Address: "registry.terraform.io/toalaah/terraform-provider-routeros-firewall-list",
Debug: debug,
}
Expand Down

0 comments on commit f42ea24

Please sign in to comment.