/cdktf-go-azurerm

Example of provisioning azurerm resources in Go via terraform-cdk

Primary LanguageGoMIT LicenseMIT

cdktf-go-azurerm

Example of provisioning azurerm resources in Go via terraform-cdk.

Requirements

  • cdktf 0.7.0
  • your favourite text editor

Setup

To set up azurerm provider either set ARM* environment variables or modify the relevant section, I left the Subscription ID line as an example.

NOTE: You either need to set NODE_OPTIONS environment variable to 16GBs via

export NODE_OPTIONS='--max_old_space_size=15000'

or invoke cdktf with the command below. See

git clone https://github.com/waxb/cdktf-go-azurerm.git && cd cdktf-go-azurerm
NODE_OPTIONS='--max_old_space_size=16384' cdktf get

If you don't have 16GBs of memory, you can get the generated go provider from here

Go to the directory where this repository was cloned:

mkdir -p generated/hashicorp && cd $_
git clone https://github.com/waxb/azurerm.git

Create test infrastructure

cdktf deploy

Covered examples

  • Provider initialisation 1 2
  • Module instance creation 1 2 (Null Module at the moment because of limitations, see)
  • Resource creation and reference 1 2 3 4 5
  • Terraform built in function usage 1
  • Module output reference 1
  • Multiple outputs 1

Cleanup

Do not forget to clean up the mess we've caused at microsoft, they have enough money and overused compute resources already!

cdktf destroy