Accessing ARM preview features in Terraform

Terraform helps users get the most out of their cloud when provisioning infrastructure in an automated and repeatable way. Azure Resource Manager (ARM) forms the basis for Azure’s Infrastructure as Code solution, and internally, Terraform communicates with ARM. However, because of the separation between Azure’s own internal representation and Terraform’s own internal representation of Azure’s API, certain preview features may not be immediately accessible to users. When features are not available in the azurerm provider, users can take advantage of the AzAPI Provider instead to access those new features — including any previews — since it exists as a thin layer over ARM. For those ready to move to GA eventually, a migration tool is available to easily shift from AzAPI Provider over to the standard azurerm Provider.

I recently created a sample terraform script that uses a preview APIs to create a PostgreSQL instance with customer managed keys (CMK) enabled.

This is how you typically create a postgresql server resource:

And this is how it looks like using the AzAPI Provider:

The full script is available here on GitHub:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aymen Furter

I am a Cloud Solution Architect working for Microsoft. The views expressed on this site are mine alone and do not necessarily reflect the views of my employer.