Skip to content

Terraform Transformer Component

Tom Barber edited this page Jun 9, 2022 · 7 revisions

Background

This component will help users who want to stand up various AWS services by adding various required attributes to supported Terraform scripts. Also for users who don't want to deploy hardware without the complexity of writing fully fledged Terraform scripts, the Transformer can build out Terraform scripts from stubs by placing in sensible defaults where required to ensure you have a scalable environment to build your application in.

Tags

The Terraform transformer will extend and enhance your tags so we can track services within Unity. The system will take any existing tags, and extend that block with default tags relating to the software being deployed. If you don't define any tags we will apply our tags for you. If you define tags, we'll ensure the mandatory tags comply with the service and leave any other tags untouched.

Mandatory Tags

To run services within Unity, various mandatory tags need to be applied. The Transformer component can apply these tags. Some are generated and applied at deploy time some are read from project metadata. You can find out more about the mandatory tags here

Networking Information

Along with tags, the environments we deploy Unity software into may differ and also the networking information may change. As such for supported components we will replace the networking information at deploy time to ensure it fits the deplyoment target. This includes VPC and Subnet information.

Automatic Sizing

Dev, Staging and Prod also have different requirements in terms of sizing, high availability etc. You can manage this yourself or you can leave out tags related to sizing and HA and we will apply our default sizing formaula's to the components to ensure we scale your environment consistently across the different venues.

Usage

You can run the Transformer locally to check the scripts. To do this follow the following instructions.

Download

Download a binary for your platform from the latest release here If you're a Mac user, you need to grab the Darwin variant, Windows and Linux are pretty obvious.

CLI

From the command line you can run the tool as follows:

./terraform-transformer parser -t tom -p test --creator tom@spicule.co.uk --venue dev --servicearea cs --capability hysds --capversion 0.0.1 --release G1.0.0 --component python --securityplan 644 --exposed true --experimental false --userfacing true --critinfra 2 --project testproj

Examples

FAQ


Q: How does the transformer component get invoked?

A: It will run transparently inside of GH actions, upon deployment


Q: Can I run the transformer manually?

A: You can run the binary directly, but it's preferred that you run it via the deployment GitHub Actions methodology, as it will be more closer to what's actually run in production.