This repository is deprecated; please follow the main search page or use the ‘Related code repos’ widget on the right side of the current page.

ACI Terraform Example

Example how to deploy an ACI configuration using Terraform

This example doesn't deploy any useful configuration. It's purpose is to demonstrate how Cisco ACI configuration can be managed using Terraform.
If you don't have an ACI controller you can play with, you can use the Cisco ACI Sandbox (username: admin, password: ciscopsdt) which is publicly available

The example creates:

  • tenant

  • vrf, application profile, EPG

  • filters, contracts

  • L3out (OSPF)

How to use this example

  • Download and install Terraform

https://www.terraform.io/downloads.html

  • Clone the repository
git clone https://github.com/pehruby/ACITerraformExample.git
cd ACITerraformExample
  • Edit configuration files

Change the ip_path attribute used in Example1/main.tf to a path string valid in your environment.
You can change the ACI tenant name in Example1/variables.tf

  • Set the following environment variables
ACI_USERNAME = "username"
ACI_PASSWORD = "password"
or
ACI_USERNAME = "username"
ACI_CERT_NAME = "cert.crt" # CRT file name (as was paste to the user account in ACI)
ACI_PRIVATE_KEY = "\path_tocert\cert.key" # path to a private key

ACI_URL = "https://path_to_apic"

See https://www.terraform.io/docs/providers/aci/index.html for details

  • Change directory to Example1
cd Example1
  • Initialize Terraform
terraform init
  • Create Terraform exacution plan
terraform plan
  • Apply the configuration
terraform apply

When asked to enter a value, enter "yes".
At the end some variables are printed out to demonstrate this capability.

  • Destroy the Terraform managed infrastructure
terraform destroy
View code on GitHub
  • Owner

  • Contributors

    +1Github contributor
  • Categories

  • Products

    ACI
  • Programming Languages

    HCLTerraform
  • License

    GNU General Public License v3.0

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.