-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provider/azure: add custom_data argument for azure_instance resource #8158
Conversation
Hi @rjeczalik Thanks for the PR here. This LGTM! Thanks for including the test run as well :) Paul |
@stack72 @rjeczalik - I tried using "custom_data" argument to the " azurerm_virtual_machine_scale_set" resource. Terraform failed with the error below:
Is "custom_data" supported for this resource? |
@sampcoug |
@rjeczalik It worked for when I ran it. The name = "${var.env_prefix}${var.shortname}-scaleset"
location = "${var.region}"
resource_group_name = "${var.resource_group_name}"
upgrade_policy_mode = "Manual"
zones = [1,2,3]
sku {
name = "Standard_D16s_v3"
tier = "Standard"
capacity = 2
}
storage_profile_image_reference {
publisher = "CoreOS"
offer = "CoreOS"
sku = "Stable"
version = "1911.4.0"
}
storage_profile_os_disk {
name = ""
caching = "ReadWrite"
create_option = "FromImage"
managed_disk_type = "Standard_LRS"
}
storage_profile_data_disk {
lun = 0
caching = "ReadWrite"
create_option = "Empty"
disk_size_gb = 100
}
os_profile {
computer_name_prefix = "${var.env_prefix}xxx"
admin_username = "azureuser"
custom_data = "${element(data.ct_config.service.*.rendered, count.index)}"
}
os_profile_linux_config {
disable_password_authentication = true
ssh_keys {
path = "/home/azureuser/.ssh/authorized_keys"
key_data = "${file("xx")}"
}
}``` |
@sampcoug Correct, indeed it has changed last time I used it - https://www.terraform.io/docs/providers/azurerm/r/virtual_machine_scale_set.html#custom_data. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hey!
This PR adds
custom_data
field to azure_instance resource.Azure SDK was updated to 3.2.0-beta to includecustom_data
support on the client side - Azure/azure-sdk-for-go#381.Azure tests passed - results: https://gist.github.com/rjeczalik/bfb32e5aecb51be23d64149b48d8210e.
Please take a look.