Skip to content

docs(azure-vmss): update docs and added examples#890

Draft
pablosanchezpaz wants to merge 5 commits intomainfrom
add/azure-vmss-docs
Draft

docs(azure-vmss): update docs and added examples#890
pablosanchezpaz wants to merge 5 commits intomainfrom
add/azure-vmss-docs

Conversation

@pablosanchezpaz
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds terraform-docs scaffolding and example artifacts for the azure-vmss Terraform module to improve module documentation and provide a basic example configuration.

Changes:

  • Add terraform-docs header/footer sources and configure terraform-docs injection for the module README.
  • Add a new “basic” example (_examples/basic) with both Terraform and YAML values.
  • Update README.md with injected terraform-docs content including examples and links.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
modules/azure-vmss/docs/header.md New header content for terraform-docs, including overview/features and example blocks.
modules/azure-vmss/docs/footer.md New footer content with examples link and support/resources.
modules/azure-vmss/_examples/basic/values.yaml Adds YAML values file intended for the basic example.
modules/azure-vmss/_examples/basic/main.tf Adds a basic Terraform example using the module.
modules/azure-vmss/README.md Injects terraform-docs output into README (currently duplicating content outside the markers).
modules/azure-vmss/.terraform-docs.yml Adds terraform-docs configuration to generate/inject README content from header/footer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 39 to 43
image_version = "latest"
identity_type = "SystemAssigned"
cloud_init = file("./cloud-init.yml")
run_script = file("./init-script.sh")
}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vmss example also omits required networking input (network_interface_public_ip_adress_public_ip_prefix_id) and other fields that the module dereferences unconditionally (e.g., subnet/vnet details). As a result, the example will not work when copied; please include the required networking attributes.

Copilot uses AI. Check for mistakes.
Comment on lines 17 to 44
common = {
resource_group_name = "my-resource-group"
location = "eastus"
tags_from_rg = true

vmss = {
name = "my-vmss"
sku = "Standard_DS2_v2"
instances = 3
admin_username = "azureuser"
admin_ssh_key_username = "ssh-user"
first_public_key = "ssh-rsa AAAAB3NzaC1yc2..."
eviction_policy = "Delete"
secure_boot_enabled = true
disk_storage_account_type = "Standard_LRS"
disk_caching = "ReadWrite"
upgrade_mode = "Rolling"
rolling_upgrade_policy_max_batch_instance_percent = 20
rolling_upgrade_policy_max_unhealthy_instance_percent = 20
image_publisher = "Canonical"
image_offer = "UbuntuServer"
image_sku = "18.04-LTS"
image_version = "latest"
identity_type = "SystemAssigned"
cloud_init = file("./cloud-init.yml")
run_script = file("./init-script.sh")
}
}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fenced yaml example is not valid YAML (it uses HCL-style =/{} and the HCL file() function). Please replace it with a YAML tfvars-style example like _examples/basic/values.yaml (common: / vmss: / tags_from_rg: / tags:).

Suggested change
common = {
resource_group_name = "my-resource-group"
location = "eastus"
tags_from_rg = true
vmss = {
name = "my-vmss"
sku = "Standard_DS2_v2"
instances = 3
admin_username = "azureuser"
admin_ssh_key_username = "ssh-user"
first_public_key = "ssh-rsa AAAAB3NzaC1yc2..."
eviction_policy = "Delete"
secure_boot_enabled = true
disk_storage_account_type = "Standard_LRS"
disk_caching = "ReadWrite"
upgrade_mode = "Rolling"
rolling_upgrade_policy_max_batch_instance_percent = 20
rolling_upgrade_policy_max_unhealthy_instance_percent = 20
image_publisher = "Canonical"
image_offer = "UbuntuServer"
image_sku = "18.04-LTS"
image_version = "latest"
identity_type = "SystemAssigned"
cloud_init = file("./cloud-init.yml")
run_script = file("./init-script.sh")
}
}
common:
resource_group_name: "my-resource-group"
location: "eastus"
tags_from_rg: true
tags:
environment: "dev"
project: "my-project"
vmss:
name: "my-vmss"
sku: "Standard_DS2_v2"
instances: 3
admin_username: "azureuser"
admin_ssh_key_username: "ssh-user"
first_public_key: "ssh-rsa AAAAB3NzaC1yc2..."
eviction_policy: "Delete"
secure_boot_enabled: true
disk_storage_account_type: "Standard_LRS"
disk_caching: "ReadWrite"
upgrade_mode: "Rolling"
rolling_upgrade_policy_max_batch_instance_percent: 20
rolling_upgrade_policy_max_unhealthy_instance_percent: 20
image_publisher: "Canonical"
image_offer: "UbuntuServer"
image_sku: "18.04-LTS"
image_version: "latest"
identity_type: "SystemAssigned"
cloud_init: "./cloud-init.yml"
run_script: "./init-script.sh"

