Skip to content
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

adding support for HA #203

Merged
merged 7 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ website/node_modules
.vscode/settings.json

website/vendor

vendor
running.sh
# Test exclusions
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/
Expand Down
55 changes: 55 additions & 0 deletions docs/data-sources/device_ha_pair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fmc_device_ha_pair Data Source - terraform-provider-fmc"
subcategory: "Device"
description: |-
This data source can read the Device HA Pair.
---

# fmc_device_ha_pair (Data Source)

This data source can read the Device HA Pair.

## Example Usage

```terraform
data "fmc_device_ha_pair" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
```

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

### Optional

- `domain` (String) The name of the FMC domain
- `id` (String) The id of the object
- `lan_failover_interface_name` (String) Name of physical interface
- `name` (String) The name of the access control policy.
- `stateful_failover_interface_name` (String) Name of physical interface

### Read-Only

- `action` (String) FTD HA PUT operation action. Specifically used for breaking FTD HA or manual switch.
- `enc_key_generation_scheme` (String) Select the encyption key generation scheme.
- `force_break` (Boolean) FTD HA Force Break option (PUT Option).
- `is_encryption_enabled` (Boolean) Boolean field to enable encryption
- `lan_failover_active_ip` (String)
- `lan_failover_interface_id` (String) ID of physical interface.
- `lan_failover_interface_type` (String) Type of physical interface.
- `lan_failover_ipv6_addr` (Boolean)
- `lan_failover_name` (String)
- `lan_failover_standby_ip` (String)
- `lan_failover_subnet_mask` (String)
- `primary_device_id` (String) ID of primary FTD in the HA Pair.
- `secondary_device_id` (String) ID of secondary FTD in the HA Pair.
- `shared_key` (String) Pass the unique shared key if needed.
- `stateful_failover_active_ip` (String)
- `stateful_failover_interface_id` (String) ID of physical interface.
- `stateful_failover_interface_type` (String) Type of physical interface.
- `stateful_failover_ipv6_addr` (Boolean)
- `stateful_failover_name` (String)
- `stateful_failover_standby_ip` (String)
- `stateful_failover_subnet_mask` (String)
- `use_same_link_for_failovers` (Boolean) Boolean field to enable same link for failovers
92 changes: 92 additions & 0 deletions docs/resources/device_ha_pair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fmc_device_ha_pair Resource - terraform-provider-fmc"
subcategory: "Device"
description: |-
This resource can manage a Device HA Pair.
---

# fmc_device_ha_pair (Resource)

This resource can manage a Device HA Pair.

## Example Usage

```terraform
resource "fmc_device_ha_pair" "example" {
name = "FTD_HA"
primary_device_id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
secondary_device_id = "96d24097-41c4-4332-a4d0-a8c07ac08482"
is_encryption_enabled = false
use_same_link_for_failovers = false
shared_key = "cisco123"
enc_key_generation_scheme = "CUSTOM"
lan_failover_standby_ip = "1.1.1.2"
lan_failover_active_ip = "1.1.1.1"
lan_failover_name = "LAN-INTERFACE"
lan_failover_subnet_mask = "255.255.255.0"
lan_failover_ipv6_addr = false
lan_failover_interface_name = "GigabitEthernet0/0"
lan_failover_interface_id = "757kdgh5-41c4-4558-a4d0-a8c07ac08470"
lan_failover_interface_type = "PhysicalInterface"
stateful_failover_standby_ip = "10.10.10.2"
stateful_failover_active_ip = "10.10.10.1"
stateful_failover_name = "Stateful-INTERFACE"
stateful_failover_subnet_mask = "255.255.255.0"
stateful_failover_ipv6_addr = false
stateful_failover_interface_name = "GigabitEthernet0/0"
stateful_failover_interface_id = "76d24097-hj7r-7786-a4d0-a8c07ac08470"
stateful_failover_interface_type = "PhysicalInterface"
action = "SWITCH"
force_break = false
}
```

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

### Required

- `lan_failover_active_ip` (String)
- `lan_failover_interface_id` (String) ID of physical interface.
- `lan_failover_name` (String)
- `lan_failover_standby_ip` (String)
- `name` (String) The name of the access control policy.
- `primary_device_id` (String) ID of primary FTD in the HA Pair.
- `secondary_device_id` (String) ID of secondary FTD in the HA Pair.
- `use_same_link_for_failovers` (Boolean) Boolean field to enable same link for failovers

### Optional

