### Example .env Configuration for Acceptance Tests Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/CONTRIBUTING.md Example .env file configuration showing global credentials and device-specific host overrides for acceptance tests. ```shell # Global credentials (used for all devices unless overridden) IOSXE_USERNAME=admin IOSXE_PASSWORD=password # 17.15.x Router and Switch IOSXE_1715_ROUTER_HOST=192.0.2.10 IOSXE_1715_SWITCH_HOST=192.0.2.11 ``` -------------------------------- ### iosxe_evpn Resource Configuration Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/evpn.md Example configuration for the iosxe_evpn resource, demonstrating various optional parameters for EVPN setup. ```APIDOC ## Resource: iosxe_evpn ### Description This resource can manage the EVPN configuration. ### Schema #### Optional - `anycast_gateway_mac_auto` (Boolean) - Enable Auto Anycast Gateway MAC - `default_gateway_advertise` (Boolean) - Advertise Default Gateway MAC/IP routes - `delete_mode` (String) - Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is `all`. - Choices: `all`, `attributes` - `device` (String) - A device name from the provider configuration. - `flooding_suppression_address_resolution_disable` (Boolean) - Disable flooding suppression - `ip_duplication_limit` (Number) - Number of IP moves within specified time interval - Range: `2`-`1000` - `ip_duplication_time` (Number) - IP duplication timer - Range: `10`-`36000` - `logging_peer_state` (Boolean) - Peer state transition logging - `mac_duplication_limit` (Number) - Number of MAC moves within specified time interval - Range: `2`-`1000` - `mac_duplication_time` (Number) - MAC duplication timer - Range: `10`-`36000` - `multicast_advertise` (Boolean) - Enable and advertise L2 multicast capability - `replication_type_ingress` (Boolean) - Ingress replication - `replication_type_mp2mp` (Boolean) - mp2mp replication - `replication_type_p2mp` (Boolean) - p2mp replication - `replication_type_static` (Boolean) - Static replication - `route_target_auto_vni` (Boolean) - Set vni-based route-target - `router_id_loopback` (Number) - Loopback interface - Range: `0`-`2147483647` ### Read-Only - `id` (String) - The path of the object. ### Import Import is supported using the following syntax: The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: ```shell terraform import iosxe_evpn.example "" ``` ``` -------------------------------- ### iosxe_key_chain Resource Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/key_chain.md This example demonstrates how to configure a key chain with a single key, specifying its ID, key string, and acceptance/sending lifetimes. Ensure the key string is kept secure. ```terraform resource "iosxe_key_chain" "example" { name = "OSPF-AUTH" keys = [ { id = "1" key_string_key = "mySecretKey123" accept_lifetime_start_time = "00:00:00" accept_lifetime_start_month = "Jan" accept_lifetime_start_day = 1 accept_lifetime_start_year = 2025 accept_lifetime_infinite = true send_lifetime_start_time = "00:00:00" send_lifetime_start_month = "Jan" send_lifetime_start_day = 1 send_lifetime_start_year = 2025 send_lifetime_infinite = true } ] } ``` -------------------------------- ### Example Usage of iosxe_crypto_ikev2_policy Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/crypto_ikev2_policy.md This example demonstrates how to configure a Crypto IKEv2 Policy with a specific name, local IP address, and proposals. Ensure the proposal name 'proposal123' exists. ```terraform resource "iosxe_crypto_ikev2_policy" "example" { name = "policy1" match_address_local_ip = ["1.2.3.4"] match_fvrf_any = true proposals = [ { proposals = "proposal123" } ] } ``` -------------------------------- ### Import Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/bgp_address_family_ipv4_mvpn.md This example shows how to import an existing BGP Address Family IPv4 MVPN configuration into Terraform management. Ensure you replace `` and `` with your actual values. ```bash terraform import iosxe_bgp_address_family_ipv4_mvpn.example "," ``` -------------------------------- ### Example iosxe_object_group Resource Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/object_group.md This is an example of how to configure an iosxe_object_group resource, demonstrating both FQDN and network object groups with various nested configurations. ```terraform resource "iosxe_object_group" "example" { fqdn = [ { name = "FQDN_GROUP_1" description = "My FQDN object group" patterns = [ { fqdn_pattern = ".*\\.cisco\\.com" } ] } ] network = [ { name = "NETWORK_GROUP_1" description = "My network object group" hosts = [ { ipv4_host = "10.1.1.1" } ] network_addresses = [ { ipv4_address = "10.1.2.0" ipv4_mask = "255.255.255.0" } ] address_ranges = [ { start = "10.1.3.1" end = "10.1.3.10" } ] } ] } ``` -------------------------------- ### iosxe_line Resource Configuration Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/line.md Example configuration for the iosxe_line resource, demonstrating how to set up console and VTY lines with various parameters. ```APIDOC ## Resource: iosxe_line ### Description This resource can manage the Line configuration, including console, auxiliary, and virtual terminal (VTY) lines. ### Schema #### Optional Arguments - `aux` (Attributes List): Configuration for auxiliary lines. See [Nested Schema for aux](#nestedatt--aux) below. - `console` (Attributes List): Configuration for the primary console line. See [Nested Schema for console](#nestedatt--console) below. - `device` (String): A device name from the provider configuration. - `vty` (Attributes List): Configuration for virtual terminal lines. See [Nested Schema for vty](#nestedatt--vty) below. #### Read-Only Arguments - `id` (String): The path of the object. ### Nested Schema for `aux` #### Required Arguments - `first` (String): Auxiliary line number. Choices: `0`. #### Optional Arguments - `escape_character` (String): Specifies the escape character for the line. - `exec_timeout_minutes` (Number): Timeout in minutes for the line's EXEC process. Range: `0`-`35791`. - `exec_timeout_seconds` (Number): Timeout in seconds for the line's EXEC process. Range: `0`-`2147483`. - `logging_synchronous` (Boolean): Enables synchronized message output to the line. - `monitor` (Boolean): Copies debug output to the current terminal line. - `stopbits` (String): Sets the number of stop bits for the async line. Choices: `1`, `1.5`, `2`. - `transport_output_none` (Boolean): Disables all transport protocols for the line. ### Nested Schema for `console` #### Required Arguments - `first` (String): Console line number. Choices: `0`. #### Optional Arguments - `escape_character` (String): Specifies the escape character for the line. - `exec_timeout_minutes` (Number): Timeout in minutes for the line's EXEC process. Range: `0`-`35791`. - `exec_timeout_seconds` (Number): Timeout in seconds for the line's EXEC process. Range: `0`-`2147483`. - `logging_synchronous` (Boolean): Enables synchronized message output to the line. - `login_authentication` (String): Specifies the authentication method for login. - `login_local` (Boolean): Enables local login authentication. - `password` (String, Sensitive): The password for the line. - `password_level` (Number): Sets the privilege level for the password. Range: `0`-`255`. - `password_type` (String): The type of password encryption. Choices: `0`, `6`, `7`. - `password_wo` (String, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)): The write-only value of the password attribute. - `password_wo_version` (Number): The write-only version of the password attribute. - `privilege_level` (Number): Sets the privilege level for the line. Range: `0`-`15`. - `stopbits` (String): Sets the number of stop bits for the async line. Choices: `1`, `1.5`, `2`. - `transport_output` (List of String): Defines which protocols to use for outgoing connections. - `transport_output_all` (Boolean): Enables all transport protocols for the line. - `transport_output_none` (Boolean): Disables all transport protocols for the line. ### Nested Schema for `vty` #### Required Arguments - `first` (Number): The starting VTY line number. - `last` (Number): The ending VTY line number. #### Optional Arguments - `access_classes` (Attributes List): List of access control lists to apply to the VTY lines. See [Nested Schema for access_classes](#nestedatt--vty--access_classes) below. - `authorization_exec_default` (Boolean): Enables default authorization for EXEC commands. - `escape_character` (String): Specifies the escape character for the line. - `exec_timeout_minutes` (Number): Timeout in minutes for the line's EXEC process. Range: `0`-`35791`. - `exec_timeout_seconds` (Number): Timeout in seconds for the line's EXEC process. Range: `0`-`2147483`. - `logging_synchronous` (Boolean): Enables synchronized message output to the line. - `monitor` (Boolean): Copies debug output to the current terminal line. - `password` (String, Sensitive): The password for the line. - `password_type` (String): The type of password encryption. Choices: `0`, `6`, `7`. - `rotary_group` (Number): Specifies the rotary group number for the line. - `stopbits` (String): Sets the number of stop bits for the async line. Choices: `1`, `1.5`, `2`. - `stream_editor` (String): Specifies the stream editor for the line. - `telnet_netconf` (Boolean): Enables Telnet Netconf for the line. - `transport_input` (List of String): Defines which protocols to use for incoming connections. - `transport_output` (List of String): Defines which protocols to use for outgoing connections. - `transport_output_none` (Boolean): Disables all transport protocols for the line. - `transport_preferred_protocol` (String): Specifies the preferred transport protocol. Choices: `all`, `in`, `none`, `out`. ### Nested Schema for `vty` -> `access_classes` #### Required Arguments - `direction` (String): The direction of the access list. Choices: `in`, `out`. - `access_list` (String): The name or number of the access list. #### Optional Arguments - `vrf_also` (Boolean): Applies the access list to the VRF as well. ``` -------------------------------- ### Example Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/crypto_ikev2_proposal.md Use this data source to read the configuration of a Crypto IKEv2 Proposal by its name. ```terraform data "iosxe_crypto_ikev2_proposal" "example" { name = "PROPOSAL1" } ``` -------------------------------- ### iosxe_policy_map_event Resource Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/policy_map_event.md This is an example of how to configure an iosxe_policy_map_event resource. It demonstrates setting up an event type, match type, and detailed class and action numbers with various activation and authentication parameters. ```terraform resource "iosxe_policy_map_event" "example" { name = "dot1x_policy" event_type = "authentication-success" match_type = "match-all" class_numbers = [ { number = 10 class = "MY_CLASS" execution_type = "do-until-failure" action_numbers = [ { number = 10 activate_service_template_config_service_template = "DEFAULT_LINK_POLICY" activate_service_template_config_aaa_list = "methodlist1" activate_service_template_config_precedence = 1 activate_interface_template = "templ1" activate_policy_type_control_subscriber = "subscriber1" authenticate_using_method = "dot1x" authenticate_using_retries = 2 authenticate_using_retry_time = 0 authenticate_using_priority = 10 authenticate_using_both = true replace = true restrict = true clear_session = true clear_authenticated_data_hosts_on_port = true protect = true err_disable = true resume_reauthentication = true authentication_restart = 2 set_domain = "data" unauthorize = true notify = true set_timer_name = "timer1" set_timer_value = 3600 } ] } ] } ``` -------------------------------- ### Example Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/bgp_address_family_ipv4_mvpn.md This is an example of how to use the iosxe_bgp_address_family_ipv4_mvpn resource in Terraform. It creates a basic configuration for the BGP address family IPv4 MVPN. ```terraform resource "iosxe_bgp_address_family_ipv4_mvpn" "example" { } ``` -------------------------------- ### iosxe_sla Resource Configuration Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/sla.md Example of how to configure the iosxe_sla resource to define SLA entries and schedules. ```APIDOC ## Resource: iosxe_sla ### Description Configures Service Level Agreements (SLAs) on Cisco IOS XE devices. ### Schema #### Optional - `device` (String) - A device name from the provider configuration. - `entries` (Attributes List) - Defines the SLA entries. See nested schema below. - `schedules` (Attributes List) - Defines the SLA schedules. See nested schema below. #### Read-Only - `id` (String) - The path of the object. ### Nested Schema for `entries` #### Required - `number` (Number) - Entry Number #### Optional - `icmp_echo_destination` (String) - Destination IP address or hostname, broadcast disallowed - `icmp_echo_frequency` (Number) - Frequency of an operation - `icmp_echo_source_ip` (String) - Source Address ### Nested Schema for `schedules` #### Required - `entry_number` (Number) - Entry number #### Optional - `life` (Number) - Length of time to execute in seconds - `start_time_now` (Boolean) - Start now ### Import Import is supported using the following syntax: The `terraform import` command can be used, for example: ```shell terraform import iosxe_sla.example "" ``` ``` -------------------------------- ### iosxe_multicast Resource Configuration Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/multicast.md This example demonstrates how to configure multicast settings using the iosxe_multicast resource, including global multipath options and VRF-specific configurations. ```APIDOC ## Resource: iosxe_multicast ### Description This resource can manage the Multicast configuration. ### Schema #### Optional - `delete_mode` (String) - Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is `all`. - Choices: `all`, `attributes` - `device` (String) - A device name from the provider configuration. - `multipath` (Boolean) - RPF across equal-cost paths - `multipath_s_g_hash` (String) - Per-(source, group) load sharing algorithm selection - Choices: `basic`, `next-hop-based` - `vrfs` (Attributes List) - Select VPN Routing/Forwarding instance (see [below for nested schema](#nestedatt--vrfs)) #### Read-Only - `id` (String) - The path of the object. ### Nested Schema for `vrfs` #### Required - `vrf` (String) #### Optional - `multipath` (Boolean) - RPF across equal-cost paths - `multipath_s_g_hash` (String) - Per-(source, group) load sharing algorithm selection - Choices: `basic`, `next-hop-based` ### Import Import is supported using the following syntax: The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: ```shell terraform import iosxe_multicast.example "" ``` ``` -------------------------------- ### Example Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/interface_ethernet.md Use this data source to read the configuration of an Ethernet interface. Specify the interface type and name. ```terraform data "iosxe_interface_ethernet" "example" { type = "GigabitEthernet" name = "3" } ``` -------------------------------- ### iosxe_flow_record Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/flow_record.md This resource can manage the Flow Record configuration. It requires a name and can optionally configure various match and collect parameters. ```terraform resource "iosxe_flow_record" "example" { name = "FNF1" description = "My flow record" match_ipv4_source_address = true match_ipv4_destination_address = true match_ipv4_protocol = true match_ipv4_tos = true match_transport_source_port = true match_transport_destination_port = true match_interface_input = true match_flow_direction = true match_flow_cts_destination_group_tag = true match_flow_cts_source_group_tag = true match_datalink_mac_source_address_input = true match_datalink_mac_destination_address_input = true match_ipv4_ttl = true match_routing_vrf_input = true match_vxlan_vnid = true collect_interface_output = true collect_counter_bytes_long = true collect_counter_packets_long = true collect_transport_tcp_flags = true collect_timestamp_absolute_first = true collect_timestamp_absolute_last = true } ``` -------------------------------- ### Basic iosxe_save_config Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/save_config.md This is a basic example of how to use the iosxe_save_config resource. It saves the current running configuration to the startup configuration. ```terraform resource "iosxe_save_config" "example" { } ``` -------------------------------- ### Example Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/crypto_ikev2_policy.md Use this data source to read the Crypto IKEv2 Policy configuration. Specify the policy name to retrieve its details. ```terraform data "iosxe_crypto_ikev2_policy" "example" { name = "policy1" } ``` -------------------------------- ### Example Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/arp.md This data source can be used to read the ARP configuration. ```terraform data "iosxe_arp" "example" { } ``` -------------------------------- ### Example Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/bgp_address_family_vpnv6.md Use this data source to read the BGP Address Family VPNv6 configuration. ```terraform data "iosxe_bgp_address_family_vpnv6" "example" { asn = "65000" af_name = "unicast" } ``` -------------------------------- ### Example Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/crypto_ipsec_transform_set.md Use this data source to read the configuration of an existing Crypto IPSec Transform Set. ```terraform data "iosxe_crypto_ipsec_transform_set" "example" { name = "TEST" } ``` -------------------------------- ### Import iosxe_service Resource Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/service.md This example shows how to import an existing `iosxe_service` resource into Terraform state. Ensure the device configuration matches the imported resource. ```shell terraform import iosxe_service.example "" ``` -------------------------------- ### Basic iosxe_commit Resource Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/commit.md This is a basic example of the iosxe_commit resource. It commits the candidate configuration to the running configuration. ```terraform resource "iosxe_commit" "example" { } ``` -------------------------------- ### Save Configuration Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/actions/save_config.md Use this action to save the running configuration to the startup configuration on a specified device. Ensure the device is configured in the provider. ```terraform action "iosxe_save_config" "example" { config { device = "router1" } } ``` -------------------------------- ### Build Terraform Provider for IOS XE Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/CONTRIBUTING.md Build the provider using the Go install command after cloning the repository and entering the directory. ```shell go install ``` -------------------------------- ### Import an SLA Resource Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/sla.md This command imports an existing SLA configuration into your Terraform state. Replace 'example' with the desired Terraform resource name. ```bash terraform import iosxe_sla.example "" ``` -------------------------------- ### iosxe_interface_mpls Data Source Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/interface_mpls.md This is an example of how to use the iosxe_interface_mpls data source to read MPLS configuration for a specific interface. ```terraform data "iosxe_interface_mpls" "example" { type = "Loopback" name = "1" } ``` -------------------------------- ### Basic OSPF Configuration Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/ospf.md This example demonstrates a basic OSPF configuration using the iosxe_ospf resource. It includes process ID, BFD, default information origination, metric, distance, domain tag, neighbor settings, network statements, priority, router ID, shutdown status, summary addresses, area configurations, auto-cost reference bandwidth, passive interface default, logging, NSF settings, max metric router LSA, fast reroute, and redistribution of static and connected subnets. ```terraform resource "iosxe_ospf" "example" { process_id = 1 bfd_all_interfaces = true default_information_originate = true default_information_originate_always = true default_metric = 21 distance = 120 domain_tag = 10 neighbors = [ { ip = "2.2.2.2" priority = 10 cost = 100 } ] networks = [ { ip = "3.3.3.0" wildcard = "0.0.0.255" area = "0" } ] priority = 100 router_id = "1.2.3.4" shutdown = false summary_addresses = [ { ip = "3.3.3.0" mask = "255.255.255.0" } ] areas = [ { area_id = "5" authentication_message_digest = true nssa = true nssa_default_information_originate = true nssa_default_information_originate_metric = 100 nssa_default_information_originate_metric_type = 1 nssa_no_summary = true nssa_no_redistribution = true } ] auto_cost_reference_bandwidth = 40000 passive_interface_default = true log_adjacency_changes = true nsf_ietf = true nsf_ietf_restart_interval = 120 max_metric_router_lsa = true max_metric_router_lsa_summary_lsa_metric = 16711680 max_metric_router_lsa_external_lsa_metric = 16711680 max_metric_router_lsa_include_stub = true max_metric_router_lsa_on_startup_time = 60 fast_reroute_per_prefix_enable_prefix_priority = "high" redistribute_static_subnets = true redistribute_connected_subnets = true } ``` -------------------------------- ### Configure Acceptance Test Environment Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/CONTRIBUTING.md Set up the acceptance test environment by copying the sample .env file and editing it with device credentials and connection details. ```shell cp .env.sample .env ``` -------------------------------- ### iosxe_bgp_address_family_l2vpn Data Source Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/bgp_address_family_l2vpn.md Example usage of the iosxe_bgp_address_family_l2vpn data source to read BGP Address Family L2VPN configuration. ```APIDOC ## Data Source: iosxe_bgp_address_family_l2vpn ### Description This data source can read the BGP Address Family L2VPN configuration. ### Usage ```terraform data "iosxe_bgp_address_family_l2vpn" "example" { asn = "65000" af_name = "evpn" } ``` ### Schema #### Required - `af_name` (String) - The address family name. - `asn` (String) - The BGP Autonomous System Number. #### Optional - `device` (String) - A device name from the provider configuration. #### Read-Only - `bgp_nexthop_trigger_delay` (Number) - Set the delay to trigger nexthop tracking. - `id` (String) - The path of the retrieved object. - `rewrite_evpn_rt_asn` (Boolean) - Enable rewrite RT in the BGP EVPN address-family. ``` -------------------------------- ### Basic iosxe_yang Resource Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/yang.md This example demonstrates the basic usage of the iosxe_yang resource to manage a single YANG leaf. Ensure the path is correctly specified and attributes are provided as a key-value map. ```terraform resource "iosxe_yang" "simple" { path = "/Cisco-IOS-XE-native:native/banner/login" attributes = { banner = "My Banner" } } ``` -------------------------------- ### iosxe_interface_vlan Data Source Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/interface_vlan.md This example shows how to use the iosxe_interface_vlan data source to read the configuration of a VLAN interface with ID 10. ```terraform data "iosxe_interface_vlan" "example" { name = 10 } ``` -------------------------------- ### iosxe_commit Resource Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/guides/netconf.md Example of using the `iosxe_commit` resource to explicitly commit staged changes. Ensure `auto_commit` is false and use `depends_on` to list resources to be committed. ```terraform resource "iosxe_commit" "example" { # Optional: specify device name if using multi-device configuration # device = "device1" # Optional: save to startup-config after commit # save_config = true # The commit attribute is managed internally depends_on = [ # List all resources that should be staged before committing ] } ``` -------------------------------- ### iosxe_device_tracking Resource Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/device_tracking.md Configure Device Tracking settings. This includes enabling IP or MAC theft logging, setting fallback IPv4 addresses and masks, overriding source address selection, and defining the retry interval. ```terraform resource "iosxe_device_tracking" "example" { logging_theft = true tracking_auto_source_fallback_ipv4 = "10.0.0.1" tracking_auto_source_fallback_mask = "255.255.255.0" tracking_auto_source_fallback_override = true tracking_retry_interval = 10 } ``` -------------------------------- ### Scan SBOM for Vulnerabilities with Grype Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/SBOM.md Install Grype and use it to scan an SBOM file (SPDX or CycloneDX format) for known vulnerabilities. Ensure Grype is installed before running the scan. ```bash # Install Grype curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh # Scan SBOM for vulnerabilities grype sbom:./sbom/latest/sbom.spdx.json ``` -------------------------------- ### iosxe_system Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/system.md This resource can manage the System configuration. ```APIDOC ## iosxe_system (Resource) ### Description This resource can manage the System configuration. ### Example Usage ```terraform resource "iosxe_system" "example" { hostname = "ROUTER-1" ip_bgp_community_new_format = true ipv6_unicast_routing = true ipv6_multicast_routing = true ip_source_route = false ip_domain_lookup = true ip_domain_name = "test.com" login_delay = 10 login_on_failure = true login_on_failure_log = true login_on_success = true login_on_success_log = true ip_name_servers = ["1.2.3.4"] ip_name_servers_vrf = [ { vrf = "VRF1" servers = ["2.3.4.5"] } ] ip_domain_lookup_nsap = true ip_domain_lookup_recursive = true diagnostic_bootup_level = "minimal" memory_free_low_watermark_processor = 203038 ip_ssh_time_out = 120 ip_ssh_authentication_retries = 3 call_home_contact_email = "email@test.com" call_home_cisco_tac_1_profile_active = true call_home_cisco_tac_1_destination_transport_method = "email" ip_tcp_path_mtu_discovery = true ip_tcp_mss = 1460 ip_tcp_window_size = 65536 ip_nbar_classification_dns_classify_by_domain = true ip_multicast_route_limit = 200000 igmp_snooping_querier = true igmp_snooping_querier_version = 2 igmp_snooping_querier_max_response_time = 10 igmp_snooping_querier_timer_expiry = 120 ip_domain_list_vrf_domain = "example.com" ip_domain_list_vrf = "VRF1" } ``` ## Schema This resource can manage the System configuration. ``` -------------------------------- ### Importing an iosxe_yang Resource Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/yang.md This example shows how to import an existing configuration into Terraform state using the `terraform import` command. The YANG path should be provided as the identifier. ```shell terraform import iosxe_yang.example "/Cisco-IOS-XE-native:native/banner/login" ``` -------------------------------- ### iosxe_nat Resource Configuration Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/nat.md Example configuration for the iosxe_nat resource to manage NAT settings. ```APIDOC ## Resource: iosxe_nat ### Description This resource can manage the NAT configuration. ### Schema #### Optional - `delete_mode` (String) Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is `all`. - Choices: `all`, `attributes` - `device` (String) A device name from the provider configuration. - `inside_source_interfaces` (Attributes List) Specify access list describing local addresses. - `inside_source_static_entries` (Attributes List) - `outside_source_static_entries` (Attributes List) ### Nested Schema for `inside_source_interfaces` #### Required - `id` (String) #### Optional - `interfaces` (Attributes List) Specify interface for global address. ### Nested Schema for `inside_source_interfaces.interfaces` #### Required - `interface` (String) #### Optional - `overload` (Boolean) Overload an address translation ### Nested Schema for `inside_source_static_entries` #### Required - `global_ip` (String) - `local_ip` (String) #### Optional - `egress_interface_loopback` (String) Loopback interface - `extendable` (Boolean) Extend this translation when used - `forced` (Boolean) Delete this entry and its children, even if in use - `inside_static_overload` (Boolean) Overload an address translation - `inside_static_pool` (String) Name pool of local addresses - `mapping_id` (Number) Associate a mapping id to this mapping - Range: `1`-`2147483647` - `mask` (String) - `network` (String) Subnet translation - Choices: `network` - `no_alias` (Boolean) Do not create an alias for the global address - `no_payload` (Boolean) No translation of embedded address/port in the payload - `redundancy` (String) NAT redundancy operation - `reversible` (Boolean) - `route_map` (String) Specify route-map - `stateless` (Boolean) No flow entries (session) for mapping ### Nested Schema for `outside_source_static_entries` #### Required - `global_ip` (String) - `local_ip` (String) #### Optional - `extendable` (Boolean) Extend this translation when used - `mask` (String) - `match_in_vrf` (Boolean) Match incoming vrf - `network` (String) Subnet translation - Choices: `network` - `no_payload` (Boolean) No translation of embedded address/port in the payload - `outside_static_pool` (String) Name pool of local addresses - `redundancy` (String) NAT redundancy operation ### Import Import is supported using the following syntax: The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: ```shell terraform import iosxe_nat.example "" ``` ``` -------------------------------- ### iosxe_yang Resource with Nested Lists Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/yang.md This example shows how to manage YANG list configurations using the 'lists' argument. Specify the list name, its key attribute, and the items within the list. This is useful for configuring complex structures like VRFs. ```terraform resource "iosxe_yang" "nested_list" { path = "/Cisco-IOS-XE-native:native/ip" attributes = { source-route = "true" } lists = [{ name = "vrf" key = "name" items = [ { name = "VRF1" } ] }] } ``` -------------------------------- ### Import Interface BDI Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/interface_bdi.md This example shows how to import an existing Interface BDI resource using its name. ```terraform terraform import iosxe_interface_bdi.example "" ``` -------------------------------- ### Interface Port Channel Data Source Example Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/interface_port_channel.md Reads the configuration for a specified Interface Port Channel. ```terraform data "iosxe_interface_port_channel" "example" { name = 10 } ``` -------------------------------- ### iosxe_interface_tunnel Data Source Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/interface_tunnel.md Example usage of the iosxe_interface_tunnel data source to read the configuration of a tunnel interface. ```terraform data "iosxe_interface_tunnel" "example" { name = 90 } ``` -------------------------------- ### List Dependencies from SPDX SBOM using jq Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/SBOM.md Use `jq` to parse an SPDX SBOM and list the name and version of all packages, excluding the provider itself. This helps in understanding the direct dependencies. ```bash # SPDX format jq '.packages[] | select(.name != "terraform-provider-iosxe") | {name,version}' sbom/latest/sbom.spdx.json ``` -------------------------------- ### iosxe_sla Data Source Usage Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/data-sources/sla.md Example of how to use the iosxe_sla data source in Terraform to retrieve SLA configuration. ```APIDOC ## iosxe_sla Data Source ### Description This data source can fetch information about SLA configurations on a Cisco IOS XE device. ### Usage ```terraform data "iosxe_sla" "example" { # Optional parameters can be added here if needed } ``` ### Schema #### Optional - `device` (String) - A device name from the provider configuration. #### Read-Only - `entries` (Attributes List) - List of SLA entries. See [below for nested schema](#nestedatt--entries). - `id` (String) - The path of the retrieved object. - `schedules` (Attributes List) - List of SLA schedules. See [below for nested schema](#nestedatt--schedules). ### Nested Schema for `entries` Read-Only: - `icmp_echo_destination` (String) - Destination IP address or hostname, broadcast disallowed. - `icmp_echo_frequency` (Number) - Frequency of an operation. - `icmp_echo_source_ip` (String) - Source Address. - `number` (Number) - Entry Number. ### Nested Schema for `schedules` Read-Only: - `entry_number` (Number) - Entry number. - `life` (Number) - Length of time to execute in seconds. - `start_time_now` (Boolean) - Start now. ``` -------------------------------- ### Create iosxe_zone_pair_security Resource Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/zone_pair_security.md Example of how to create a zone pair security resource. Ensure the source and destination zones are pre-configured. ```terraform resource "iosxe_zone_pair_security" "example" { name = "ZP_IN_OUT" source = "INSIDE" destination = "OUTSIDE" description = "Inside to outside traffic policy" service_policy_type_inspect = "PM_IN_TO_OUT" } ``` -------------------------------- ### List Dependencies from CycloneDX SBOM using jq Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/SBOM.md Use `jq` to parse a CycloneDX SBOM and list the name and version of all components. This provides a clear view of the software's components. ```bash # CycloneDX format jq '.components[] | {name,version}' sbom/latest/sbom.cyclonedx.json ``` -------------------------------- ### Basic iosxe_prefix_list Resource Configuration Source: https://github.com/ciscodevnet/terraform-provider-iosxe/blob/main/docs/resources/prefix_list.md Example of how to configure a basic prefix list with a permit action, IP address, and prefix length range. This is useful for defining network access control policies. ```terraform resource "iosxe_prefix_list" "example" { prefixes = [ { name = "PREFIX_LIST_1" seq = 10 action = "permit" ip = "10.0.0.0/8" ge = 24 le = 32 } ] prefix_list_description = [ { name = "PREFIX_LIST_1" description = "My prefix list" } ] } ```