published

Sample terraform code with Cisco Cloud Network Controller

This project shows how Cloud Network Controller (CNC) works on GCP, how it normalizes and translates a cloud-like policy model into public cloud native constructs, and how Terraform can be leveraged to automate CNC operations.

High Level Diagram

gcp

Use Case: Single Region/Tenant/VRF

Using standard terraform modules, the code builds a single VPC on us-east4 region and enable peering with the infra VPC where CNC is deployed with cloud routers, it then creates two EPGs (Web & DB) which translates to firewall policies and rules, and enable Web access from Internet using contracts.

Pre-requisites

CNC running on a dedicated GCP project. All credentials and sensitive data are defined in a .tfvars file.

Providers

Name Version
aci >=2.7.0

Installation

  1. Install and set up your terraform environment
  2. Clone/copy the .tf files onto your terraform environment
  3. Create a terraform.tfvars file with your CNC credentials and GCP project used for the user project/VPC
  4. Optionally, the gcp.tf file deploys two VM instances (web-vm and db-vm) for testing purposes.

Usage

terraform init
terraform plan
terraform apply

Policies

myapp

Cloud Networking

vpc

View code on GitHub

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.