Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.

Commit e4a60fc

Browse files
author
Sean Sundberg
authored
Updates readme documentation (#4)
* Updates readme documentation * Adds outputs for module Signed-off-by: Sean Sundberg <[email protected]>
1 parent 59673c5 commit e4a60fc

File tree

2 files changed

+63
-39
lines changed

2 files changed

+63
-39
lines changed

README.md

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,46 @@
1-
# Starter kit for a Terraform module
1+
# IBM Cloud OpenShift VPC cluster
22

3-
This is a Starter kit to help with the creation of Terraform modules. The basic structure of a Terraform module is fairly
4-
simple and consists of the following basic values:
5-
6-
- README.md - provides a description of the module
7-
- main.tf - defiens the logic for the module
8-
- variables.tf (optional) - defines the input variables for the module
9-
- outputs.tf (optional) - defines the values that are output from the module
10-
11-
Beyond those files, any other content can be added and organized however you see fit. For example, you can add a `scripts/` directory
12-
that contains shell scripts executed by a `local-exec` `null_resource` in the terraform module. The contents will depend on what your
13-
module does and how it does it.
14-
15-
## Instructions for creating a new module
16-
17-
1. Update the title and description in the README to match the module you are creating
18-
2. Fill out the remaining sections in the README template as appropriate
19-
3. Implement your logic in the in the main.tf, variables.tf, and outputs.tf
20-
4. Use releases/tags to manage release versions of your module
3+
Provisions an IBM Cloud OpenShift VPC cluster using a provided VPC instance and COS
4+
instance.
215

226
## Software dependencies
237

248
The module depends on the following software components:
259

2610
### Command-line tools
2711

28-
- terraform - v12
12+
- terraform - v13
2913
- kubectl
3014

3115
### Terraform providers
3216

33-
- IBM Cloud provider >= 1.5.3
17+
- IBM Cloud provider >= 1.18
3418
- Helm provider >= 1.1.1 (provided by Terraform)
3519

3620
## Module dependencies
3721

3822
This module makes use of the output from other modules:
3923

40-
- Cluster - github.com/ibm-garage-cloud/terraform-ibm-container-platform.git
41-
- Namespace - github.com/ibm-garage-clout/terraform-cluster-namespace.git
42-
- etc
24+
- Object Storage - github.com/cloud-native-toolkit/terraform-ibm-object-storage.git
25+
- VPC - github.com/cloud-native-toolkit/terraform-ibm-vpc.git
4326

4427
## Example usage
4528

4629
```hcl-terraform
47-
module "dev_tools_argocd" {
48-
source = "github.com/ibm-garage-cloud/terraform-tools-argocd.git?ref=v1.0.0"
49-
50-
cluster_config_file = module.dev_cluster.config_file_path
51-
cluster_type = module.dev_cluster.type
52-
app_namespace = module.dev_cluster_namespaces.tools_namespace_name
53-
ingress_subdomain = module.dev_cluster.ingress_hostname
54-
olm_namespace = module.dev_software_olm.olm_namespace
55-
operator_namespace = module.dev_software_olm.target_namespace
56-
name = "argocd"
30+
module "cluster" {
31+
source = "github.com/cloud-native-toolkit/terraform-ibm-ocp-vpn.git?ref=v1.0.0"
32+
33+
resource_group_name = var.resource_group_name
34+
region = var.region
35+
ibmcloud_api_key = var.ibmcloud_api_key
36+
name = var.cluster_name
37+
worker_count = var.worker_count
38+
ocp_version = var.ocp_version
39+
exists = var.cluster_exists
40+
name_prefix = var.name_prefix
41+
vpc_name = module.vpc.name
42+
vpc_subnet_count = module.vpc.subnet_count
43+
cos_id = module.cos.id
5744
}
5845
```
5946

outputs.tf

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
1-
#output "myoutput" {
2-
# description = "Description of my output"
3-
# value = "value"
4-
# depends_on = [<some resource>]
5-
#}
1+
output "id" {
2+
value = data.ibm_container_cluster_config.cluster.id
3+
description = "ID of the cluster."
4+
depends_on = [helm_release.cloud_setup]
5+
}
6+
7+
output "name" {
8+
value = local.cluster_name
9+
description = "Name of the cluster."
10+
}
11+
12+
output "resource_group_name" {
13+
value = var.resource_group_name
14+
description = "Name of the resource group containing the cluster."
15+
depends_on = [helm_release.cloud_setup]
16+
}
17+
18+
output "region" {
19+
value = var.region
20+
description = "Region containing the cluster."
21+
depends_on = [helm_release.cloud_setup]
22+
}
23+
24+
output "config_file_path" {
25+
value = local.cluster_config
26+
description = "Path to the config file for the cluster."
27+
depends_on = [helm_release.cloud_setup]
28+
}
29+
30+
output "platform" {
31+
value = {
32+
id = data.ibm_container_cluster_config.cluster.id
33+
kubeconfig = local.cluster_config
34+
type = local.cluster_type
35+
type_code = local.cluster_type_code
36+
version = local.cluster_version
37+
ingress = local.ingress_hostname
38+
tls_secret = local.tls_secret
39+
}
40+
description = "Configuration values for the cluster platform"
41+
depends_on = [helm_release.cloud_setup]
42+
}

0 commit comments

Comments
 (0)