For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

jdfishtorn's avatar
jdfishtorn
Icon for Nimbostratus rankNimbostratus
Dec 10, 2024

F5 Per applications AS3 Declarations via Terraform

F5 Per applications AS3 Declarations via Terraform. 
 
Good evening all, 
 
I would like to put together a proof of concept surrounding using Terraform (the clients preferred automation platform) to populate and manage AS3 declarations. I am attempting to follow the following F5 docs page in my lab, and it is not working as I would have expected. [https://clouddocs.f5.com/products/orchestration/terraform/latest/BIG-IP/per-app-as3.html#example2](https://clouddocs.f5.com/products/orchestration/terraform/latest/BIG-IP/per-app-as3.html#example2)
 
I have two separate files such is suggested in the article. One with two applications (app1-2.json) that acts as the base line for the first push, then a second file (app3.json) with a third application that I would like to ADD to the existing AS3 deceleration leaving my F5 with 3 total applications. 
 
  
I have one file [main.tf](http://main.tf) that looks like the following:
 
resource "bigip\_as3"  "as3-example" {
 
as3\_json = file("app1-2.json")
 
tenant\_filter = var.tenant
 
tenant\_name = "Tenant"
 
}
 
I use that [main.tf](http://main.tf) file to push the original app1-2 file to produce the initial declaration with two applications. Then, I edit that file to look like   
 
 
resource "bigip\_as3"  "as3-example" {
 
\#     as3\_json = data.template\_file.init.rendered
 
as3\_json = file("app3.json")
 
tenant\_filter = var.tenant
 
tenant\_name = "Tenant"
 
}
 
Since per-application declarations are enabled, I assumed editing this file and applying it would push the third application and leave the other two in tact. That is not the case. When I push this edited [main.tf](http://main.tf) file, it edits the existing declaration deleting app1 and app 2 and creating app3. 
 
Can anyone shed some light on how we are supposed to use Terraform in per application deployments? I feel like I have to be missing something silly. 
 
 
 
 
 

3 Replies