F5 BIG-IP Terraform Provider
With the growth in public clouds, many enterprises who have deployments in AWS, Azure and GCP are using terraform in DevOps and CICD initiatives. Terraform is an open source tool for provisioning and deployment of both public and private cloud infrastructures. You can create, change and improve production infrastructure safely and predictably using Terraform. Like other DevOps tools, terraform also uses APIs abstraction through declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
Automation in the network is pivotal for DevOps success and as F5 plays an important role in our customers network, we developed the F5 provider plugin for terraform for F5 deployments. Now, using Terraform, customers can deploy F5 BIG-IP in Public clouds using F5 BIG-IP YAML or JSON templates. The terraform F5 Provider is available at https://github.com/f5devcentral/terraform-provider-bigip repository
How do you start using F5 Terraform Provider?
1. Make sure your Go environment is setup properly, you can check by using command go env
$ go env GOPATH="/Users/<username>/dev" GOROOT="/usr/local/go"
2. Download the F5 BIG-IP terraform provider source code from the repository
$ go get https://github.com/f5devcentral/terraform-provider-bigip
3. This will create folder and sub folders in your environment as shown below
ubuntu@ubuntu-xenial:~/dev/src/github.com/f5devcentral/terraform-provider-bigip$ ls ~ bigip launch_bigip.tf CHANGES.md terraform-provider-bigip vendor examples
4. You need to fix any dependencies as per your development environment and build the binary image by executing go build command in the terraform-provider-bigip folder before using F5 BIG-IP terraform provider.
How can I deploy F5 BIG-IP in AWS?
If you are using terraform to deploy infrastructure in AWS you can use F5 BIG-IP Cloud formation templates located at https://github.com/F5Networks/f5-aws-cloudformation
Below is an example of deploying F5 Cloud formation template
resource "aws_cloudformation_stack" "network" { name = "networking-stack" parameters { availabilityZone1 = "us-east-1a" sshKey = "mykey" adminPassword = "xxxx" imageName = "Best1000Mbps" instanceType = "m3.2xlarge" managementGuiPort = "8443" } template_body = "${file("fullstacklearning.json")}" }
Terraform plan command shows what will be manifested in the AWS cloud
/terraform/github.com/awswork$ terraform plan + aws_cloudformation_stack.network name: "networking-stack" outputs.%: "<computed>" parameters.%: "6" parameters.adminPassword: "xxxx" parameters.availabilityZone1: "us-west-2a" parameters.imageName: "Best1000Mbps" parameters.instanceType: "m3.2xlarge" parameters.managementGuiPort: "8443" parameters.sshKey: "mykey" policy_body: "<computed>" template_body: "{\"AWSTemplateFormatVersion\" …….
Once the F5 BIG-IP Cloud formation template facilitates onboarding of BIG-IP in AWS cloud then you can do operational tasks like creating VIPs, Pools etc using F5 BIG-IP terraform provider. We have many resources already available for F5 BIG-IP like irule, VIPs, route, profiles etc. The complete list can be seen at https://github.com/f5devcentral/terraform-provider-bigip/tree/master/bigip
We are adding more resources as we speak please visit GitHub https://github.com/f5devcentral/terraform-provider-bigip/tree/master/bigip for list of resources. If you encounter any problems, please create an issue at https://github.com/f5devcentral/terraform-provider-bigip/issues one of us will get back to you. I hope this is helpful and keep an eye out for more to come.