Home > database >  terraform: metadata_startup_script like mechanism for azure
terraform: metadata_startup_script like mechanism for azure

Time:06-17

I'm following a blog to Deploy a Debian Linux VM Instance in GCP using Terraform, in which it uses metadata_startup_script Bootstrapping Script to Install/config packages.

I'm following in Azure instead of GCP, and got:

An argument named "metadata_startup_script" is not expected here.

Is metadata_startup_script GCP provider speicific? What's the corresponding mechanism in the terraform Azure provider ? For e.g. to do the following,

sudo apt-get update; 
sudo apt-get install -y apache2;
sudo systemctl start apache2;
sudo systemctl enable apache2;

to bootstrap the provided Linux VM?

CodePudding user response:

The attribute metadata_startup_script doesn't exist on Azure VMs, its similar is user_data[1].

References: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine#user_data

  • Related