-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ACL Support to the Terraform Provider #64
Changes from 4 commits
8c28868
54af888
a796748
2a9ced4
73023ee
312c902
9234f4a
4516e51
8434075
42d79ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "bloxone_dns_acls Data Source - terraform-provider-bloxone" | ||
subcategory: "DNS" | ||
description: |- | ||
Retrieves information about existing Authoritative DNS ACLs. | ||
--- | ||
|
||
# bloxone_dns_acls (Data Source) | ||
|
||
Retrieves information about existing Authoritative DNS ACLs. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
# Get DNS ACLs filtered by an attribute | ||
data "bloxone_dns_acls" "example_by_attribute" { | ||
filters = { | ||
"name" = "example_acl" | ||
} | ||
} | ||
|
||
# Get DNS ACLs filtered by tag | ||
data "bloxone_dns_acls" "example_by_tag" { | ||
tag_filters = { | ||
site = "Site A" | ||
} | ||
} | ||
|
||
# Get all DNS ACLs | ||
data "bloxone_dns_acls" "example_all" { | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `filters` (Map of String) Filter are used to return a more specific list of results. Filters can be used to match resources by specific attributes, e.g. name. If you specify multiple filters, the results returned will have only resources that match all the specified filters. | ||
- `tag_filters` (Map of String) Tag Filters are used to return a more specific list of results filtered by tags. If you specify multiple filters, the results returned will have only resources that match all the specified filters. | ||
|
||
### Read-Only | ||
|
||
- `results` (Attributes List) (see [below for nested schema](#nestedatt--results)) | ||
|
||
<a id="nestedatt--results"></a> | ||
### Nested Schema for `results` | ||
|
||
Required: | ||
|
||
- `name` (String) ACL object name. | ||
|
||
Optional: | ||
|
||
- `comment` (String) Optional. Comment for ACL. | ||
- `list` (Attributes List) Optional. Ordered list of access control elements. Elements are evaluated in order to determine access. If evaluation reaches the end of the list then access is denied. (see [below for nested schema](#nestedatt--results--list)) | ||
- `tags` (Map of String) Tagging specifics. | ||
|
||
Read-Only: | ||
|
||
- `id` (String) The resource identifier. | ||
|
||
<a id="nestedatt--results--list"></a> | ||
### Nested Schema for `results.list` | ||
|
||
Required: | ||
|
||
- `element` (String) Type of element. | ||
|
||
Allowed values: | ||
* _any_ | ||
* _ip_ | ||
* _acl_ | ||
* _tsig_key_ | ||
|
||
Optional: | ||
|
||
- `access` (String) Access permission for _element_. | ||
|
||
Allowed values: | ||
* _allow_ | ||
* _deny_ | ||
|
||
Must be empty if _element_ is _acl_. | ||
- `acl` (String) The resource identifier. | ||
- `address` (String) Optional. Data for _ip_ _element_. Must be empty if _element_ is not _ip_. | ||
- `tsig_key` (Attributes) (see [below for nested schema](#nestedatt--results--list--tsig_key)) | ||
|
||
<a id="nestedatt--results--list--tsig_key"></a> | ||
### Nested Schema for `results.list.tsig_key` | ||
|
||
Required: | ||
|
||
- `key` (String) The resource identifier. | ||
|
||
Read-Only: | ||
|
||
- `algorithm` (String) TSIG key algorithm. | ||
|
||
Possible values: | ||
* _hmac_sha256_ | ||
* _hmac_sha1_ | ||
* _hmac_sha224_ | ||
* _hmac_sha384_ | ||
* _hmac_sha512_ | ||
- `comment` (String) Comment for TSIG key. | ||
- `name` (String) TSIG key name, FQDN. | ||
- `protocol_name` (String) TSIG key name in punycode. | ||
- `secret` (String, Sensitive) TSIG key secret, base64 string. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,120 @@ | ||||||
--- | ||||||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||||||
page_title: "bloxone_dns_acl Resource - terraform-provider-bloxone" | ||||||
subcategory: "DNS" | ||||||
description: |- | ||||||
Manages an Access Control List (ACL). | ||||||
--- | ||||||
|
||||||
# bloxone_dns_acl (Resource) | ||||||
|
||||||
Manages an Access Control List (ACL). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed |
||||||
|
||||||
## Example Usage | ||||||
|
||||||
```terraform | ||||||
resource "bloxone_keys_tsig" "test" { | ||||||
name = "test-tsig." | ||||||
} | ||||||
|
||||||
resource "bloxone_dns_acl" "test_acl" { | ||||||
name = "test-acl" | ||||||
} | ||||||
|
||||||
resource "bloxone_dns_acl" "example_acl" { | ||||||
name = "example_dns_acl" | ||||||
|
||||||
# Other Optional fields | ||||||
comment = "An example acl" | ||||||
tags = { | ||||||
site = "Site A" | ||||||
} | ||||||
list = [ | ||||||
{ | ||||||
access = "allow" | ||||||
element = "ip" | ||||||
address = "192.168.1.1" | ||||||
}, | ||||||
{ | ||||||
access = "deny" | ||||||
element = "any" | ||||||
}, | ||||||
{ | ||||||
element = "acl" | ||||||
acl = bloxone_dns_acl.test_acl.id | ||||||
}, | ||||||
{ | ||||||
element = "tsig_key" | ||||||
access = "deny" | ||||||
tsig_key = { | ||||||
key = bloxone_keys_tsig.test.id | ||||||
} | ||||||
} | ||||||
] | ||||||
} | ||||||
``` | ||||||
|
||||||
<!-- schema generated by tfplugindocs --> | ||||||
## Schema | ||||||
|
||||||
### Required | ||||||
|
||||||
- `name` (String) ACL object name. | ||||||
|
||||||
### Optional | ||||||
|
||||||
- `comment` (String) Optional. Comment for ACL. | ||||||
- `list` (Attributes List) Optional. Ordered list of access control elements. Elements are evaluated in order to determine access. If evaluation reaches the end of the list then access is denied. (see [below for nested schema](#nestedatt--list)) | ||||||
- `tags` (Map of String) Tagging specifics. | ||||||
|
||||||
### Read-Only | ||||||
|
||||||
- `id` (String) The resource identifier. | ||||||
|
||||||
<a id="nestedatt--list"></a> | ||||||
### Nested Schema for `list` | ||||||
|
||||||
Required: | ||||||
|
||||||
- `element` (String) Type of element. | ||||||
|
||||||
Allowed values: | ||||||
* _any_ | ||||||
* _ip_ | ||||||
* _acl_ | ||||||
* _tsig_key_ | ||||||
|
||||||
Optional: | ||||||
|
||||||
- `access` (String) Access permission for _element_. | ||||||
|
||||||
Allowed values: | ||||||
* _allow_ | ||||||
* _deny_ | ||||||
|
||||||
Must be empty if _element_ is _acl_. | ||||||
- `acl` (String) The resource identifier. | ||||||
- `address` (String) Optional. Data for _ip_ _element_. Must be empty if _element_ is not _ip_. | ||||||
- `tsig_key` (Attributes) (see [below for nested schema](#nestedatt--list--tsig_key)) | ||||||
|
||||||
<a id="nestedatt--list--tsig_key"></a> | ||||||
### Nested Schema for `list.tsig_key` | ||||||
|
||||||
Required: | ||||||
|
||||||
- `key` (String) The resource identifier. | ||||||
|
||||||
Read-Only: | ||||||
|
||||||
- `algorithm` (String) TSIG key algorithm. | ||||||
|
||||||
Possible values: | ||||||
* _hmac_sha256_ | ||||||
* _hmac_sha1_ | ||||||
* _hmac_sha224_ | ||||||
* _hmac_sha384_ | ||||||
* _hmac_sha512_ | ||||||
- `comment` (String) Comment for TSIG key. | ||||||
- `name` (String) TSIG key name, FQDN. | ||||||
- `protocol_name` (String) TSIG key name in punycode. | ||||||
- `secret` (String, Sensitive) TSIG key secret, base64 string. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,6 +13,14 @@ Manages an authoritative zone. | |||||
## Example Usage | ||||||
|
||||||
```terraform | ||||||
resource "bloxone_keys_tsig" "test" { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't use "test" as name in the examples There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed |
||||||
name = "test-tsig." | ||||||
} | ||||||
|
||||||
resource "bloxone_dns_acl" "test" { | ||||||
name = "test-acl" | ||||||
} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even though an empty ACL is possible, it is not useful. For our examples, it would be better to have an ACL with basic list, where the transfer_acl can follow the following order deny any There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that you have removed the nested acl altogether. Sorry if I was not clear in my comments. We do want the nested ACL as well, but not a nested ACL that is empty. So the whole resource should look something like this
|
||||||
|
||||||
resource "bloxone_dns_auth_zone" "example" { | ||||||
fqdn = "example.com." | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we should set standards for naming in the tf files. Maybe we can talk about this offline and come up with a standard. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||||||
primary_type = "cloud" | ||||||
|
@@ -31,6 +39,17 @@ resource "bloxone_dns_auth_zone" "example" { | |||||
{ | ||||||
access = "deny" | ||||||
element = "any" | ||||||
}, | ||||||
{ | ||||||
element = "acl" | ||||||
acl = bloxone_dns_acl.test.id | ||||||
}, | ||||||
{ | ||||||
element = "tsig_key" | ||||||
access = "deny" | ||||||
tsig_key = { | ||||||
key = bloxone_keys_tsig.test.id | ||||||
} | ||||||
} | ||||||
] | ||||||
update_acl = [ | ||||||
|
@@ -42,6 +61,17 @@ resource "bloxone_dns_auth_zone" "example" { | |||||
{ | ||||||
access = "deny" | ||||||
element = "any" | ||||||
}, | ||||||
{ | ||||||
element = "acl" | ||||||
acl = bloxone_dns_acl.test.id | ||||||
}, | ||||||
{ | ||||||
element = "tsig_key" | ||||||
access = "deny" | ||||||
tsig_key = { | ||||||
key = bloxone_keys_tsig.test.id | ||||||
} | ||||||
} | ||||||
] | ||||||
query_acl = [ | ||||||
|
@@ -53,6 +83,17 @@ resource "bloxone_dns_auth_zone" "example" { | |||||
{ | ||||||
access = "deny" | ||||||
element = "any" | ||||||
}, | ||||||
{ | ||||||
element = "acl" | ||||||
acl = bloxone_dns_acl.test.id | ||||||
}, | ||||||
{ | ||||||
element = "tsig_key" | ||||||
access = "deny" | ||||||
tsig_key = { | ||||||
key = bloxone_keys_tsig.test.id | ||||||
} | ||||||
} | ||||||
] | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Get DNS ACLs filtered by an attribute | ||
data "bloxone_dns_acls" "example_by_attribute" { | ||
filters = { | ||
"name" = "example_acl" | ||
} | ||
} | ||
|
||
# Get DNS ACLs filtered by tag | ||
data "bloxone_dns_acls" "example_by_tag" { | ||
tag_filters = { | ||
site = "Site A" | ||
} | ||
} | ||
|
||
# Get all DNS ACLs | ||
data "bloxone_dns_acls" "example_all" { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
resource "bloxone_keys_tsig" "test" { | ||
name = "test-tsig." | ||
} | ||
|
||
resource "bloxone_dns_acl" "test_acl" { | ||
name = "test-acl" | ||
} | ||
|
||
resource "bloxone_dns_acl" "example_acl" { | ||
name = "example_dns_acl" | ||
|
||
# Other Optional fields | ||
comment = "An example acl" | ||
tags = { | ||
site = "Site A" | ||
} | ||
list = [ | ||
{ | ||
access = "allow" | ||
element = "ip" | ||
address = "192.168.1.1" | ||
}, | ||
{ | ||
access = "deny" | ||
element = "any" | ||
}, | ||
{ | ||
element = "acl" | ||
acl = bloxone_dns_acl.test_acl.id | ||
}, | ||
{ | ||
element = "tsig_key" | ||
access = "deny" | ||
tsig_key = { | ||
key = bloxone_keys_tsig.test.id | ||
} | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, my comment vanished. @mathewab Please add the suggested change in the corresponding service file. Would make it easier for the addressee. Just a thought :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure :) Will keep that in mind next time .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed