NAC Configuration
Bulk Operations
Section titled “Bulk Operations”Introduction
Section titled “Introduction”The Cisco FMC Terraform Provider supports bulk operations for certain resources, allowing you to create or delete multiple resources in a single API call. This feature leverages the Secure Firewall Management Center (FMC) API bulk capabilities to improve performance when managing large numbers of objects.
For more details, see the official provider documentation.
Why Use Bulk Operations?
Section titled “Why Use Bulk Operations?”Bulk operations provide several key benefits:
- Improved Performance: Significantly faster when managing large numbers of resources
- Reduced API Calls: Fewer requests to the FMC API, reducing load and potential rate limiting issues
By default, all objects are created in individual mode, except for network_groups and policies, which are always created in bulk. YAML definition of resources is common for bulk and non-bulk operation mode, however chaning bulk/individual mode will require objects to be recreated.
In the NAC module, you can enable bulk operations using the nac_configuration settings:
# Enable bulk mode for all supported objectsfmc: nac_configuration: bulk: true# Enable bulk mode per object type:fmc: nac_configuration: hosts_bulk: true networks_bulk: true ranges_bulk: trueNOTE: Even if object is labeled as bulk, it may create/delete objects one-by-one. Refresh is always in bulk. Please refer to Terraform resource documentation for details in each individual case.
Terraform Limitations
Section titled “Terraform Limitations”When using bulk resources, there are some limitations related to dependencies between resources:
Case 1: Object Replacement
Section titled “Case 1: Object Replacement”When replacing objects that are referenced by other resources (e.g., a host used in a network group), you may encounter dependency conflicts. Terraform cannot:
- Modify the bulk resource first (would break references)
- Modify the dependent resource first (new object doesn’t exist yet)
Solution: Use a staged deployment approach:
- Stage 1: Add the new object while keeping the old one and update references
- Stage 2: Remove the old object
Case 2: Object Removal
Section titled “Case 2: Object Removal”When removing objects that are referenced by other resources, you cannot do it in a single step.
Solution: Use a staged deployment approach:
- Stage 1: Remove references to the object from dependent resources
- Stage 2: Remove the object itself from the bulk resource
Schema
Section titled “Schema”Diagram
Section titled “Diagram”Classes
Section titled “Classes”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| nac_configuration | Class | [nac_configuration] | No |
nac_configuration (fmc)
Section titled “nac_configuration (fmc)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| bulk | Boolean | true, false | No | false |
| hosts_bulk | Boolean | true, false | No | |
| networks_bulk | Boolean | true, false | No | |
| ranges_bulk | Boolean | true, false | No | |
| fqdns_bulk | Boolean | true, false | No | |
| ports_bulk | Boolean | true, false | No | |
| icmpv4s_bulk | Boolean | true, false | No | |
| icmpv6s_bulk | Boolean | true, false | No | |
| port_groups_bulk | Boolean | true, false | No | |
| urls_bulk | Boolean | true, false | No | |
| url_groups_bulk | Boolean | true, false | No | |
| vlan_tags_bulk | Boolean | true, false | No | |
| vlan_tag_groups_bulk | Boolean | true, false | No | |
| sgts_bulk | Boolean | true, false | No | |
| tunnel_zones_bulk | Boolean | true, false | No | |
| security_zones_bulk | Boolean | true, false | No | |
| application_filters_bulk | Boolean | true, false | No | |
| time_ranges_bulk | Boolean | true, false | No | |
| ipv4_address_pools_bulk | Boolean | true, false | No | |
| ipv6_address_pools_bulk | Boolean | true, false | No | |
| interface_groups_bulk | Boolean | true, false | No | |
| resource_profiles_bulk | Boolean | true, false | No | |
| as_paths_bulk | Boolean | true, false | No | |
| ipv4_prefix_lists_bulk | Boolean | true, false | No | |
| ipv6_prefix_lists_bulk | Boolean | true, false | No | |
| standard_community_lists_bulk | Boolean | true, false | No | |
| expanded_community_lists_bulk | Boolean | true, false | No | |
| extended_community_lists_bulk | Boolean | true, false | No | |
| policy_lists_bulk | Boolean | true, false | No | |
| geolocations_bulk | Boolean | true, false | No | |
| ikev1_ipsec_proposals_bulk | Boolean | true, false | No | |
| ikev1_policies_bulk | Boolean | true, false | No | |
| ikev2_ipsec_proposals_bulk | Boolean | true, false | No | |
| ikev2_policies_bulk | Boolean | true, false | No | |
| bfd_templates_bulk | Boolean | true, false | No | |
| certificate_maps_bulk | Boolean | true, false | No | |
| dns_server_groups_bulk | Boolean | true, false | No |