Forum Discussion

ganeshkumar12's avatar
ganeshkumar12
Icon for Nimbostratus rankNimbostratus
Apr 03, 2024

Issues with using multiple AS3 Json Files

Hello Folks, 

 

Need some suggestion here-

 

I created a directory with a Json file and created the objects / resources in F5. 

 

This Json file only has VIPs, backend pool and server addresses.

 

Thought of using a different Json File for Profiles and health monitors but am seeing that whenever the 2nd Json File is executed, it tries to destroy the VIPs created by the first Json File.

 

Both are in same partition - the file names are different -

 

1st .tf file -

# Terraform code for AS3

resource "bigip_as3"  "as3-f5-VIPS" {
     as3_json = file("as3.json")
 }

 

 

2nd .tf file-

 

# Terraform code for AS3

resource "bigip_as3"  "as3-f5-Profiles" {
     as3_json = file("as3-f5-Profiles.json")
 }

 

Any Idea as to what is going on here.

 

regards,

 

Ganeshkumar

  • Thanks Ben. I figured out the issue, I was having a typo in my template file name in Terraform because of which it was deleting the resources created by the 1st JSON File.

     

  • AS3 is a declarative interface, meaning each json file (or tenant) needs to have all the required pieces every time, to delare the end state.  You can reference objects in /Common/Shared, but they would need to be deployed via another JSON file like it's a separate tenant before they can be referenced.

    I have seen some instances where customers use tools like TF to build the declaration from templates and/or defaults, but then it all gets sent as a single declaration/API call