Skip to content

Commit f095a6a

Browse files
authored
feat: added deployable modules directory(#762)
1 parent d0da908 commit f095a6a

File tree

16 files changed

+70
-18
lines changed

16 files changed

+70
-18
lines changed

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<!-- Update the title -->
2-
# Terraform Modules Template Project
1+
<!-- Update this title with a descriptive name. Use sentence case. -->
2+
# Terraform modules template project
33

44
<!--
55
Update status and "latest release" badges:
@@ -12,31 +12,38 @@ Update status and "latest release" badges:
1212
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
1313
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
1414

15-
<!-- Add a description of module(s) in this repo -->
16-
TODO: Replace me with description of the module(s) in this repo
15+
<!--
16+
Add a description of modules in this repo.
17+
Expand on the repo short description in the .github/settings.yml file.
18+
19+
For information, see "Module names and descriptions" at
20+
https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=module-names-and-descriptions
21+
-->
22+
23+
TODO: Replace this with a description of the modules in this repo.
1724

1825

19-
<!-- Below content is automatically populated via pre-commit hook -->
26+
<!-- The following content is automatically populated by the pre-commit hook -->
2027
<!-- BEGIN OVERVIEW HOOK -->
2128
## Overview
2229
* [terraform-ibm-module-template](#terraform-ibm-module-template)
2330
* [Examples](./examples)
31+
* [Advanced example](./examples/advanced)
2432
* [Basic example](./examples/basic)
25-
* [Complete example](./examples/complete)
2633
* [Contributing](#contributing)
2734
<!-- END OVERVIEW HOOK -->
2835

2936

3037
<!--
31-
If this repo contains any reference architectures, uncomment the heading below and links to them.
38+
If this repo contains any reference architectures, uncomment the heading below and link to them.
3239
(Usually in the `/reference-architectures` directory.)
33-
See "Reference architecture" in Authoring Guidelines in the public documentation at
40+
See "Reference architecture" in the public documentation at
3441
https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=reference-architecture
3542
-->
3643
<!-- ## Reference architectures -->
3744

3845

39-
<!-- This heading should always match the name of the root level module (aka the repo name) -->
46+
<!-- Replace this heading with the name of the root level module (the repo name) -->
4047
## terraform-ibm-module-template
4148

4249
### Usage
@@ -82,7 +89,7 @@ statement instead the previous block.
8289
<!-- No permissions are needed to run this module.-->
8390

8491

85-
<!-- Below content is automatically populated via pre-commit hook -->
92+
<!-- The following content is automatically populated by the pre-commit hook -->
8693
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
8794
### Requirements
8895

@@ -107,7 +114,7 @@ No inputs.
107114
No outputs.
108115
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
109116

110-
<!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow -->
117+
<!-- Leave this section as is so that your module has a link to local development environment set-up steps for contributors to follow -->
111118
## Contributing
112119

113120
You can report issues and request features for this module in GitHub issues in the module repo. See [Report an issue or request a feature](https://github.com/terraform-ibm-modules/.github/blob/main/.github/SUPPORT.md).

cra-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# More info about this file at https://github.com/terraform-ibm-modules/common-pipeline-assets/blob/main/.github/workflows/terraform-test-pipeline.md#cra-config-yaml
22
version: "v1"
33
CRA_TARGETS:
4-
- CRA_TARGET: "examples/complete" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
4+
- CRA_TARGET: "examples/advanced" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
55
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json" # CRA Ignore file to use. If not provided, it checks the repo root directory for `cra-tf-validate-ignore-rules.json`
66
PROFILE_ID: "0e6e7b5a-817d-4344-ab6f-e5d7a9c49520" # SCC profile ID (currently set to the FSCloud 1.4.0 profile).
77
# SCC_INSTANCE_ID: "" # The SCC instance ID to use to download profile for CRA scan. If not provided, a default global value will be used.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Update the title -->
2+
# Deployable Module Template
3+
4+
<!-- Update the below text with the name of the module -->
5+
6+
A thin wrapper around the [terraform-ibm-module-template](../../) module which includes a provider configuration meaning it can be deployed as is.
7+
This is not intended to be called by one or more other modules since it contains a provider configuration, meaning it is not compatible with the `for_each`, `count`, and `depends_on` arguments. For more information see [Providers Within Modules](https://developer.hashicorp.com/terraform/language/modules/develop/providers).

deployable/module-template/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module "module_template" {
2+
source = "../.."
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
########################################################################################################################
2+
# Outputs
3+
########################################################################################################################
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
########################################################################################################################
2+
# Provider config
3+
########################################################################################################################
4+
5+
provider "ibm" {
6+
ibmcloud_api_key = var.ibmcloud_api_key
7+
region = var.region
8+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
########################################################################################################################
2+
# Input variables
3+
########################################################################################################################
4+
5+
variable "ibmcloud_api_key" {
6+
type = string
7+
description = "The IBM Cloud API Key"
8+
sensitive = true
9+
}
10+
11+
variable "region" {
12+
type = string
13+
description = "The IBM Cloud region"
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.3.0, <1.7.0"
3+
# Lock the deployable module into an exact provider version - renovate automation will keep it updated
4+
required_providers {
5+
ibm = {
6+
source = "IBM-Cloud/ibm"
7+
version = "1.64.0"
8+
}
9+
}
10+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Complete example
1+
# Advanced example
22

33
<!-- There is a pre-commit hook that will take the title of each example add include it in the repos main README.md -->
44
<!-- Add text below should describe exactly what resources are provisioned / configured by the example -->

0 commit comments

Comments
 (0)