User Guide for Deploying Per-App AS3 Declaration

Note

  • The bigip_as3 resource now supports the Per-Application mode of AS3 deployment from provider version v1.22.1. For more information on Per-Application mode, see Per-App.

  • To use AS3 Per-App mode of deployment, the AS3 version on BIG-IP should be greater than v3.50.

  • When deploying AS3 JSON in Per-App mode, make sure to include the [tenant_name](#tenant_name) attribute to specify the tenant for deploying the application/applications. If not specified, a random tenant name will be generated.

  • To use PerApplication, ensure that it is set to true on the Big-IP (BIG-IP AS3 version greater than 3.50) device as a prerequisite. For more information, see Per-Application Declarations.

Per-Application Deployment - Create

Example usage for json file with tenant name
1 resource "bigip_as3" "as3-example1" {
2     as3_json    = file("perApplication_example.json")
3     tenant_name = "Test"
4 }

Example AS3 declaration for the PerApp mode of deployment from perApplication_example.json
 1 {
 2     "schemaVersion": "3.50.0",
 3     "Application1": {
 4         "class": "Application",
 5         "service": {
 6             "class": "Service_HTTP",
 7             "virtualAddresses": [
 8                 "10.0.2.1"
 9             ],
10             "pool": "pool"
11         },
12         "pool": {
13             "class": "Pool",
14             "members": [
15                 {
16                     "servicePort": 80,
17                     "serverAddresses": [
18                         "192.0.2.10",
19                         "192.0.2.20"
20                     ]
21                 }
22             ]
23         }
24     },
25     "Application2": {
26         "class": "Application",
27         "service": {
28             "class": "Service_HTTP",
29             "virtualAddresses": [
30                 "10.0.3.2"
31             ],
32             "pool": "pool"
33         },
34         "pool": {
35             "class": "Pool",
36             "members": [
37                 {
38                     "servicePort": 80,
39                     "serverAddresses": [
40                         "192.0.3.30",
41                         "192.0.3.40"
42                     ]
43                 }
44             ]
45         }
46     }
47 }

Per-Application Deployment - Update

Update deployed Applications

Example usage for json file with tenant name
1 resource "bigip_as3" "as3-example1" {
2     as3_json    = file("updated_perApplication_example.json")
3     tenant_name = "Test"
4 }

Example AS3 declaration for the PerApp mode of deployment from updated_perApplication_example.json
 1{
 2    "schemaVersion": "3.50.0",
 3    "Application1": {
 4        "class": "Application",
 5        "service": {
 6            "class": "Service_HTTP",
 7            "virtualAddresses": [
 8                "10.0.2.11"
 9            ],
10            "pool": "pool"
11        },
12        "pool": {
13            "class": "Pool",
14            "members": [
15                {
16                    "servicePort": 80,
17                    "serverAddresses": [
18                        "192.0.2.11",
19                        "192.0.2.21"
20                    ]
21                }
22            ]
23        }
24    },
25    "Application2": {
26        "class": "Application",
27        "service": {
28            "class": "Service_HTTP",
29            "virtualAddresses": [
30                "10.0.3.22"
31            ],
32            "pool": "pool"
33        },
34        "pool": {
35            "class": "Pool",
36            "members": [
37                {
38                    "servicePort": 80,
39                    "serverAddresses": [
40                        "192.0.3.32",
41                        "192.0.3.42"
42                    ]
43                }
44            ]
45        }
46    }
47}

Add new Application

You have the power to create new applications by either including them all in a single AS3 declaration or by using multiple AS3 declarations, see Example: Adding all applications with one AS3 declaration and Example: Adding applications via two different AS3 declarations.

Example: Adding all applications with one AS3 declaration

In the example below, we are creating Application1, Application2, and Application3 in perApplication_example.json.

Example usage for json file with tenant name
1 resource "bigip_as3" "as3-example1" {
2     as3_json    = file("perApplication_example.json")
3     tenant_name = "Test"
4 }

AS3 declaration including all the Apps for PerApp mode of deployment from perApplication_example.json
 1{
 2    "schemaVersion": "3.50.0",
 3    "Application1": {
 4        "class": "Application",
 5        "service": {
 6            "class": "Service_HTTP",
 7            "virtualAddresses": [
 8                "10.0.2.1"
 9            ],
10            "pool": "pool"
11        },
12        "pool": {
13            "class": "Pool",
14            "members": [
15                {
16                    "servicePort": 80,
17                    "serverAddresses": [
18                        "192.0.2.10",
19                        "192.0.2.20"
20                    ]
21                }
22            ]
23        }
24    },
25    "Application2": {
26        "class": "Application",
27        "service": {
28            "class": "Service_HTTP",
29            "virtualAddresses": [
30                "10.0.3.2"
31            ],
32            "pool": "pool"
33        },
34        "pool": {
35            "class": "Pool",
36            "members": [
37                {
38                    "servicePort": 80,
39                    "serverAddresses": [
40                        "192.0.3.30",
41                        "192.0.3.40"
42                    ]
43                }
44            ]
45        }
46    },
47    "Application3": {
48        "class": "Application",
49        "service": {
50            "class": "Service_HTTP",
51            "virtualAddresses": [
52                "10.0.3.3"
53            ],
54            "pool": "pool"
55        },
56        "pool": {
57            "class": "Pool",
58            "members": [
59                {
60                    "servicePort": 80,
61                    "serverAddresses": [
62                        "192.0.3.50",
63                        "192.0.3.60"
64                    ]
65                }
66            ]
67        }
68    }
69}

Example: Adding applications via two different AS3 declarations

In the example below, we are creating Application1 and Application2 in perApplication_example.json, while Application3 is created in perApplication_example2.json.

Example usage for json file with tenant name
1 resource "bigip_as3" "as3-example1" {
2     as3_json    = file("perApplication_example.json")
3     tenant_name = "Test"
4 }

AS3 declaration including only the new App for PerApp mode of deployment from perApplication_example.json
 1{
 2    "schemaVersion": "3.50.0",
 3    "Application1": {
 4        "class": "Application",
 5        "service": {
 6            "class": "Service_HTTP",
 7            "virtualAddresses": [
 8                "10.0.2.1"
 9            ],
10            "pool": "pool"
11        },
12        "pool": {
13            "class": "Pool",
14            "members": [
15                {
16                    "servicePort": 80,
17                    "serverAddresses": [
18                        "192.0.2.10",
19                        "192.0.2.20"
20                    ]
21                }
22            ]
23        }
24    },
25    "Application2": {
26        "class": "Application",
27        "service": {
28            "class": "Service_HTTP",
29            "virtualAddresses": [
30                "10.0.3.2"
31            ],
32            "pool": "pool"
33        },
34        "pool": {
35            "class": "Pool",
36            "members": [
37                {
38                    "servicePort": 80,
39                    "serverAddresses": [
40                        "192.0.3.30",
41                        "192.0.3.40"
42                    ]
43                }
44            ]
45        }
46    }
47}

Example usage for json file with tenant name
1 resource "bigip_as3" "as3-example1" {
2     as3_json    = file("perApplication_example2.json")
3     tenant_name = "Test"
4 }

AS3 declaration including only the new App for PerApp mode of deployment from perApplication_example2.json
 1{
 2    "schemaVersion": "3.50.0",
 3    "Application3": {
 4        "class": "Application",
 5        "service": {
 6            "class": "Service_HTTP",
 7            "virtualAddresses": [
 8                "10.0.3.3"
 9            ],
10            "pool": "pool"
11        },
12        "pool": {
13            "class": "Pool",
14            "members": [
15                {
16                    "servicePort": 80,
17                    "serverAddresses": [
18                        "192.0.3.50",
19                        "192.0.3.60"
20                    ]
21                }
22            ]
23        }
24    }
25}

Delete Existing App

Assume that we have three Applications deployed: Application1, Application2 (via as3-example1 resource), and Application3 (via as3-example2 resource). To delete a specific app, Application2, we can update the AS3 blob passed in as3-example1.

Example usage for json file with tenant name
1 resource "bigip_as3" "as3-example1" {
2     as3_json    = file("perApplication_example.json")
3     tenant_name = "Test"
4 }

AS3 declaration including only the new App for PerApp mode of deployment
 1{
 2    "schemaVersion": "3.50.0",
 3    "Application1": {
 4        "class": "Application",
 5        "service": {
 6            "class": "Service_HTTP",
 7            "virtualAddresses": [
 8                "10.0.2.1"
 9            ],
10            "pool": "pool"
11        },
12        "pool": {
13            "class": "Pool",
14            "members": [
15                {
16                    "servicePort": 80,
17                    "serverAddresses": [
18                        "192.0.2.10",
19                        "192.0.2.20"
20                    ]
21                }
22            ]
23        }
24    }
25}

To delete all applications deployed via a particular resource, for example: - To delete Application1 and Application2, you can run the command terraform destroy -target=bigip_as3.as3-example1. - In order to delete Application3, you can run the command terraform destroy -target=bigip_as3.as3-example2.

Note

If only one App is deployed in a Tenant, upon deletion of that app, the tenant will also be deleted.