diff --git a/modules/vsphere/datacenter/README.md b/modules/vsphere/datacenter/README.md
new file mode 100755
index 00000000..80552dcc
--- /dev/null
+++ b/modules/vsphere/datacenter/README.md
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+[![Contributors][contributors-shield]][contributors-url]
+[![Forks][forks-shield]][forks-url]
+[![Stargazers][stars-shield]][stars-url]
+[![Issues][issues-shield]][issues-url]
+[![MIT License][license-shield]][license-url]
+[![LinkedIn][linkedin-shield]][linkedin-url]
+
+
+
+
+
+ The vSphere Datacenter module deploys a datacenter resource.
+
+ Explore the docs »
+
+
+ Zachary Hill
+ ·
+ Report Bug
+ ·
+ Request Feature
+
{| no | + +## Outputs + +| Name | Description | +|------|-------------| +| [id](#output\_id) | The ID of the datacenter. | +| [moid](#output\_moid) | The Managed Object ID of the datacenter. | + + + +## License + +Distributed under the MIT License. See `LICENSE.txt` for more information. + + + + + + +## Contact + +Zachary Hill - [![LinkedIn][linkedin-shield]][linkedin-url] - zhill@zacharyhill.co + +Project Link: [https://github.com/zachreborn/terraform-modules](https://github.com/zachreborn/terraform-modules) + + + + + + +## Acknowledgments + +* [Zachary Hill](https://zacharyhill.co) +* [Jake Jones](https://github.com/jakeasarus) + + + + + + +[contributors-shield]: https://img.shields.io/github/contributors/zachreborn/terraform-modules.svg?style=for-the-badge +[contributors-url]: https://github.com/zachreborn/terraform-modules/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/zachreborn/terraform-modules.svg?style=for-the-badge +[forks-url]: https://github.com/zachreborn/terraform-modules/network/members +[stars-shield]: https://img.shields.io/github/stars/zachreborn/terraform-modules.svg?style=for-the-badge +[stars-url]: https://github.com/zachreborn/terraform-modules/stargazers +[issues-shield]: https://img.shields.io/github/issues/zachreborn/terraform-modules.svg?style=for-the-badge +[issues-url]: https://github.com/zachreborn/terraform-modules/issues +[license-shield]: https://img.shields.io/github/license/zachreborn/terraform-modules.svg?style=for-the-badge +[license-url]: https://github.com/zachreborn/terraform-modules/blob/master/LICENSE.txt +[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 +[linkedin-url]: https://www.linkedin.com/in/zachary-hill-5524257a/ +[product-screenshot]: /images/screenshot.webp +[Terraform.io]: https://img.shields.io/badge/Terraform-7B42BC?style=for-the-badge&logo=terraform +[Terraform-url]: https://terraform.io \ No newline at end of file diff --git a/modules/vsphere/datacenter/main.tf b/modules/vsphere/datacenter/main.tf new file mode 100755 index 00000000..8a9f29e7 --- /dev/null +++ b/modules/vsphere/datacenter/main.tf @@ -0,0 +1,15 @@ +terraform { + required_version = ">= 1.0.0" + required_providers { + aws = { + source = "hashicorp/vsphere" + version = ">= 2.5.0" + } + } +} + +resource "vsphere_datacenter" "this" { + folder = var.folder + name = var.name + tags = var.tags +} diff --git a/modules/vsphere/datacenter/outputs.tf b/modules/vsphere/datacenter/outputs.tf new file mode 100755 index 00000000..b701f4bc --- /dev/null +++ b/modules/vsphere/datacenter/outputs.tf @@ -0,0 +1,9 @@ +output "id" { + description = "The ID of the datacenter." + value = vsphere_datacenter.this.id +} + +output "moid" { + description = "The Managed Object ID of the datacenter." + value = vsphere_datacenter.this.moid +} diff --git a/modules/vsphere/datacenter/variables.tf b/modules/vsphere/datacenter/variables.tf new file mode 100755 index 00000000..0874b424 --- /dev/null +++ b/modules/vsphere/datacenter/variables.tf @@ -0,0 +1,17 @@ +variable "folder" { + type = string + description = "The folder where the datacenter will be created. Forces a new resource if this is changed." +} + +variable "name" { + type = string + description = "The name of the datacenter. The name needs to be unique within the folder. Forces a new resource if this is changed." +} + +variable "tags" { + type = map(string) + description = "A map of tags to assign to the datacenter." + default = { + terraform = "true" + } +} diff --git a/modules/vsphere/folder/README.md b/modules/vsphere/folder/README.md new file mode 100755 index 00000000..343fe12f --- /dev/null +++ b/modules/vsphere/folder/README.md @@ -0,0 +1,166 @@ + + + + + + + +[![Contributors][contributors-shield]][contributors-url] +[![Forks][forks-shield]][forks-url] +[![Stargazers][stars-shield]][stars-url] +[![Issues][issues-shield]][issues-url] +[![MIT License][license-shield]][license-url] +[![LinkedIn][linkedin-shield]][linkedin-url] + + + +
"terraform": "true"
}
+ This module creates a vSphere Folder resource.
+
+ Explore the docs »
+
+
+ Zachary Hill
+ ·
+ Report Bug
+ ·
+ Request Feature
+
{| no | +| [type](#input\_type) | The type of the folder. Allowed options are: datacenter, host, vm, datastore, and network. If unset, the default is host. | `string` | `"host"` | no | + +## Outputs + +No outputs. + + + +## License + +Distributed under the MIT License. See `LICENSE.txt` for more information. + + + + + + +## Contact + +Zachary Hill - [![LinkedIn][linkedin-shield]][linkedin-url] - zhill@zacharyhill.co + +Project Link: [https://github.com/zachreborn/terraform-modules](https://github.com/zachreborn/terraform-modules) + + + + + + +## Acknowledgments + +* [Zachary Hill](https://zacharyhill.co) +* [Jake Jones](https://github.com/jakeasarus) + + + + + + +[contributors-shield]: https://img.shields.io/github/contributors/zachreborn/terraform-modules.svg?style=for-the-badge +[contributors-url]: https://github.com/zachreborn/terraform-modules/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/zachreborn/terraform-modules.svg?style=for-the-badge +[forks-url]: https://github.com/zachreborn/terraform-modules/network/members +[stars-shield]: https://img.shields.io/github/stars/zachreborn/terraform-modules.svg?style=for-the-badge +[stars-url]: https://github.com/zachreborn/terraform-modules/stargazers +[issues-shield]: https://img.shields.io/github/issues/zachreborn/terraform-modules.svg?style=for-the-badge +[issues-url]: https://github.com/zachreborn/terraform-modules/issues +[license-shield]: https://img.shields.io/github/license/zachreborn/terraform-modules.svg?style=for-the-badge +[license-url]: https://github.com/zachreborn/terraform-modules/blob/master/LICENSE.txt +[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 +[linkedin-url]: https://www.linkedin.com/in/zachary-hill-5524257a/ +[product-screenshot]: /images/screenshot.webp +[Terraform.io]: https://img.shields.io/badge/Terraform-7B42BC?style=for-the-badge&logo=terraform +[Terraform-url]: https://terraform.io \ No newline at end of file diff --git a/modules/vsphere/folder/main.tf b/modules/vsphere/folder/main.tf new file mode 100755 index 00000000..cbfffaf2 --- /dev/null +++ b/modules/vsphere/folder/main.tf @@ -0,0 +1,18 @@ +terraform { + required_version = ">= 1.0.0" + required_providers { + aws = { + source = "hashicorp/vsphere" + version = ">= 2.5.0" + } + } +} + + +resource "vsphere_folder" "this" { + custom_attributes = var.custom_attributes + datacenter_id = var.datacenter_id + path = var.path + tags = var.tags + type = var.type +} diff --git a/modules/vsphere/folder/outputs.tf b/modules/vsphere/folder/outputs.tf new file mode 100755 index 00000000..e69de29b diff --git a/modules/vsphere/folder/variables.tf b/modules/vsphere/folder/variables.tf new file mode 100755 index 00000000..4380b7ce --- /dev/null +++ b/modules/vsphere/folder/variables.tf @@ -0,0 +1,27 @@ +variable "custom_attributes" { + description = "A list of custom attributes to apply to the folder. Unsupported on ESXi hosts, requires vCenter." + type = map(string) + default = {} +} + +variable "datacenter_id" { + description = "The ID of the datacenter where the folder should be created. Forces a new resource if changed." +} + +variable "path" { + description = "The path of the folder. Must be unique within the datacenter. This is relative to the root of the folder for the resource type being created." +} + +variable "tags" { + description = "A map of tags to assign to the folder." + type = map(string) + default = { + "terraform" = "true" + } +} + +variable "type" { + description = "The type of the folder. Allowed options are: datacenter, host, vm, datastore, and network. If unset, the default is host." + type = string + default = "host" +}
"terraform": "true"
}