Terraform Provider for Cisco Catalyst Center
Requirements
Introduction
The terraform-provider-dnacenter provides a Terraform provider for managing and automating your Cisco Catalyst Center environment. It consists of a set of resources and data-sources for performing tasks related to Catalyst Center.
This collection has been tested and supports Cisco Catalyst Center 2.1.1.
Using the provider
If you are building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init
to initialize it.
ex.
# Configure provider with your Cisco DNA Center SDK credentials
provider "dnacenter" {
# Cisco DNA Center user name
# username = "admin"
# it can be set using the environment variable DNAC_BASE_URL
# Cisco DNA Center password
# password = "admin123"
# it can be set using the environment variable DNAC_USERNAME
# Cisco DNA Center base URL, FQDN or IP
# base_url = "https://172.168.196.2"
# it can be set using the environment variable DNAC_PASSWORD
# Boolean to enable debugging
# debug = "false"
# it can be set using the environment variable DNAC_DEBUG
# Boolean to enable or disable SSL certificate verification
# ssl_verify = "false"
# it can be set using the environment variable DNAC_SSL_VERIFY
}
# Configure CLI credential
resource "dna_cli_credential" "response" {
provider = dnacenter
item {
username = "${var.username}"
password = "${var.password}"
credential_type = "APP"
}
}
output "dna_cli_credential_response" {
value = dna_cli_credential.response
}
# Retrieve project's templates
data "dna_template_project" "response" {
provider = dnacenter
name = "Cloud DayN Templates"
}
data "dna_template" "response" {
provider = dnacenter
project_id = data.dna_template_project.response.items.0.id
}
output "dna_template_response" {
value = data.dna_template.response
}
In the examples directory you can find more.
Repository
The Terraform provider for Cisco Catalyst Center source code is hosted in github. https://github.com/cisco-en-programmability/terraform-provider-dnacenter