I have a Terraform script that creates a Virtual Machine on Azure based on this image from the Azure Marketplace: https://azuremarketplace.microsoft.com/en-us/marketplace/apps/gitlab.gitlab-ce
But I don't know how to identify the values to put in these fields:
- publisher
- offer
- sku
- version
This is a snippet from the Terraform script
resource "azurerm_virtual_machine" "gitlab_vm" {
# ... other configuration
storage_image_reference {
publisher = "GitLab"
offer = "GitLab Community Edition"
# sku = "???"
version = "latest"
}
# ... other configuration
}
If I run the previous details with terraform plan
and e.g. publisher = "GitLabXXX"
(something that does not exist), then Terraform does not raise any error. When I run terraform apply
after a while an error is raised and the VM resource is not created (although all the other resources e.g. the networking stuff are created).
This applies in a similar way to Azure ARM templates:
"imageReference": {
"publisher": "[variables('pubName')]",
"offer": "[variables('offerName')]",
"sku" : "[parameters('skuName')]",
"version":"latest"
},
I have some virtual machine that are up and running with a similar Terraform configuration that I found on the internet (see the Ubuntu example below), but what are the rules to translate the information from the Azure Marketplace webpage to the script?
storage_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "16.04-LTS"
version = "latest"
}