Terraform how-to: create a variable list of numbered items
In a couple of templates I worked on I came across the need to create a variable list of numbered strings that is a product of a different list.
Dealing with this kind of thing is easy when you’re dealing with resources (that support
count). It’s less straight-forward when you need to create a
local variable, say, to use for a resource’s value, or an
output, that don’t.
Let’s have a look at a dirty hack that can help. 🙂
Use Pulse Virtual Traffic Manager to route traffic to Kubernetes pods
Pulse Virtual Traffic Manager (vTM) v18.1 introduced new Service Discovery mechanism to help with situations where vTM sits in front of an application made up from dynamic components.
Many organisations are now either use or experimenting with Kubernetes (K8s). Let’s see if we can get this Service Discovery mechanism to help us expose an application running on K8s to the Internet:
- In a way that works both in public clouds and on-prem;
- Supports session persistence and per-pod health checks;
- Can scale really well; and
- Is highly available*.
*The above assumes that you operate a production-grade HA cluster of vTMs somewhere where they can reach your K8s nodes running your application pods.
Let’s Terraform the vTM: Part 4 / 4
Continuing from Part 1, Part 2, and Part 3, in this final instalment we’ll finish our configuration by adding things like SSL offload and L7 routing.
Let’s Terraform the vTM: Part 3 / 4
Carrying on from Part 1 and Part 2, in this instalment we’ll continue adding to our configuration.
If you’re back with us after a break – feel free to go over the part 1 and 2 again, and if you’re following along – make sure your set-up is all good, and the very last exercise from Part 2 completes correctly.
Let’s Terraform the vTM: Part 2 / 4
Continuing from Part 1, today we’ll make our template do something useful. If you’re following along – make sure your set-up is all good, and the very last exercise of Part 1 completes correctly.
Ready? Let’s carry on!
Let’s Terraform the vTM: Part 1 / 4
The freshly-released Pulse Virtual Traffic Manager (vTM) v18.1 comes out with a Terraform Provider for vTM. The provider ships with 100% coverage for all vTM’s REST API resources, and includes support for the API version 4.0 that goes back to vTM 17.2, and the API version 5.2 that includes all the newest features that shipped with vTM 18.1.
In this 4-part post we’ll do a quick introduction of Terraform provider for vTM, and show how it can help you support the needs of your applications.
New version of the CloudFormation template for Pulse vTM
Quick announcement – I’ve published a new version of the CloudFormation template that deploys a HA cluster of Pulse vTM instances into an existing VPC.
- Suitable for using as a module in bigger stacks, e.g., CloudFormation or Terraform that take care of the VPC and other infrastructure. Has been tested with the later.
- Updated with the latest vTM AMIs for 17.2r2, 17.3, 17.4, and 18.1.
- Supports additional Security Groups (e.g., when your target instances use SG with Source based on SG name).
- Can take UserData from Pulse Service Director’s Cloud Registrations for self-registration.
Please see README for full details, especially the Disclaimer at the beginning. 🙂
When developing your Infrastructure as Code CloudFormation templates, you sometimes need to associate your resources with a list of Security Groups (SG) which may need to be configurable. For example, your resource may have a primary SG, and a list of optional SGs that can be specified at template deployment time.
I recently went through a somewhat painful exercise figuring out how to implement this, and that’s what I’m here to share with you.
* Yes, I do understand that Lambda@Edge will provide a completely different level of scale and performance, and is an industrialised managed offering. None the less, what’s described below could serve many use cases just fine. 😉
With that, on to it.
There’s no point arguing that Single Page Apps (SPAs) are in vogue. One of the approaches to SPAs is to move business logic into the client, and leverage a range of API-based services to provide needed server-side functionality. Here’s a very good argument presented on this topic: Joe Emison – 10X Product Development.
A side effect of following this pattern is your SPA code ends up on a server that only knows how to serve your static client content (html / js / css / images). This may present a problem when you try to integrate your SPA with another stand-alone application, for example, blog hosted by WordPress.
Let’s have a look in a bit more detail, followed by what can be done about it.
Last time we’ve talked about the concept of Infrastructure as Code (IaC), and introduced two most prominent tools in the space, AWS CloudFormation and Hashicorp Terraform.
In this post, we’ll have a look at an AWS CloudFormation template that you can use to deploy a cluster of 2 x Brocade Virtual Traffic Managers with WAF into a new AWS VPC; what makes up that template; and how it all works.
We will take things quite slowly here. Some basic understanding of automation and/or scripting/programming will help, but not strictly necessary.
If on other hand you’re already well-versed in AWS CloudFormation but still interested in automating deployment of Brocade Virtual Traffic Managers in AWS, feel free to jump straight to the GitHub repo, and optionally read the vADC EC2 Instances section below.
Please note that this is work in progress and the code you’ll find there has no official support at this time, but rest assured, it is coming! 🙂