Blog
read more
Multi-part cloud-init provisioning with Terraform
Cloud-Init is “a standard for customizing” cloud instances, typically on their first boot. It is allows mixing state-based configuration management with imperative provisioning commands (details in our IaC article). By using cloud-init most of the annoyances of SSH-based provisioning can be avoided:
-
Having to use (possibly shared) SSH keys for provisioning
-
Having to have direct network access to the VM being provisioned (may require a VPN connection)
That said, neither cloud-init itself, nor its use within Terraform is particularly well documented. Therefore it can be an effort to create cloud-init-based provisioning that works and adapts easily to different use-cases. This article attempts to fill that gap to some extent.