githubEdit

Cisco IOSXE

Enable Restconf to use by Terraform

ip http secure-server
restconf
aaa new-model
aaa authentication login default local
aaa authorization exec default local

Sample Configuration to enable Telemetry

  • This example uses the followin files:

    • header.tf

    • terraform.tfvars

    • cpu.tf

    • xpaths.tf

    • validate_subscriptions.tf

Header file

  • This file defines provider information, including credential and device url

Variables

CPU.tf

  • file contains the loop that goes through the Subscription ID Numbers and Xpaths from the previous configuratioon file. It also defines some values for the encoding, stream, and update interval defaults.

XPath

  • defines the Xpaths for the environment sensor and the Interfaces Operational data.

Validation

  • confirms that all the subscriptions were properly created from the previous files using the mdt data_source.

Run Terraform

  • terraform init

  • terraform plan

    • if the .tfvars file is NOT named terraform.tfvars, it can be explicitly defined which variable file to use with this format terraform plan -var-file="var.tfvars"

  • terraform apply

    • if the .tfvars file is NOT named terraform.tfvars, it can be explicitly defined which variable file to use with this format terraform apply -var-file="var.tfvars"

  • terraform destroy

Resource

Last updated