- `action` (String) FTD HA PUT operation action. Specifically used for breaking FTD HA or manual switch.
- Choices: `SWITCH`, `HABREAK`
- `domain` (String) The name of the FMC domain
- `enc_key_generation_scheme` (String) Select the encyption key generation scheme.
- Choices: `AUTO`, `CUSTOM`
- `force_break` (Boolean) FTD HA Force Break option (PUT Option).
- `is_encryption_enabled` (Boolean) Boolean field to enable encryption
- `lan_failover_interface_name` (String) Name of physical interface
- `lan_failover_interface_type` (String) Type of physical interface.
- `lan_failover_ipv6_addr` (Boolean)
- `lan_failover_subnet_mask` (String)
- `shared_key` (String) Pass the unique shared key if needed.
- `stateful_failover_active_ip` (String)
- `stateful_failover_interface_id` (String) ID of physical interface.
- `stateful_failover_interface_name` (String) Name of physical interface
- `stateful_failover_interface_type` (String) Type of physical interface.
- `stateful_failover_ipv6_addr` (Boolean)
- `stateful_failover_name` (String)
- `stateful_failover_standby_ip` (String)
- `stateful_failover_subnet_mask` (String)

### Read-Only

- `id` (String) The id of the object

## Import

Import is supported using the following syntax:

