-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bulk port groups resource and data source (#183)
- Loading branch information
Showing
14 changed files
with
1,484 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "fmc_port_groups Data Source - terraform-provider-fmc" | ||
subcategory: "Objects" | ||
description: |- | ||
This data source can read the Port Groups. | ||
--- | ||
|
||
# fmc_port_groups (Data Source) | ||
|
||
This data source can read the Port Groups. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "fmc_port_groups" "example" { | ||
items = { | ||
"port_group_1" = { | ||
} | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `domain` (String) The name of the FMC domain | ||
- `items` (Attributes Map) Map of port groups. The key of the map is the name of the individual Port Group. (see [below for nested schema](#nestedatt--items)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The id of the object | ||
|
||
<a id="nestedatt--items"></a> | ||
### Nested Schema for `items` | ||
|
||
Read-Only: | ||
|
||
- `description` (String) Optional user-created description. | ||
- `id` (String) UUID of the managed Port Groups. | ||
- `overridable` (Boolean) Indicates whether object values can be overridden. | ||
- `ports` (Attributes Set) (see [below for nested schema](#nestedatt--items--ports)) | ||
- `type` (String) | ||
|
||
<a id="nestedatt--items--ports"></a> | ||
### Nested Schema for `items.ports` | ||
|
||
Read-Only: | ||
|
||
- `id` (String) UUID of the port (such as fmc_port.test.id, etc.). | ||
- `type` (String) |
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,81 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "fmc_port_groups Resource - terraform-provider-fmc" | ||
subcategory: "Objects" | ||
description: |- | ||
This plural resource manages a bulk of Port Groups. The FMC API supports quick bulk creation for this resource, but the deletion/modification is done one-by-one. Updating and deleting fmc_port_groups can thus take much more time than creating it (even >500 times more time, i.e. >50000%, depending on the change size). | ||
--- | ||
|
||
# fmc_port_groups (Resource) | ||
|
||
This plural resource manages a bulk of Port Groups. The FMC API supports quick bulk creation for this resource, but the deletion/modification is done one-by-one. Updating and deleting `fmc_port_groups` can thus take much more time than creating it (even >500 times more time, i.e. >50000%, depending on the change size). | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "fmc_port_groups" "example" { | ||
items = { | ||
port_group_1 = { | ||
type = "PortObjectGroup" | ||
description = "My port group description" | ||
ports = [ | ||
{ | ||
id = "0050568A-232D-0ed3-0000-004294971602" | ||
type = "ProtocolPortObject" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `items` (Attributes Map) Map of port groups. The key of the map is the name of the individual Port Group. (see [below for nested schema](#nestedatt--items)) | ||
|
||
### Optional | ||
|
||
- `domain` (String) The name of the FMC domain | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The id of the object | ||
|
||
<a id="nestedatt--items"></a> | ||
### Nested Schema for `items` | ||
|
||
Required: | ||
|
||
- `ports` (Attributes Set) (see [below for nested schema](#nestedatt--items--ports)) | ||
- `type` (String) | ||
|
||
Optional: | ||
|
||
- `description` (String) Optional user-created description. | ||
- `overridable` (Boolean) Indicates whether object values can be overridden. | ||
|
||
Read-Only: | ||
|
||
- `id` (String) UUID of the managed Port Groups. | ||
|
||
<a id="nestedatt--items--ports"></a> | ||
### Nested Schema for `items.ports` | ||
|
||
Required: | ||
|
||
- `type` (String) - Choices: `ProtocolPortObject`, `ICMPV6Object`, `ICMPV4Object` | ||
|
||
Optional: | ||
|
||
- `id` (String) UUID of the port (such as fmc_port.test.id, etc.). | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import fmc_port_groups.example "<domain>,[<port_groups_name>]" | ||
``` |
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,6 @@ | ||
data "fmc_port_groups" "example" { | ||
items = { | ||
"port_group_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import fmc_port_groups.example "<domain>,[<port_groups_name>]" |
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,14 @@ | ||
resource "fmc_port_groups" "example" { | ||
items = { | ||
port_group_1 = { | ||
type = "PortObjectGroup" | ||
description = "My port group description" | ||
ports = [ | ||
{ | ||
id = "0050568A-232D-0ed3-0000-004294971602" | ||
type = "ProtocolPortObject" | ||
} | ||
] | ||
} | ||
} | ||
} |
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,63 @@ | ||
--- | ||
name: Port Groups | ||
rest_endpoint: /api/fmc_config/v1/domain/{DOMAIN_UUID}/object/portobjectgroups | ||
res_description: >- | ||
This plural resource manages a bulk of Port Groups. | ||
The FMC API supports quick bulk creation for this resource, but the deletion/modification is done one-by-one. | ||
Updating and deleting `fmc_port_groups` can thus take much more time than creating it (even >500 times more time, | ||
i.e. >50000%, depending on the change size). | ||
data_source_name_query: true | ||
import_name_query: yes | ||
is_bulk: true | ||
doc_category: Objects | ||
attributes: | ||
- model_name: items | ||
type: Map | ||
description: >- | ||
Map of port groups. The key of the map is the name of the individual Port Group. | ||
mandatory: true | ||
map_key_example: port_group_1 | ||
attributes: | ||
- model_name: id | ||
type: String | ||
resource_id: true | ||
description: UUID of the managed Port Groups. | ||
exclude_example: true | ||
exclude_test: true | ||
- model_name: type | ||
type: String | ||
mandatory: true | ||
example: "PortObjectGroup" | ||
- model_name: description | ||
type: String | ||
description: Optional user-created description. | ||
example: "My port group description" | ||
- model_name: overridable | ||
type: Bool | ||
description: Indicates whether object values can be overridden. | ||
exclude_example: true | ||
test_value: "true" | ||
- model_name: objects | ||
tf_name: ports | ||
type: Set | ||
mandatory: true | ||
attributes: | ||
- model_name: id | ||
type: String | ||
description: UUID of the port (such as fmc_port.test.id, etc.). | ||
id: true | ||
example: 0050568A-232D-0ed3-0000-004294971602 | ||
test_value: fmc_port.test.id | ||
- model_name: type | ||
type: String | ||
mandatory: true | ||
enum_values: [ProtocolPortObject,ICMPV6Object,ICMPV4Object] | ||
example: ProtocolPortObject | ||
|
||
test_prerequisites: |- | ||
resource "fmc_port" "test" { | ||
name = "port_1" | ||
description = "My PORT id" | ||
protocol = "TCP" | ||
port = "443" | ||
} |
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.