Skip to content

Commit

Permalink
Merge pull request #889 from terraform-providers/b-vmss-computer_name…
Browse files Browse the repository at this point in the history
…_prefix

Updated virtual_machine_scale_set computer_name_prefix
  • Loading branch information
katbyte authored Feb 26, 2018
2 parents ff4afd3 + 47abd0b commit 2071fad
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 64 deletions.
1 change: 1 addition & 0 deletions azurerm/resource_arm_virtual_machine_scale_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource {
"computer_name_prefix": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},

"admin_username": {
Expand Down
2 changes: 0 additions & 2 deletions examples/vmss-ubuntu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ The `main.tf` file contains the actual resources that will be deployed. It also
## outputs.tf
This data is outputted when `terraform apply` is called, and can be queried using the `terraform output` command.

## provider.tf
You may leave the provider block in the `main.tf`, as it is in this template, or you can create a file called `provider.tf` and add it to your `.gitignore` file.

Azure requires that an application is added to Azure Active Directory to generate the `client_id`, `client_secret`, and `tenant_id` needed by Terraform (`subscription_id` can be recovered from your Azure account details). Please go [here](https://www.terraform.io/docs/providers/azurerm/) for full instructions on how to create this to populate your `provider.tf` file.
Expand All @@ -19,4 +18,3 @@ If a `terraform.tfvars` or any `.auto.tfvars` files are present in the current d
## variables.tf
The `variables.tf` file contains all of the input parameters that the user can specify when deploying this Terraform template.

![`terraform graph`](graph.png)
35 changes: 0 additions & 35 deletions examples/vmss-ubuntu/deploy.ci.sh

This file was deleted.

15 changes: 0 additions & 15 deletions examples/vmss-ubuntu/deploy.mac.sh

This file was deleted.

Binary file removed examples/vmss-ubuntu/graph.png
Binary file not shown.
8 changes: 4 additions & 4 deletions examples/vmss-ubuntu/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# }

resource "azurerm_resource_group" "rg" {
name = "${var.resource_group}"
name = "${var.resource_group_name}"
location = "${var.location}"
}

resource "azurerm_virtual_network" "vnet" {
name = "${var.resource_group}vnet"
name = "${var.resource_group_name}vnet"
location = "${azurerm_resource_group.rg.location}"
address_space = ["10.0.0.0/16"]
resource_group_name = "${azurerm_resource_group.rg.name}"
Expand Down Expand Up @@ -62,7 +62,7 @@ resource "azurerm_lb_nat_pool" "np" {
}

resource "azurerm_storage_account" "stor" {
name = "${var.resource_group}stor"
name = "${var.resource_group_name}stor"
location = "${azurerm_resource_group.rg.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
account_tier = "${var.storage_account_tier}"
Expand Down Expand Up @@ -91,7 +91,7 @@ resource "azurerm_virtual_machine_scale_set" "scaleset" {
}

os_profile {
computer_name_prefix = "${var.vmss_name}"
computer_name_prefix = "${var.vmss_name_prefix}"
admin_username = "${var.admin_username}"
admin_password = "${var.admin_password}"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/vmss-ubuntu/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "hostname" {
value = "${var.vmss_name}"
value = "${var.vmss_name_prefix}"
}
6 changes: 3 additions & 3 deletions examples/vmss-ubuntu/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# variable "client_secret" {}
# variable "tenant_id" {}

variable "resource_group" {
variable "resource_group_name" {
description = "The name of the resource group in which to create the virtual network."
}

Expand Down Expand Up @@ -46,8 +46,8 @@ variable "image_offer" {
default = "UbuntuServer"
}

variable "vmss_name" {
description = "String used as a base for naming resources. Must be 3-61 characters in length and globally unique across Azure. A hash is prepended to this string for some resources, and resource-specific information is appended."
variable "vmss_name_prefix" {
description = "String used as a base for naming resources. Must be 1-9 characters in length for windows and 1-58 for linux images and globally unique across Azure. A hash is prepended to this string for some resources, and resource-specific information is appended."
}

variable "instance_count" {
Expand Down
8 changes: 4 additions & 4 deletions website/docs/r/virtual_machine_scale_set.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ resource "azurerm_virtual_machine_scale_set" "test" {
}
storage_profile_data_disk {
lun = 0
lun = 0
caching = "ReadWrite"
create_option = "Empty"
disk_size_gb = 10
Expand Down Expand Up @@ -270,10 +270,10 @@ The following arguments are supported:

`os_profile` supports the following:

* `computer_name_prefix` - (Required) Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long.
* `computer_name_prefix` - (Required) Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 9 characters long for windows images and 1 - 58 for linux. Changing this forces a new resource to be created.
* `admin_username` - (Required) Specifies the administrator account name to use for all the instances of virtual machines in the scale set.
* `admin_password` - (Required) Specifies the administrator password to use for all the instances of virtual machines in a scale set..
* `custom_data` - (Optional) Specifies custom data to supply to the machine. On linux-based systems, this can be used as a cloud-init script. On other systems, this will be copied as a file on disk. Internally, Terraform will base64 encode this value before sending it to the API. The maximum length of the binary array is 65535 bytes.
* `admin_password` - (Required) Specifies the administrator password to use for all the instances of virtual machines in a scale set.
* `custom_data` - (Optional) Specifies custom data to supply to the machine. On linux-based systems, this can be used as a cloud-init script. On other systems, this will be copied as a file on disk. Internally, Terraform will base64 encode this value before sending it to the API. The maximum length of the binary array is 65535 bytes.

`os_profile_secrets` supports the following:

Expand Down

0 comments on commit 2071fad

Please sign in to comment.