```shell
terraform import fmc_device_ha_pair.example "<id>"
```
3 changes: 3 additions & 0 deletions examples/data-sources/fmc_device_ha_pair/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "fmc_device_ha_pair" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
3 changes: 3 additions & 0 deletions examples/data-sources/fmc_device_ha_pairs/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "fmc_device_ha_pairs" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
1 change: 1 addition & 0 deletions examples/resources/fmc_device_ha_pair/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import fmc_device_ha_pair.example "<id>"
27 changes: 27 additions & 0 deletions examples/resources/fmc_device_ha_pair/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resource "fmc_device_ha_pair" "example" {
name = "FTD_HA"
primary_device_id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
secondary_device_id = "96d24097-41c4-4332-a4d0-a8c07ac08482"
is_encryption_enabled = false
use_same_link_for_failovers = false
shared_key = "cisco123"
enc_key_generation_scheme = "CUSTOM"
lan_failover_standby_ip = "1.1.1.2"
lan_failover_active_ip = "1.1.1.1"
lan_failover_name = "LAN-INTERFACE"
lan_failover_subnet_mask = "255.255.255.0"
lan_failover_ipv6_addr = false
lan_failover_interface_name = "GigabitEthernet0/0"
lan_failover_interface_id = "757kdgh5-41c4-4558-a4d0-a8c07ac08470"
lan_failover_interface_type = "PhysicalInterface"
stateful_failover_standby_ip = "10.10.10.2"
stateful_failover_active_ip = "10.10.10.1"
stateful_failover_name = "Stateful-INTERFACE"
stateful_failover_subnet_mask = "255.255.255.0"
stateful_failover_ipv6_addr = false
stateful_failover_interface_name = "GigabitEthernet0/0"
stateful_failover_interface_id = "76d24097-hj7r-7786-a4d0-a8c07ac08470"
stateful_failover_interface_type = "PhysicalInterface"
action = "SWITCH"
force_break = false
}
1 change: 1 addition & 0 deletions examples/resources/fmc_device_ha_pairs/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import fmc_device_ha_pairs.example "<id>"
27 changes: 27 additions & 0 deletions examples/resources/fmc_device_ha_pairs/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resource "fmc_device_ha_pairs" "example" {
name = "FTD_HA"
primary_device_id = "<FTD1_ID>"
secondary_device_id = "<FTD2_ID>"
is_encryption_enabled = false
use_same_link_for_failovers = false
shared_key = "cisco123"
enc_key_generation_scheme = "CUSTOM"
lan_failover_standby_ip = "1.1.1.2"
lan_failover_active_ip = "1.1.1.1"
lan_failover_name = "LAN-INTERFACE"
lan_failover_subnet_mask = "255.255.255.0"
lan_failover_ipv6_addr = false
lan_failover_interface_name = "GigabitEthernet0/0"
lan_failover_interface_id = "<interface uuid>"
lan_failover_interface_type = "PhysicalInterface"
stateful_failover_standby_ip = "1.1.1.2"
stateful_failover_active_ip = "1.1.1.1"
stateful_failover_name = "Stateful-INTERFACE"
stateful_failover_subnet_mask = "255.255.255.0"
stateful_failover_ipv6_addr = false
stateful_failover_interface_name = "GigabitEthernet0/0"
stateful_failover_interface_id = "<interface uuid>"
stateful_failover_interface_type = "PhysicalInterface"
action = "SWITCH"
force_break = false
}
156 changes: 156 additions & 0 deletions gen/definitions/device_ha_pair.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
name: Device HA Pair
rest_endpoint: /api/fmc_config/v1/domain/{DOMAIN_UUID}/devicehapairs/ftddevicehapairs
data_source_name_query: true
doc_category: Device
kadadhic marked this conversation as resolved.
Show resolved Hide resolved
attributes:
- model_name: name
type: String
mandatory: true
description: The name of the access control policy.
kadadhic marked this conversation as resolved.
Show resolved Hide resolved
example: FTD_HA
- model_name: type
type: String
description: Type of the resource (DeviceHAPair).
value: DeviceHAPair
- model_name: id
type: String
mandatory: true
tf_name: primary_device_id
data_path: [primary]
description: ID of primary FTD in the HA Pair.
example: 76d24097-41c4-4558-a4d0-a8c07ac08470
test_value: var.device_id
- model_name: id
type: String
mandatory: true
tf_name: secondary_device_id
data_path: [secondary]
description: ID of secondary FTD in the HA Pair.
example: 96d24097-41c4-4332-a4d0-a8c07ac08482
test_value: var.device_id
kadadhic marked this conversation as resolved.
Show resolved Hide resolved
- model_name: isEncryptionEnabled
type: Bool
data_path: [ftdHABootstrap]
description: Boolean field to enable encryption
example: false
- model_name: useSameLinkForFailovers
type: Bool
mandatory: true
data_path: [ftdHABootstrap]
example: false
description: Boolean field to enable same link for failovers
- model_name: sharedKey
type: String
data_path: [ftdHABootstrap]
description: Pass the unique shared key if needed.
example: cisco123
- model_name: encKeyGenerationScheme
type: String
data_path: [ftdHABootstrap]
description: Select the encyption key generation scheme.
example: "CUSTOM"
enum_values: [ AUTO, CUSTOM ]
- model_name: standbyIP
type: String
mandatory: true
tf_name: lan_failover_standby_ip
data_path: [ftdHABootstrap,lanFailover]
example: "1.1.1.2"
- model_name: activeIP
tf_name: lan_failover_active_ip
mandatory: true
type: String
data_path: [ftdHABootstrap,lanFailover]
example: "1.1.1.1"
- model_name: logicalName
type: String
mandatory: true
tf_name: lan_failover_name
data_path: [ftdHABootstrap,lanFailover]
example: LAN-INTERFACE
- model_name: subnetMask
type: String
tf_name: lan_failover_subnet_mask
kadadhic marked this conversation as resolved.
Show resolved Hide resolved
data_path: [ftdHABootstrap,lanFailover]
example: "255.255.255.0"
- model_name: useIPv6Address
kadadhic marked this conversation as resolved.
Show resolved Hide resolved
type: Bool
tf_name: lan_failover_ipv6_addr
data_path: [ftdHABootstrap,lanFailover]
example: false
- model_name: name
type: String
tf_name: lan_failover_interface_name
data_path: [ftdHABootstrap,lanFailover,interfaceObject]
description: Name of physical interface
example: GigabitEthernet0/0
- model_name: id
type: String
mandatory: true
tf_name: lan_failover_interface_id
data_path: [ftdHABootstrap,lanFailover,interfaceObject]
description: ID of physical interface.
example: 757kdgh5-41c4-4558-a4d0-a8c07ac08470
- model_name: type
type: String
tf_name: lan_failover_interface_type
data_path: [ftdHABootstrap,lanFailover,interfaceObject]
description: Type of physical interface.
example: PhysicalInterface
- model_name: standbyIP
type: String
tf_name: stateful_failover_standby_ip
data_path: [ftdHABootstrap,statefulFailover]
example: "10.10.10.2"
- model_name: activeIP
tf_name: stateful_failover_active_ip
type: String
data_path: [ftdHABootstrap,statefulFailover]
example: "10.10.10.1"
- model_name: logicalName
type: String
tf_name: stateful_failover_name
data_path: [ftdHABootstrap,statefulFailover]
example: Stateful-INTERFACE
- model_name: subnetMask
type: String
tf_name: stateful_failover_subnet_mask
data_path: [ftdHABootstrap,statefulFailover]
example: "255.255.255.0"
- model_name: useIPv6Address
type: Bool
tf_name: stateful_failover_ipv6_addr
data_path: [ftdHABootstrap,statefulFailover]
example: false
- model_name: name
type: String
tf_name: stateful_failover_interface_name
data_path: [ftdHABootstrap,statefulFailover,interfaceObject]
description: Name of physical interface
example: GigabitEthernet0/0
- model_name: id
type: String
tf_name: stateful_failover_interface_id
data_path: [ftdHABootstrap,statefulFailover,interfaceObject]
description: ID of physical interface.
example: 76d24097-hj7r-7786-a4d0-a8c07ac08470
- model_name: type
kadadhic marked this conversation as resolved.
Show resolved Hide resolved
type: String
tf_name: stateful_failover_interface_type
data_path: [ftdHABootstrap,statefulFailover,interfaceObject]
description: Type of physical interface.
example: PhysicalInterface
- model_name: action
type: String
description: FTD HA PUT operation action. Specifically used for breaking FTD HA or manual switch.
enum_values: [ SWITCH, HABREAK ]
exclude_test: true
example: SWITCH
- model_name: forceBreak
type: Bool
description: FTD HA Force Break option (PUT Option).
exclude_test: true
example: false
test_prerequisites: |-
variable "device_id" { default = null } // tests will set $TF_VAR_device_id
Loading
Loading