cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
689
Views
1
Helpful
3
Replies

Cisco ACI Terraform too large state file

stelios_1911
Level 1
Level 1

Hi,

I build Cisco ACI using terraform with CI\CD, having only one tenant and one vrf. Since my prod environment is big with thousands of variables, I end up having very big state file and huge delay (7-8 minutes) when running the pipeline.

I found that a possible solution is to migrate to nexus-as-code, having 40k of code in prod, I don't want to start over with nexus-as-code.

Is there a solution to reduce the state file delay? without clearing everything and starting from the beginning?

Thank you in advance.

3 Replies 3

I had the same thing years back with Python and Ansible. One way to do this is too infrastructure into multiple smaller TF workspaces, thus each managing a logical group of resources (for example by application or network segment), this will reduce your individual state file sizes and parallel execution time. 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Hi @bigevilbeard 

I am new to Terraform and am learning to automate Cisco ACI with Network-as-code module. Splitting the state files into multiple TF workspace as you suggested means that we have to take care ourselves which order the ACI objects should be created (we lose the automatic dependency handling), right? If yes, is there any solution for that? Thank you.

Yes this can be a problem and you can lose the automatic dependency resolution between objects in different state files.

 

Take a look at HashiCorp's Terragrunt tool handles cross state dependencies very elegantly and it can automatically manage the apply order based on dependencies.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Review Cisco Networking for a $25 gift card

Save 25% on Day-2 Operations Add-On License