-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add type definitions in usage examples (#135)
* feat: add type definitions in usage examples * feat: fix formatting * feat: update documentation --------- Co-authored-by: dkool <[email protected]>
- Loading branch information
Showing
31 changed files
with
285 additions
and
884 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,27 @@ | ||
This module enables flexible virtual machine setup by supporting both auto generated and user supplied (bring your own) ssh keys and passwords for tailored access. | ||
# Authentication | ||
|
||
## Usage: generated password or ssh key | ||
This displays authentication settings available for deployment. | ||
|
||
To utilize the generated password or ssh key, simply specify the key vault id in your configuration: | ||
## Types | ||
|
||
```hcl | ||
module "vm" { | ||
source = "cloudnationhq/vm/azure" | ||
version = "~> 3.0" | ||
naming = local.naming | ||
depends_on = [module.kv] | ||
instance = { | ||
name = module.naming.linux_virtual_machine.name | ||
location = module.rg.groups.demo.location | ||
resourcegroup = module.rg.groups.demo.name | ||
type = "linux" | ||
interfaces = { | ||
int1 = { | ||
subnet = module.network.subnets.int.id | ||
ip_configurations = { | ||
config1 = { | ||
private_ip_address_allocation = "Dynamic" | ||
} | ||
} | ||
} | ||
} | ||
keyvault_id = module.kv.vault.id | ||
} | ||
} | ||
instance = object({ | ||
name = string | ||
location = string | ||
resource_group = string | ||
public_key = optional(string) | ||
type = string | ||
interfaces = map(object({ | ||
subnet = string | ||
ip_configurations = map(object({ | ||
private_ip_address_allocation = string | ||
})) | ||
})) | ||
}) | ||
``` | ||
|
||
## Usage: bringing your own password or ssh key | ||
|
||
To use your own password or SSH key, use the below properties in your configuration: | ||
|
||
```hcl | ||
module "vm" { | ||
source = "cloudnationhq/vm/azure" | ||
version = "~> 1.3" | ||
naming = local.naming | ||
depends_on = [module.kv] | ||
## Notes | ||
|
||
instance = { | ||
name = module.naming.linux_virtual_machine.name | ||
location = module.rg.groups.demo.location | ||
resourcegroup = module.rg.groups.demo.name | ||
public_key = module.kv.tls_public_keys.vm-linux-demo-dev-key.value | ||
type = "linux" | ||
public_key is used for linux machines, while password is used for windows machines in a BYO (Bring Your Own) configuration. | ||
|
||
interfaces = { | ||
int1 = { | ||
subnet = module.network.subnets.int.id | ||
ip_configurations = { | ||
config1 = { | ||
private_ip_address_allocation = "Dynamic" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
```hcl | ||
module "vm" { | ||
source = "cloudnationhq/vm/azure" | ||
version = "~> 1.3" | ||
naming = local.naming | ||
depends_on = [module.kv] | ||
instance = { | ||
name = module.naming.linux_virtual_machine.name | ||
location = module.rg.groups.demo.location | ||
resourcegroup = module.rg.groups.demo.name | ||
password = module.kv.secrets.vm-linux-demo-dev-password.value | ||
type = "linux" | ||
interfaces = { | ||
int1 = { | ||
subnet = module.network.subnets.int.id | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
Both are optional; if omitted, secrets will be automatically generated. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,36 @@ | ||
This example outlines the configuration and deployment of availability sets to ensure high availability and fault tolerance. | ||
# Availability Sets | ||
|
||
## Usage | ||
This deploys availability sets on the virtual machine to be utilized. | ||
|
||
```hcl | ||
module "vm" { | ||
source = "cloudnationhq/vm/azure" | ||
version = "~> 3.0" | ||
## Types | ||
|
||
naming = local.naming | ||
keyvault = module.kv.vault.id | ||
resourcegroup = module.rg.groups.demo.name | ||
location = module.rg.groups.demo.location | ||
depends_on = [module.kv] | ||
```hcl | ||
instance = object({ | ||
type = string | ||
name = string | ||
resource_group = string | ||
location = string | ||
custom_data = optional(string) | ||
interfaces = map(object({ | ||
subnet = string | ||
ip_configurations = map(object({ | ||
private_ip_address_allocation = optional(string) | ||
private_ip_address = optional(string) | ||
primary = optional(bool) | ||
})) | ||
})) | ||
availability_set_id = optional(string) | ||
}) | ||
``` | ||
|
||
instance = { | ||
name = module.naming.virtual_machine.name | ||
type = "linux" | ||
interfaces = { | ||
dcroot001 = { | ||
subnet = module.network.subnets.int.id | ||
ip_configurations = { | ||
config1 = { | ||
private_ip_address_allocation = "Dynamic" | ||
} | ||
} | ||
} | ||
} | ||
disks = { | ||
dcroot001 = { | ||
disk_size_gb = 128 | ||
lun = 0 | ||
} | ||
} | ||
availability_set_id = module.availability.sets.demo.id | ||
} | ||
} | ||
```hcl | ||
availability_sets = map(object({ | ||
name = string | ||
resource_group = string | ||
location = string | ||
})) | ||
``` | ||
|
||
module "availability" { | ||
source = "cloudnationhq/vm/azure//modules/availability-sets" | ||
version = "~> 0.1" | ||
## Notes | ||
|
||
availability_sets = { | ||
demo = { | ||
name = module.naming.availability_set.name | ||
resourcegroup = module.rg.groups.demo.name | ||
location = module.rg.groups.demo.location | ||
} | ||
} | ||
} | ||
``` | ||
The submodule enables setting up multiple availability sets and assigning virtual machines to specific zones. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.