Skip to content

Commit e9e8ba1

Browse files
authored
Merge pull request #7 from equinix-labs/add_documentation
Add documentation
2 parents e9714e4 + c657d92 commit e9e8ba1

File tree

12 files changed

+88
-31
lines changed

12 files changed

+88
-31
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ Contributors to this project must abide by the [Contributor Covenant Code of Con
99
The project has the following folders and files:
1010

1111
- /: root folder.
12-
- /docs: Examples for using this module.
1312
- /examples: Examples for using this module.
14-
- /files: Static files referenced but not executed by Terraform.
15-
- /helpers: Helper scripts NOT called by Terraform.
1613
- /modules: Inline local modules called by this module.
17-
- /scripts: Scripts for specific tasks on module.
18-
- /templates: Template files used to be execute by data sources.
1914
- /main.tf: Main file for this module, contains all the resources to operate the module.
2015
- /variables.tf: All the variables necessary for run the module.
2116
- /output.tf: The outputs generate from the module.
@@ -25,6 +20,20 @@ The project has the following folders and files:
2520
- /CODE_OF_CONDUCT.md: Code of Conduct file.
2621
- /CONTRIBUTING.md: This file.
2722

23+
## Adding a new module
24+
25+
To add a new module, fork this repo then add your module under [./modules](./modules/) folder. Please visit our [Terraform Module Development Standards guide](https://github.com/equinix-labs/equinix-labs/blob/main/terraform-module-standards.md) for more info on module development best practices.
26+
2827
## Issues and Change Requests
2928

30-
Please submit change requests and / or features via [Issues](https://github.com/equinix-labs/equinix-labs/issues).
29+
Please submit change requests and / or features via [Issues](https://github.com/equinix-labs/terraform-equinix-labs/issues).
30+
31+
## Submitting Pull Requests
32+
33+
Before starting any work or sending us a pull request, please ensure that:
34+
35+
- Your working branch is up-to-date with the latest source on the main branch.
36+
- Check issues and pull requests (open/merged) to make sure someone else hasn't already addressed that issue.
37+
- You open an issue to discuss your proposal.
38+
39+
To learn how to send us a pull request, please see [Contributing to Projects](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) in the GitHub Docs.

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Terraform Equinix Labs Project
22

3+
[![Experimental](https://img.shields.io/badge/Stability-Experimental-red.svg)](https://github.com/equinix-labs/standards#about-uniform-standards)
4+
[![run-pre-commit-hooks](https://github.com/equinix-labs/terraform-equinix-labs/actions/workflows/pre-commit.yaml/badge.svg)](https://github.com/equinix-labs/terraform-equinix-labs/actions/workflows/pre-commit.yaml)
5+
[![generate-terraform-docs](https://github.com/equinix-labs/terraform-equinix-labs/actions/workflows/documentation.yaml/badge.svg)](https://github.com/equinix-labs/terraform-equinix-labs/actions/workflows/documentation.yaml)
6+
7+
This repository contains a collection of Terraform modules to help automate the deployment and management of either bare metal nodes or a kubernetes cluster environment running on [Equinix Metal](https://deploy.equinix.com/).
8+
9+
## Usage
10+
11+
This project is intended to be used as a Terraform module. It may also be forked, cloned, or downloaded and modified as needed as the base in your integrations and deployments.
12+
13+
Prerequesites:
14+
15+
* A valid Equinix Metal organization ID, API token, and/or project ID.
16+
* HashiCorp Terraform installed. Please see [tfenv](https://github.com/tfutils/tfenv) util.
17+
* Optional [metal-cli](https://github.com/equinix/metal-cli/#installation) installation.
18+
19+
## Examples
20+
21+
This project may be deployed into new project(s) or existing project(s). Check out sample deployments in the [examples](./examples/) directory described as follows:
22+
23+
| Name | Description |
24+
|------|---------|
25+
| [eksa-setup](./examples/eksa-setup/) | Deploys a AWS EKS-A cluster into new projects provisioned for each user described in users.csv |
26+
| [metal-setup](./examples/metal-setup/) | Deploys a cluster or bare nodes into new projects provisioned for each user described in users.csv |
27+
328
<!-- BEGIN_TF_DOCS -->
429
## Requirements
530

@@ -27,14 +52,14 @@ No resources.
2752

2853
| Name | Description | Type | Default | Required |
2954
|------|-------------|------|---------|:--------:|
30-
| <a name="input_metal_auth_token"></a> [metal\_auth\_token](#input\_metal\_auth\_token) | Equinix Metal user api token. | `string` | n/a | yes |
31-
| <a name="input_metal_organization_id"></a> [metal\_organization\_id](#input\_metal\_organization\_id) | Equinix Metal organization id | `string` | n/a | yes |
3255
| <a name="input_eksa_config"></a> [eksa\_config](#input\_eksa\_config) | Module configuration for EKSA module | <pre>object({<br> cluster_name = string<br> cp_device_count = number<br> worker_device_count = number<br> })</pre> | <pre>{<br> "cluster_name": "equinix-labs-cluster",<br> "cp_device_count": 3,<br> "worker_device_count": 3<br>}</pre> | no |
3356
| <a name="input_enable_eksa"></a> [enable\_eksa](#input\_enable\_eksa) | Enable EKSA module | `bool` | `false` | no |
3457
| <a name="input_enable_metal"></a> [enable\_metal](#input\_enable\_metal) | Enable Metal module | `bool` | `false` | no |
3558
| <a name="input_enable_workshop_setup"></a> [enable\_workshop\_setup](#input\_enable\_workshop\_setup) | Enable Workshop Setup module | `bool` | `false` | no |
59+
| <a name="input_metal_auth_token"></a> [metal\_auth\_token](#input\_metal\_auth\_token) | Equinix Metal user api token. | `string` | n/a | yes |
3660
| <a name="input_metal_config"></a> [metal\_config](#input\_metal\_config) | Configuration for Metal module | <pre>object({<br> device_count = number<br> os = string<br> billing_cycle = string<br> cluster_name = string<br> device_type = string<br> })</pre> | <pre>{<br> "billing_cycle": "hourly",<br> "cluster_name": "metal-cluster",<br> "device_count": 3,<br> "device_type": "m3.small.x86",<br> "os": "ubuntu_20_04"<br>}</pre> | no |
3761
| <a name="input_metal_metro"></a> [metal\_metro](#input\_metal\_metro) | Equinix Metal metro | `string` | `"sv"` | no |
62+
| <a name="input_metal_organization_id"></a> [metal\_organization\_id](#input\_metal\_organization\_id) | Equinix Metal organization id | `string` | n/a | yes |
3863
| <a name="input_metal_project_id"></a> [metal\_project\_id](#input\_metal\_project\_id) | Project ID | `string` | `""` | no |
3964
| <a name="input_metal_tags"></a> [metal\_tags](#input\_metal\_tags) | String list of common tags for Equinix resources | `list(string)` | <pre>[<br> "terraform",<br> "equinix-labs"<br>]</pre> | no |
4065

@@ -46,3 +71,10 @@ No resources.
4671
| <a name="output_deploy_metal_outputs"></a> [deploy\_metal\_outputs](#output\_deploy\_metal\_outputs) | Outputs of the Deploy Metal module |
4772
| <a name="output_project_setup_outputs"></a> [project\_setup\_outputs](#output\_project\_setup\_outputs) | Outputs of the Project Setup module |
4873
<!-- END_TF_DOCS -->
74+
## Contributing
75+
76+
If you would like to contribute to this module, see [CONTRIBUTING](CONTRIBUTING.md) page for more info.
77+
78+
## License
79+
80+
Apache License, Version 2.0. See [LICENSE](LICENSE).

examples/eksa-setup/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Terraform Equinix Labs Metal Setup Example
1+
# Terraform Equinix Labs EKSA Setup Example
2+
3+
This is an example of how to utilize the root module to deploy the [invite-from-csv](https://github.com/equinix-labs/terraform-equinix-labs/tree/main/modules/invite-from-csv) module and the [eksa](https://github.com/equinix-labs/terraform-equinix-labs/tree/main/modules/eksa) module. In this example, each user identified in the `users.csv` file (see users.csv.example) will have a project provisioned and an invitation sent by email to join that project. Kubernetes will then be provisioned into each user's project with the configurations set within the [variables.tf](./variables.tf) file.
24

35
<!-- BEGIN_TF_DOCS -->
46
## Requirements
@@ -27,11 +29,11 @@ No resources.
2729

2830
| Name | Description | Type | Default | Required |
2931
|------|-------------|------|---------|:--------:|
30-
| <a name="input_metal_auth_token"></a> [metal\_auth\_token](#input\_metal\_auth\_token) | Equinix Metal user api token. | `string` | n/a | yes |
31-
| <a name="input_metal_organization_id"></a> [metal\_organization\_id](#input\_metal\_organization\_id) | Equinix Metal organization id | `string` | n/a | yes |
3232
| <a name="input_eksa_config"></a> [eksa\_config](#input\_eksa\_config) | Module configuration for EKSA module | <pre>object({<br> cluster_name = string<br> cp_device_count = number<br> worker_device_count = number<br> })</pre> | <pre>{<br> "cluster_name": "equinix-labs-cluster",<br> "cp_device_count": 3,<br> "worker_device_count": 3<br>}</pre> | no |
3333
| <a name="input_enable_eksa"></a> [enable\_eksa](#input\_enable\_eksa) | Enable EKSA module | `bool` | `true` | no |
3434
| <a name="input_enable_workshop_setup"></a> [enable\_workshop\_setup](#input\_enable\_workshop\_setup) | Enable Workshop Setup module | `bool` | `true` | no |
35+
| <a name="input_metal_auth_token"></a> [metal\_auth\_token](#input\_metal\_auth\_token) | Equinix Metal user api token. | `string` | n/a | yes |
36+
| <a name="input_metal_organization_id"></a> [metal\_organization\_id](#input\_metal\_organization\_id) | Equinix Metal organization id | `string` | n/a | yes |
3537

3638
## Outputs
3739

examples/metal-setup/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Terraform Equinix Labs Metal Setup Example
22

3+
This is an example of how to utilize the root module to deploy the [invite-from-csv](https://github.com/equinix-labs/terraform-equinix-labs/tree/main/modules/invite-from-csv) module and the [metal](https://github.com/equinix-labs/terraform-equinix-labs/tree/main/modules/metal) module. In this example, each user identified in the `users.csv` file (see users.csv.example) will have a project provisioned and an invitation sent by email to join that project. Kubernetes will then be provisioned into each user's project with the configurations set within the [variables.tf](./variables.tf) file.
4+
35
<!-- BEGIN_TF_DOCS -->
46
## Requirements
57

@@ -27,11 +29,11 @@ No resources.
2729

2830
| Name | Description | Type | Default | Required |
2931
|------|-------------|------|---------|:--------:|
30-
| <a name="input_metal_auth_token"></a> [metal\_auth\_token](#input\_metal\_auth\_token) | Equinix Metal user api token. | `string` | n/a | yes |
31-
| <a name="input_metal_organization_id"></a> [metal\_organization\_id](#input\_metal\_organization\_id) | Equinix Metal organization id | `string` | n/a | yes |
3232
| <a name="input_enable_metal"></a> [enable\_metal](#input\_enable\_metal) | Enable Metal module | `bool` | `true` | no |
3333
| <a name="input_enable_workshop_setup"></a> [enable\_workshop\_setup](#input\_enable\_workshop\_setup) | Enable Workshop Setup module | `bool` | `true` | no |
34+
| <a name="input_metal_auth_token"></a> [metal\_auth\_token](#input\_metal\_auth\_token) | Equinix Metal user api token. | `string` | n/a | yes |
3435
| <a name="input_metal_config"></a> [metal\_config](#input\_metal\_config) | Configuration for Metal Setup config | <pre>object({<br> device_count = number<br> os = string<br> billing_cycle = string<br> cluster_name = string<br> device_type = string<br> })</pre> | <pre>{<br> "billing_cycle": "hourly",<br> "cluster_name": "metal-cluster",<br> "device_count": 3,<br> "device_type": "m3.small.x86",<br> "os": "ubuntu_20_04"<br>}</pre> | no |
36+
| <a name="input_metal_organization_id"></a> [metal\_organization\_id](#input\_metal\_organization\_id) | Equinix Metal organization id | `string` | n/a | yes |
3537

3638
## Outputs
3739

main.tf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@ terraform {
33
required_version = ">= 1.3"
44
}
55

6+
# ---------------------------------------------------------------------------------------------------------------------
7+
# Project Setup
8+
# ---------------------------------------------------------------------------------------------------------------------
9+
610
# Setup Project for deploying metal or EKSA
711
module "project_setup" {
812
count = var.enable_workshop_setup ? 1 : 0
913
source = "./modules/invite-from-csv"
1014
metal_organization_id = var.metal_organization_id
1115
}
1216

13-
# Deploy the metal module if platform of choice is metal
17+
# ---------------------------------------------------------------------------------------------------------------------
18+
# Platforms
19+
# ---------------------------------------------------------------------------------------------------------------------
20+
21+
# Deploy the metal module if platform of choice is Metal
1422
module "deploy_metal" {
1523
count = var.enable_metal ? 1 : 0
1624
source = "./modules/metal"
@@ -19,7 +27,7 @@ module "deploy_metal" {
1927
module_config = var.metal_config
2028
}
2129

22-
# Deploy the eksa module if platform of choice is eksa
30+
# Deploy the eksa module if platform of choice is EKSA
2331
module "deploy_eksa" {
2432
count = var.enable_eksa ? 1 : 0
2533
source = "./modules/eksa"

modules/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

modules/collaborator-project/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Terraform Equinix Labs Collaborator Project Module
22

3+
This module creates a project with collaborator users, sends each user an inviation for each user to join their project, and assigns those users `limited_collaborator` role.
4+
35
<!-- BEGIN_TF_DOCS -->
46
## Requirements
57

@@ -12,7 +14,7 @@
1214

1315
| Name | Version |
1416
|------|---------|
15-
| <a name="provider_equinix"></a> [equinix](#provider\_equinix) | >= 1.10.0 |
17+
| <a name="provider_equinix"></a> [equinix](#provider\_equinix) | 1.14.1 |
1618

1719
## Modules
1820

@@ -31,8 +33,8 @@ No modules.
3133
| Name | Description | Type | Default | Required |
3234
|------|-------------|------|---------|:--------:|
3335
| <a name="input_collaborator"></a> [collaborator](#input\_collaborator) | Collaborator email to join the organization | `string` | n/a | yes |
34-
| <a name="input_module_context"></a> [module\_context](#input\_module\_context) | Input context for the module | <pre>object({<br> organization_id = string<br> })</pre> | n/a | yes |
3536
| <a name="input_module_config"></a> [module\_config](#input\_module\_config) | Module configuration for Collaborator module | `any` | <pre>{<br> "send_invites": true<br>}</pre> | no |
37+
| <a name="input_module_context"></a> [module\_context](#input\_module\_context) | Input context for the module | <pre>object({<br> organization_id = string<br> })</pre> | n/a | yes |
3638

3739
## Outputs
3840

modules/eksa/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Terraform Equinix Labs EKS-A Module
22

3+
This module utilizes the [metal-eks-anywhere](https://registry.terraform.io/modules/equinix-labs/metal-eks-anywhere/equinix/latest) module to deploy AWS EKS-A.
4+
35
<!-- BEGIN_TF_DOCS -->
46
## Requirements
57

@@ -25,8 +27,8 @@ No resources.
2527

2628
| Name | Description | Type | Default | Required |
2729
|------|-------------|------|---------|:--------:|
28-
| <a name="input_module_context"></a> [module\_context](#input\_module\_context) | Input context for the module | <pre>object({<br> metal_api_token = string<br> project_id = string<br> metro = string<br> tags = list(string)<br> })</pre> | n/a | yes |
2930
| <a name="input_module_config"></a> [module\_config](#input\_module\_config) | Module configuration for EKSA module | <pre>object({<br> cluster_name = string<br> cp_device_count = number<br> worker_device_count = number<br> })</pre> | <pre>{<br> "cluster_name": "eksa-workshop-cluster",<br> "cp_device_count": 1,<br> "worker_device_count": 1<br>}</pre> | no |
31+
| <a name="input_module_context"></a> [module\_context](#input\_module\_context) | Input context for the module | <pre>object({<br> metal_api_token = string<br> project_id = string<br> metro = string<br> tags = list(string)<br> })</pre> | n/a | yes |
3032

3133
## Outputs
3234

modules/eksa/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ module "eksa" {
1414
cluster_name = var.module_config.cluster_name
1515
cp_device_count = var.module_config.cp_device_count
1616
worker_device_count = var.module_config.worker_device_count
17-
1817
}

modules/invite-from-csv/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Terraform Equinix Labs Invite from CSV Module
22

3+
This module reads a given filename `users.csv`, identifies each user entry in the file, then calls [collaborator-project](../collaborator-project/) module to create a project for them.
4+
35
<!-- BEGIN_TF_DOCS -->
46
## Requirements
57

@@ -12,7 +14,7 @@
1214

1315
| Name | Version |
1416
|------|---------|
15-
| <a name="provider_equinix"></a> [equinix](#provider\_equinix) | >= 1.10.0 |
17+
| <a name="provider_equinix"></a> [equinix](#provider\_equinix) | 1.14.1 |
1618

1719
## Modules
1820

@@ -30,8 +32,8 @@
3032

3133
| Name | Description | Type | Default | Required |
3234
|------|-------------|------|---------|:--------:|
33-
| <a name="input_metal_organization_id"></a> [metal\_organization\_id](#input\_metal\_organization\_id) | Equinix Metal organization id | `string` | n/a | yes |
3435
| <a name="input_csv_file"></a> [csv\_file](#input\_csv\_file) | Path to a CSV file containing a list of projects to provision: email,metro,plan. Email address is used as the project name and the collaborator. Metro and plan are used to provision the project. | `string` | `"users.csv"` | no |
36+
| <a name="input_metal_organization_id"></a> [metal\_organization\_id](#input\_metal\_organization\_id) | Equinix Metal organization id | `string` | n/a | yes |
3537

3638
## Outputs
3739

0 commit comments

Comments
 (0)