-
Notifications
You must be signed in to change notification settings - Fork 0
docs(azure-disks): update docs and added examples #905
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| formatter: "markdown" # this is required | ||
|
|
||
| version: "" | ||
|
|
||
| header-from: docs/header.md | ||
| footer-from: docs/footer.md | ||
|
|
||
| recursive: | ||
| enabled: false | ||
| path: modules | ||
| include-main: true | ||
|
|
||
| sections: | ||
| hide: [] | ||
| show: [] | ||
|
|
||
| content: "" | ||
|
|
||
| output: | ||
| file: "README.md" | ||
| mode: inject | ||
| template: |- | ||
| <!-- BEGIN_TF_DOCS --> | ||
| {{ .Content }} | ||
| <!-- END_TF_DOCS --> | ||
|
|
||
| output-values: | ||
| enabled: false | ||
| from: "" | ||
|
|
||
| sort: | ||
| enabled: true | ||
| by: name | ||
|
|
||
| settings: | ||
| anchor: true | ||
| color: true | ||
| default: true | ||
| description: false | ||
| escape: true | ||
| hide-empty: false | ||
| html: true | ||
| indent: 2 | ||
| lockfile: true | ||
| read-comments: true | ||
| required: true | ||
| sensitive: true | ||
| type: true |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||
| // Basic example: create managed disks using the azure-disks module | ||||||||||
|
|
||||||||||
| module "azure_disks" { | ||||||||||
| source = "../../" | ||||||||||
|
|
||||||||||
| location = "westeurope" | ||||||||||
| resource_group_name = "example-rg" | ||||||||||
|
|
||||||||||
| disks = { | ||||||||||
| data1 = { | ||||||||||
| # This map is intentionally loose; adapt keys to match main.tf expectations. | ||||||||||
|
||||||||||
| # This map is intentionally loose; adapt keys to match main.tf expectations. | |
| # `disks` is a map keyed by disk name. Each disk must at least define | |
| # `size_gb`, `sku`, and `create_option`; optional attributes include | |
| # `zone`, `encryption_type`, `disk_iops_read_write`, and `disk_mbps_read_write`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Basic example values for azure-disks module | ||
|
|
||
| location: westeurope | ||
| resource_group_name: example-rg | ||
|
|
||
| disks: | ||
| data1: | ||
| size_gb: 128 | ||
| sku: Premium_LRS | ||
| zone: "1" | ||
| create_option: Empty | ||
| encryption_type: EncryptionAtRestWithPlatformKey | ||
| disk_iops_read_write: 500 | ||
| disk_mbps_read_write: 100 | ||
|
|
||
| assign_role: false | ||
| role_definition_name: Contributor | ||
| principal_id: "" | ||
|
|
||
| tags: | ||
| environment: dev | ||
| application: example |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | ||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Examples | ||||||||||||||
|
|
||||||||||||||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azure-disks/_examples): | ||||||||||||||
|
|
||||||||||||||
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azure-disks/_examples/basic) - Basic managed disk configuration with size, SKU and performance settings. | ||||||||||||||
|
Comment on lines
+5
to
+7
|
||||||||||||||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azure-disks/_examples): | |
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azure-disks/_examples/basic) - Basic managed disk configuration with size, SKU and performance settings. | |
| For detailed examples, refer to the [module examples](./_examples): | |
| - [basic](./_examples/basic) - Basic managed disk configuration with size, SKU and performance settings. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Azure Managed Disks Terraform Module | ||
|
|
||
| ## Overview | ||
|
|
||
| This Terraform module allows you to create and manage managed disks in Azure, with support for: | ||
| - Creation of multiple disks with different configurations. | ||
| - Optional role assignment on disks. | ||
| - Flexible tagging and tag inheritance from the Resource Group. | ||
|
|
||
| ## Main features | ||
| - Create managed disks of different types and sizes. | ||
| - Optional role assignment to disks (e.g., Contributor). | ||
| - Support for tags and inheritance from the Resource Group. | ||
| - Ignores disk size changes in lifecycle (useful for CSI Driver). | ||
|
|
||
| ## Complete usage example | ||
|
||
|
|
||
| ```yaml | ||
| values: | ||
| tags_from_rg: true | ||
| resource_group_name: "REDACTED-RESOURCE-GROUP" | ||
| location: "REDACTED-LOCATION" | ||
| disks: | ||
| - name: disk-1 | ||
| storage_account_type: StandardSSD_LRS | ||
| - name: disk-2 | ||
| - name: disk-3 | ||
| - name: disk-4 | ||
| ``` | ||
|
|
||
| ## Notes | ||
| - You can create empty disks or base them on another disk. | ||
| - Assigning a role to a disk is not mandatory. | ||
| - Disk size is ignored in changes to avoid conflicts with the CSI Driver. | ||
|
|
||
| ## File structure | ||
|
|
||
| ``` | ||
| . | ||
| ├── main.tf | ||
| ├── variables.tf | ||
| ├── outputs.tf | ||
| ├── versions.tf | ||
| ├── README.md | ||
| ├── CHANGELOG.md | ||
| └── docs/ | ||
| ├── header.md | ||
| └── footer.md | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as
docs/header.md: the README usage example documentsdisksas a list and usesstorage_account_type, but the concrete example added in_examples/basicuses a map andsku. Please make README’s “Complete usage example” consistent with the real example and the module inputs to avoid misleading users.