AS3 Integration¶
Welcome to the F5 AS3 Integration Resources for Terraform.
You can use Terraform with AS3 for managing application-specific configurations on an F5 BIG-IP system. AS3 uses a declarative model, meaning you provide a JSON declaration rather than a set of imperative commands. The declaration represents the configuration which AS3 is responsible for creating on an F5 BIG-IP system. Terraform provides resources to configure AS3 declarative JSON on BIG-IP.
Prerequisites¶
To use AS3 Extensions with Terraform, ensure you meet the following requirements:
The BIG-IP system is running software version 12.1.x or newer
The BIG-IP system has AS3 Extension version 3.10 or newer installed
A BIG-IP system user account with the Administrator role
Example Usage¶
1 resource "bigip_as3" "as3-example1" {
2 as3_json = "${file("example1.json")}"
3 }
1 resource "bigip_as3" "as3-example1" {
2 as3_json = "${file("example2.json")}"
3 tenant_filter = "Sample_03"
4 }
Argument Reference¶
as3_json - (Required) Path/Filename of Declarative AS3 JSON which is a json file used with builtin
file
functiontenant_filter - (Optional) If there are multiple tenants in a json this attribute helps you set a particular tenant to which you want to reflect the changes. Other tenants will not be created or modified.
as3_example1.json - Example AS3 Declarative JSON file with single tenant.
Single tenant example¶1{ 2 "class": "AS3", 3 "action": "deploy", 4 "persist": true, 5 "declaration": { 6 "class": "ADC", 7 "schemaVersion": "3.0.0", 8 "id": "example-declaration-01", 9 "label": "Sample 1", 10 "remark": "Simple HTTP application with round robin pool", 11 "Sample_01": { 12 "class": "Tenant", 13 "defaultRouteDomain": 0, 14 "Application_1": { 15 "class": "Application", 16 "template": "http", 17 "serviceMain": { 18 "class": "Service_HTTP", 19 "virtualAddresses": [ 20 "10.0.2.10" 21 ], 22 "pool": "web_pool" 23 }, 24 "web_pool": { 25 "class": "Pool", 26 "monitors": [ 27 "http" 28 ], 29 "members": [ 30 { 31 "servicePort": 80, 32 "serverAddresses": [ 33 "192.0.1.100", 34 "192.0.1.110" 35 ] 36 } 37 ] 38 } 39 } 40 } 41 } 42}
as3_example2.json - Example AS3 Declarative JSON file with multiple tenants
Multiple tenants example¶1{ 2 "class": "AS3", 3 "action": "deploy", 4 "persist": true, 5 "declaration": { 6 "class": "ADC", 7 "schemaVersion": "3.0.0", 8 "id": "example-declaration-01", 9 "label": "Sample 1", 10 "remark": "Simple HTTP application with round robin pool", 11 "Sample_02": { 12 "class": "Tenant", 13 "defaultRouteDomain": 0, 14 "Application_2": { 15 "class": "Application", 16 "template": "http", 17 "serviceMain": { 18 "class": "Service_HTTP", 19 "virtualAddresses": [ 20 "10.2.2.10" 21 ], 22 "pool": "web_pool2" 23 }, 24 "web_pool2": { 25 "class": "Pool", 26 "monitors": [ 27 "http" 28 ], 29 "members": [ 30 { 31 "servicePort": 80, 32 "serverAddresses": [ 33 "192.2.1.100", 34 "192.2.1.110" 35 ] 36 } 37 ] 38 } 39 } 40 }, 41 "Sample_03": { 42 "class": "Tenant", 43 "defaultRouteDomain": 0, 44 "Application_3": { 45 "class": "Application", 46 "template": "http", 47 "serviceMain": { 48 "class": "Service_HTTP", 49 "virtualAddresses": [ 50 "10.1.2.10" 51 ], 52 "pool": "web_pool3" 53 }, 54 "web_pool3": { 55 "class": "Pool", 56 "monitors": [ 57 "http" 58 ], 59 "members": [ 60 { 61 "servicePort": 80, 62 "serverAddresses": [ 63 "192.3.1.100", 64 "192.3.1.110" 65 ] 66 } 67 ] 68 } 69 } 70 } 71 } 72}
AS3 Installation¶
Use the following Terraform provisioner to download AS3 RPM from GitHub and install the RPM on BIG-IP:
resource "null_resource" "install_as3" {
provisioner "local-exec" {
command = "./install-as3-rpm.sh x.x.x.x xxxx:xxxx"
}
}
You must pass BIG-IP and its credentials as an argument to the install script. This script is available in the examples section of AS3 in the Terraform GitHub repo.
Note
AS3 tenants are BIG-IP administrative partitions used to group configurations that support specific AS3 applications. An AS3 application may support a network-based business application or system. AS3 tenants can also include resources shared by applications in other tenants.
What’s Next?