-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Anycast host resource implementation (#95)
* datasource and resource for anycast * fixed PR checks * Ran go mod commands * Regenerated go.sum * added onprem host resource * basic UT working * basic UT working * fixed UTs * resolved new naming conventions from master and added examples * renamed resource files * fixed linter issue check * addressed PR comments * fixed linter issue * fixed host dependency in UT's --------- Co-authored-by: Ashish Mathew <[email protected]>
- Loading branch information
1 parent
7afd272
commit 1b3471f
Showing
22 changed files
with
1,081 additions
and
313 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
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,217 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "bloxone_anycast_host Resource - terraform-provider-bloxone" | ||
subcategory: "Anycast" | ||
description: |- | ||
Retrieve an Anycast host Configurations. | ||
--- | ||
|
||
# bloxone_anycast_host (Resource) | ||
|
||
Retrieve an Anycast host Configurations. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "bloxone_infra_hosts" "anycast_hosts" { | ||
filters = { | ||
display_name = "my-host" | ||
} | ||
} | ||
# Create an anycast config profile with onprem hosts | ||
resource "bloxone_anycast_config" "example" { | ||
anycast_ip_address = "10.10.10.1" | ||
name = "Anycast_config_example" | ||
service = "DNS" | ||
} | ||
# Adding an anycast host with BGP routing protocol | ||
resource "bloxone_anycast_host" "example" { | ||
id = one(data.bloxone_infra_hosts.anycast_hosts.results).legacy_id | ||
# Adding the anycast config profile and enabling BGP routing protocol | ||
anycast_config_refs = [ | ||
{ | ||
anycast_config_name = bloxone_anycast_config.test_onprem_hosts.name | ||
routing_protocols = ["BGP", "OSPF"] | ||
} | ||
] | ||
# Adding the BGP configuration | ||
config_bgp = { | ||
asn = "6500" | ||
asn_text = "6500" | ||
holddown_secs = 180 | ||
neighbors = [ | ||
{ | ||
asn = "6501" | ||
ip_address = "10.20.0.3" | ||
} | ||
] | ||
} | ||
# Adding the OSPF configuration | ||
config_ospf = { | ||
area_type = "STANDARD" | ||
area = "10.0.0.1" | ||
authentication_type = "Clear" | ||
interface = "eth0" | ||
authentication_key = "YXV0aGV" | ||
hello_interval = 10 | ||
dead_interval = 40 | ||
retransmit_interval = 5 | ||
transmit_delay = 1 | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `id` (Number) Numeric host identifier. | ||
|
||
### Optional | ||
|
||
- `anycast_config_refs` (Attributes List) Array of AnycastConfigRef structures, identifying the anycast configurations that this host is a member of. (see [below for nested schema](#nestedatt--anycast_config_refs)) | ||
- `config_bgp` (Attributes) Struct BGP configuration; defines BGP configuration for one anycast-enabled on-prem host. (see [below for nested schema](#nestedatt--config_bgp)) | ||
- `config_ospf` (Attributes) Struct OSPF configuration; defines OSPF configuration for one anycast-enabled on-prem host. (see [below for nested schema](#nestedatt--config_ospf)) | ||
- `config_ospfv3` (Attributes) Struct OSPFv3 configuration; defines OSPFv3 configuration for one anycast-enabled on-prem host. (see [below for nested schema](#nestedatt--config_ospfv3)) | ||
|
||
### Read-Only | ||
|
||
- `created_at` (String) Date/time this host was created in anycast service database. | ||
- `ip_address` (String) IPv4 address of the on-prem host | ||
- `ipv6_address` (String) IPv6 address of the on-prem host | ||
- `name` (String) User-friendly name of the host @example "dns-host-1", "Central Office Server". | ||
- `updated_at` (String) Date/time this host was last updated in anycast service database. | ||
|
||
<a id="nestedatt--anycast_config_refs"></a> | ||
### Nested Schema for `anycast_config_refs` | ||
|
||
Required: | ||
|
||
- `anycast_config_name` (String) | ||
|
||
Optional: | ||
|
||
- `routing_protocols` (List of String) Routing protocols enabled for this anycast configuration, on a particular host. Valid protocol names are "BGP", "OSPF"/"OSPFv2", "OSPFv3". | ||
|
||
|
||
<a id="nestedatt--config_bgp"></a> | ||
### Nested Schema for `config_bgp` | ||
|
||
Required: | ||
|
||
- `asn` (Number) Autonomous system number of this BGP/anycast enabled on-prem host. | ||
- `holddown_secs` (Number) BGP route hold-down timer. | ||
|
||
Optional: | ||
|
||
- `fields` (Attributes) Represents a set of symbolic field paths. (see [below for nested schema](#nestedatt--config_bgp--fields)) | ||
- `keep_alive_secs` (Number) BGP keep-alive timer. | ||
- `link_detect` (Boolean) Enable/disable link detection. | ||
- `neighbors` (Attributes List) List of BgpNeighbor structs. (see [below for nested schema](#nestedatt--config_bgp--neighbors)) | ||
- `preamble` (String) Any predefined BGP configuration, with embedded new lines; the preamble will be prepended to the generated BGP configuration. | ||
|
||
Read-Only: | ||
|
||
- `asn_text` (String) Autonomous system as text (supported in ASDOT or ASPLAIN format) Optional, requires the asn field to be set to the equivalent integer value of the ASDOT/ASPLAIN string contained in this field or be unset/zero. | ||
Example: | ||
|
||
| ASDOT | ASPLAIN | INTEGER | VALID/INVALID | | ||
|-------------|-------------|-------------|---------------| | ||
| 0.1 | 1 | 1 | Valid | | ||
| 1 | 1 | 1 | Valid | | ||
| 65535 | 65535 | 65535 | Valid | | ||
| 0.65535 | 65535 | 65535 | Valid | | ||
| 1.0 | 65536 | 65536 | Valid | | ||
| 1.1 | 65537 | 65537 | Valid | | ||
| 1.65535 | 131071 | 131071 | Valid | | ||
| 65535.0 | 4294901760 | 4294901760 | Valid | | ||
| 65535.1 | 4294901761 | 4294901761 | Valid | | ||
| 65535.65535 | 4294967295 | 4294967295 | Valid | | ||
| 0.65536 | | | Invalid | | ||
| 65535.655536| | | Invalid | | ||
| 65536.0 | | | Invalid | | ||
| 65536.65535 | | | Invalid | | ||
| | 4294967296 | | Invalid | | ||
|
||
<a id="nestedatt--config_bgp--fields"></a> | ||
### Nested Schema for `config_bgp.fields` | ||
|
||
Optional: | ||
|
||
- `paths` (List of String) The set of field mask paths. | ||
|
||
|
||
<a id="nestedatt--config_bgp--neighbors"></a> | ||
### Nested Schema for `config_bgp.neighbors` | ||
|
||
Required: | ||
|
||
- `asn` (Number) Autonomous system number of this BGP/anycast enabled on-prem host. | ||
|
||
Optional: | ||
|
||
- `asn_text` (String) Autonomous system as text (supported in ASDOT or ASPLAIN format) Optional, requires the asn field to be set to the equivalent integer value of the ASDOT/ASPLAIN string contained in this field or be unset/zero. | ||
Example: | ||
|
||
| ASDOT | ASPLAIN | INTEGER | VALID/INVALID | | ||
|-------------|-------------|-------------|---------------| | ||
| 0.1 | 1 | 1 | Valid | | ||
| 1 | 1 | 1 | Valid | | ||
| 65535 | 65535 | 65535 | Valid | | ||
| 0.65535 | 65535 | 65535 | Valid | | ||
| 1.0 | 65536 | 65536 | Valid | | ||
| 1.1 | 65537 | 65537 | Valid | | ||
| 1.65535 | 131071 | 131071 | Valid | | ||
| 65535.0 | 4294901760 | 4294901760 | Valid | | ||
| 65535.1 | 4294901761 | 4294901761 | Valid | | ||
| 65535.65535 | 4294967295 | 4294967295 | Valid | | ||
| 0.65536 | | | Invalid | | ||
| 65535.655536| | | Invalid | | ||
| 65536.0 | | | Invalid | | ||
| 65536.65535 | | | Invalid | | ||
| | 4294967296 | | Invalid | | ||
- `ip_address` (String) IPv4 address of the BGP neighbor | ||
- `max_hop_count` (Number) Max hop count, if BGP multihop is enabled. | ||
- `multihop` (Boolean) BGP multihop enabled or not. | ||
- `password` (String) BGP protocol access password for this BGP neighbor, max 25 characters long. | ||
|
||
|
||
|
||
<a id="nestedatt--config_ospf"></a> | ||
### Nested Schema for `config_ospf` | ||
|
||
Optional: | ||
|
||
- `area` (String) OSPF area identifier; usually in the format of an IPv4 address (although not an address itself) | ||
- `area_type` (String) OSPF area type; one of: "STANDARD", "STUB", "NSSA". | ||
- `authentication_key` (String) OSPF authentication key. | ||
- `authentication_key_id` (Number) title: Numeric OSPF authentication key identifier. | ||
- `authentication_type` (String) OSPF authentication type; one of "Clear", "MD5". | ||
- `cost` (Number) Explicit link cost for the interface. | ||
- `dead_interval` (Number) OSPF router dead interval timer in seconds; must be the same for all the routers on the same network; default: 40 secs. | ||
- `hello_interval` (Number) Period (in seconds) of OSPF Hello packet, sent by the OSPF router; must be the same for all the routers on the same network; default: 10 secs. | ||
- `interface` (String) Name of the interface that is configured with external IP address of the host | ||
- `preamble` (String) Any predefined OSPF configuration, with embedded new lines; the preamble will be prepended to the generated BGP configuration. | ||
- `retransmit_interval` (Number) Period (in seconds) of retransmitting for OSPF Database Description and Link State Requests; default: 5 seconds. | ||
- `transmit_delay` (Number) Estimated time to transmit link state advertisements; default: 1 sec. | ||
|
||
|
||
<a id="nestedatt--config_ospfv3"></a> | ||
### Nested Schema for `config_ospfv3` | ||
|
||
Optional: | ||
|
||
- `area` (String) OSPF area identifier; usually in the format of an IPv4 address (although not an address itself) | ||
- `cost` (Number) Explicit link cost for the interface. | ||
- `dead_interval` (Number) OSPF router dead interval timer in seconds; must be the same for all the routers on the same network; default: 40 sec. | ||
- `hello_interval` (Number) Period (in seconds) of OSPF Hello packet, sent by the OSPF router; must be the same for all the routers on the same network; default: 10 secs. | ||
- `interface` (String) Name of the interface that is configured with external IP address of the host | ||
- `retransmit_interval` (Number) Period (in seconds) of retransmitting for OSPF Database Description and Link State Requests; default: 5 seconds. | ||
- `transmit_delay` (Number) Estimated time to transmit link state advertisements; default: 1 sec. |
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,52 @@ | ||
data "bloxone_infra_hosts" "anycast_hosts" { | ||
filters = { | ||
display_name = "my-host" | ||
} | ||
} | ||
|
||
# Create an anycast config profile with onprem hosts | ||
resource "bloxone_anycast_config" "example" { | ||
anycast_ip_address = "10.10.10.1" | ||
name = "Anycast_config_example" | ||
service = "DNS" | ||
|
||
} | ||
|
||
# Adding an anycast host with BGP routing protocol | ||
resource "bloxone_anycast_host" "example" { | ||
id = one(data.bloxone_infra_hosts.anycast_hosts.results).legacy_id | ||
|
||
# Adding the anycast config profile and enabling BGP routing protocol | ||
anycast_config_refs = [ | ||
{ | ||
anycast_config_name = bloxone_anycast_config.test_onprem_hosts.name | ||
routing_protocols = ["BGP", "OSPF"] | ||
} | ||
] | ||
|
||
# Adding the BGP configuration | ||
config_bgp = { | ||
asn = "6500" | ||
asn_text = "6500" | ||
holddown_secs = 180 | ||
neighbors = [ | ||
{ | ||
asn = "6501" | ||
ip_address = "10.20.0.3" | ||
} | ||
] | ||
} | ||
|
||
# Adding the OSPF configuration | ||
config_ospf = { | ||
area_type = "STANDARD" | ||
area = "10.0.0.1" | ||
authentication_type = "Clear" | ||
interface = "eth0" | ||
authentication_key = "YXV0aGV" | ||
hello_interval = 10 | ||
dead_interval = 40 | ||
retransmit_interval = 5 | ||
transmit_delay = 1 | ||
} | ||
} |
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
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.