Skip to content
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

Merged
merged 3 commits into from
Aug 14, 2016

Conversation

rjeczalik
Copy link
Contributor

@rjeczalik rjeczalik commented Aug 12, 2016

Hey!

This PR adds custom_data field to azure_instance resource. Azure SDK was updated to 3.2.0-beta to include custom_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.

@stack72
Copy link
Contributor

stack72 commented Aug 14, 2016

Hi @rjeczalik

Thanks for the PR here. This LGTM! Thanks for including the test run as well :)

Paul

@stack72 stack72 merged commit 760e022 into hashicorp:master Aug 14, 2016
@rjeczalik rjeczalik deleted the custom-data branch August 14, 2016 11:10
@sampcoug
Copy link

sampcoug commented Apr 8, 2019

@stack72 @rjeczalik - I tried using "custom_data" argument to the " azurerm_virtual_machine_scale_set" resource. Terraform failed with the error below:

Error: azurerm_virtual_machine_scale_set.poc: : invalid or unknown key: custom_data

Is "custom_data" supported for this resource?

@rjeczalik
Copy link
Contributor Author

@sampcoug custom_data is available for azure_instance resource, not the azurerm_virtual_machine_scale_set one.

@sampcoug
Copy link

sampcoug commented Apr 9, 2019

@rjeczalik It worked for when I ran it. The os_profile supports it. So, for anyone trying to make it work for azurerm_virtual_machine_scale_set here is what I did:

  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")}"
    }
  }```

@rjeczalik
Copy link
Contributor Author

@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.

@ghost
Copy link

ghost commented Aug 13, 2019

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.

@ghost ghost locked and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants