Skip to content

Commit

Permalink
fix: rename submodules to modules for tf registry entries (#7)
Browse files Browse the repository at this point in the history
* refactor: rename submodules to modules; standards for tf registry
  • Loading branch information
surajsbharadwaj authored Oct 20, 2023
1 parent 1f88138 commit 99d8989
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 23 deletions.
22 changes: 16 additions & 6 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.sum|^.secrets.baseline$",
"lines": null
},
"generated_at": "2023-10-18T16:25:41Z",
"generated_at": "2023-10-20T09:03:56Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -82,27 +82,37 @@
"hashed_secret": "91199272d5d6a574a51722ca6f3d1148edb1a0e7",
"is_secret": false,
"is_verified": false,
"line_number": 39,
"line_number": 43,
"type": "Secret Keyword",
"verified_result": null
}
],
"submodules/pi-cloudconnection-attach/README.md": [
"modules/pi-cloudconnection-attach/README.md": [
{
"hashed_secret": "1a70e90515ef1357abd3531dead4b53b6eba959f",
"is_secret": false,
"is_verified": false,
"line_number": 10,
"line_number": 13,
"type": "Secret Keyword",
"verified_result": null
}
],
"submodules/pi-cloudconnection-create/README.md": [
"modules/pi-cloudconnection-create/README.md": [
{
"hashed_secret": "1a70e90515ef1357abd3531dead4b53b6eba959f",
"is_secret": false,
"is_verified": false,
"line_number": 10,
"line_number": 13,
"type": "Secret Keyword",
"verified_result": null
}
],
"modules/pi-workspace/README.md": [
{
"hashed_secret": "1a70e90515ef1357abd3531dead4b53b6eba959f",
"is_secret": false,
"is_verified": false,
"line_number": 16,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ This root module automates and provisions a IBM Power Virtual Server Workspace w
<!-- BEGIN OVERVIEW HOOK -->
## Overview
* [terraform-ibm-powervs-workspace](#terraform-ibm-powervs-workspace)
* [Submodules](./modules)
* [pi-cloudconnection-attach](./modules/pi-cloudconnection-attach)
* [pi-cloudconnection-create](./modules/pi-cloudconnection-create)
* [pi-workspace](./modules/pi-workspace)
* [Examples](./examples)
* [Basic example](./examples/basic)
* [Contributing](#contributing)
Expand Down Expand Up @@ -90,9 +94,9 @@ You need the following permissions to run this module.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_powervs_cloud_connection_attach"></a> [powervs\_cloud\_connection\_attach](#module\_powervs\_cloud\_connection\_attach) | ./submodules/pi-cloudconnection-attach | n/a |
| <a name="module_powervs_cloud_connection_create"></a> [powervs\_cloud\_connection\_create](#module\_powervs\_cloud\_connection\_create) | ./submodules/pi-cloudconnection-create | n/a |
| <a name="module_powervs_workspace"></a> [powervs\_workspace](#module\_powervs\_workspace) | ./submodules/pi-workspace | n/a |
| <a name="module_powervs_cloud_connection_attach"></a> [powervs\_cloud\_connection\_attach](#module\_powervs\_cloud\_connection\_attach) | ./modules/pi-cloudconnection-attach | n/a |
| <a name="module_powervs_cloud_connection_create"></a> [powervs\_cloud\_connection\_create](#module\_powervs\_cloud\_connection\_create) | ./modules/pi-cloudconnection-create | n/a |
| <a name="module_powervs_workspace"></a> [powervs\_workspace](#module\_powervs\_workspace) | ./modules/pi-workspace | n/a |

### Resources

Expand Down
12 changes: 6 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ locals {
}

#####################################################
# Workspace Submodule ( Creates Workspace, SSH key,
# Workspace module ( Creates Workspace, SSH key,
# Subnets, Imports catalog images )
#####################################################

module "powervs_workspace" {
source = "./submodules/pi-workspace"
source = "./modules/pi-workspace"

pi_zone = var.pi_zone
pi_resource_group_name = var.pi_resource_group_name
Expand All @@ -29,13 +29,13 @@ module "powervs_workspace" {


#####################################################
# CC Create Submodule
# CC Create module
# Non PER DC: Creates CCs, attaches CCs to TGW
# PER DC: Skip
#####################################################

module "powervs_cloud_connection_create" {
source = "./submodules/pi-cloudconnection-create"
source = "./modules/pi-cloudconnection-create"
count = local.pi_per_enabled ? 0 : 1

pi_zone = var.pi_zone
Expand All @@ -45,7 +45,7 @@ module "powervs_cloud_connection_create" {
}

#####################################################
# CC Subnet Attach Submodule
# CC Subnet Attach module
# Non PER DC: Attaches Subnets to CCs
# PER DC: Skip
#####################################################
Expand All @@ -56,7 +56,7 @@ locals {
}

module "powervs_cloud_connection_attach" {
source = "./submodules/pi-cloudconnection-attach"
source = "./modules/pi-cloudconnection-attach"
depends_on = [module.powervs_cloud_connection_create]
count = local.pi_per_enabled ? 0 : 1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Submodule pi-cloudconnection-attach
# Module pi-cloudconnection-attach

This submodule attaches PowerVS subnets to cloud connections. Maximum of 3 private subnets can be attached to CCs.

This module provisions the following resources in IBM Cloud:

- Attaches IBM® Power Virtual Server (PowerVS) subnets to [IBM Cloud connections](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-cloud-connections). Maximum of 3 private subnets can be attached to CCs.

## Usage
```hcl
Expand All @@ -11,7 +14,8 @@ ibmcloud_api_key = "your api key" != null ? "your api key" : null
}
module "powervs_cloud_connection_attach" {
source = "./submodules/pi-cloudconnection-attach"
source = "terraform-ibm-modules/powervs-workspace/ibm//modules//pi-cloudconnection-attach"
version = "x.x.x" #replace x.x.x with latest git release
pi_workspace_guid = var.pi_workspace_guid
pi_cloud_connection_count = var.pi_cloud_connection_count
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Submodule pi-cloudconnection-create
# Module pi-cloudconnection-create

This submodule creates Cloud Connections and attaches the cloud connections to the Transit gateway if transit gateway id is not null.If TGW id is set to null, only CCs will be created and will not attach the CCs to TGW.
This module provisions the following resources in IBM Cloud:

- Create one or two [IBM Cloud connections](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-cloud-connections)
- Optionally attach the IBM Cloud connections to a transit gateway if transit gateway id is provided in Non PER DC.

## Usage
```hcl
Expand All @@ -11,7 +14,8 @@ ibmcloud_api_key = "your api key" != null ? "your api key" : null
}
module "powervs_cloud_connection_create" {
source = "./submodules/pi-cloudconnection-create"
source = "terraform-ibm-modules/powervs-workspace/ibm//modules//pi-cloudconnection-create"
version = "x.x.x" #replace x.x.x with latest git release
pi_zone = var.pi_zone
pi_workspace_guid = var.pi_workspace_guid
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
# Submodule pi-workspace
# Module pi-workspace

This module provisions the following resources in IBM Cloud:

- Creates an IBM® Power Virtual Server (PowerVS) workspace.
- Creates a Public SSH key in Power Virtual Server (PowerVS) workspace.
- Optionally create one or two or three private subnets.
- Optionally create one public subnet.
- Import up to 6 catalog Stock images from IBM cloud.

## Usage
```hcl
provider "ibm" {
region = "sao"
zone = "sao01"
ibmcloud_api_key = "your api key" != null ? "your api key" : null
}
module "powervs_instance" {
source = "terraform-ibm-modules/powervs-workspace/ibm//modules//pi_workspace"
version = "x.x.x" #replace x.x.x with latest git release
pi_zone = var.pi_zone
pi_resource_group_name = var.pi_resource_group_name
pi_workspace_name = var.pi_workspace_name
pi_tags = var.pi_tags
pi_image_names = var.pi_image_names
pi_ssh_public_key = var.pi_ssh_public_key
pi_private_subnet_1 = var.pi_private_subnet_1
pi_private_subnet_2 = var.pi_private_subnet_2
pi_private_subnet_3 = var.pi_private_subnet_3
pi_public_subnet_enable = var.pi_public_subnet_enable
}
```

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
### Requirements
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ resource "ibm_pi_network" "public_subnet" {


################################################
# #Moved blocks
# Moved blocks
################################################

moved {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 99d8989

Please sign in to comment.