Copilot uses AI. Check for mistakes.
Comment on lines 17 to 21
common = {
resource_group_name = "my-resource-group"
location = "eastus"
tags_from_rg = true

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tags_from_rg is shown inside common, but common only contains resource_group_name and location per variables.tf. This example will fail type-checking; move tags_from_rg to the top level (sibling of common/vmss) and ensure the common object is properly closed.

Copilot uses AI. Check for mistakes.
Comment on lines 123 to 127
```yaml
common = {
resource_group_name = "my-resource-group"
location = "eastus"
tags_from_rg = true
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The yaml example under BEGIN_TF_DOCS is not valid YAML (it uses HCL-style =/{}) and nests tags_from_rg under common, which violates the common object type. Please switch to a YAML tfvars-style example and keep tags_from_rg at the top level.

Copilot uses AI. Check for mistakes.
network_interface_public_ip_adress_public_ip_prefix_id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Network/publicIPPrefixes/example-prefix

identity_type: SystemAssigned
cloud_init: null
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud_init: null will fail with the current module implementation because main.tf always evaluates base64encode(var.vmss.cloud_init); base64encode(null) is an error. Update the example to provide a (possibly empty/minimal) cloud-init string, or change the module to set custom_data = null when cloud_init is null.

Suggested change
cloud_init: null
cloud_init: |
#cloud-config

Copilot uses AI. Check for mistakes.

identity_type = "SystemAssigned"

cloud_init = null
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud_init = null will fail with the current module implementation because the module always base64-encodes vmss.cloud_init. Update the example to pass a string (or adjust the module to handle null by setting custom_data = null).

Suggested change
cloud_init = null
cloud_init = ""

Copilot uses AI. Check for mistakes.
Comment on lines 140 to 144
upgrade_mode = "Rolling"
rolling_upgrade_policy_max_batch_instance_percent = 20
rolling_upgrade_policy_max_unhealthy_instance_percent = 20
image_publisher = "Canonical"
image_offer = "UbuntuServer"
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example vmss block is missing required rolling_upgrade_policy_* attributes and required networking input like network_interface_public_ip_adress_public_ip_prefix_id. Please add the required fields (or make them optional in the module) so the README example is actually runnable.

Copilot uses AI. Check for mistakes.
Comment on lines 33 to 37
upgrade_mode = "Rolling"
rolling_upgrade_policy_max_batch_instance_percent = 20
rolling_upgrade_policy_max_unhealthy_instance_percent = 20
image_publisher = "Canonical"
image_offer = "UbuntuServer"
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This vmss example is incomplete relative to the required vmss object type: multiple rolling_upgrade_policy_* attributes are required (e.g., max_unhealthy_upgraded_instance_percent, pause_time_between_batches, and the boolean flags) but are not provided here. Please add the required fields so the example can be applied as-is.

Copilot uses AI. Check for mistakes.
Comment on lines +107 to +109
<!-- BEGIN_TF_DOCS -->
# Azure Virtual Machine Scale Set (VMSS) Terraform Module

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md now contains a large block of content before <!-- BEGIN_TF_DOCS -->. In other modules in this repo, the README is fully managed inside the terraform-docs inject markers (the file starts with BEGIN_TF_DOCS), otherwise the documentation is duplicated and terraform-docs won't manage the preamble. Consider removing the pre-marker content (or switching terraform-docs output mode) so the README is fully generated consistently.

Copilot uses AI. Check for mistakes.
@pablosanchezpaz
Copy link
Contributor Author

Related to #786

@pablosanchezpaz pablosanchezpaz marked this pull request as draft February 11, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants