Skip to content

Commit c2405f1

Browse files
feat: initial release (#6)
1 parent c13dc98 commit c2405f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1443
-483
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: v1
3+
offerings:
4+
- name: deploy-arch-secrets-manager-custom-credentials-engine
5+
kind: solution
6+
catalog_id: 7df1e4ca-d54c-4fd0-82ce-3d13247308cd
7+
offering_id: 6a7e04c0-f3ef-439b-9d3c-cdb4e583ae9c
8+
variations:
9+
- name: fully-configurable
10+
mark_ready: true
11+
install_type: fullstack
12+
scc:
13+
instance_id: 1c7d5f78-9262-44c3-b779-b28fe4d88c37
14+
region: us-south
15+
pre_validation: "tests/scripts/pre-validation-deploy-ce.sh"
16+
post_validation: "tests/scripts/post-validation-destroy-ce.sh"

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Primary owner should be listed first in list of global owners, followed by any secondary owners
2-
* @ocofaigh @daniel-butler-irl
2+
* @alex-reiff @mukulpalit-ibm

.github/settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repository:
2222

2323
# Uncomment this description property
2424
# and update the description to the current repo description.
25-
description: "Configures a custom credentials engine configuration for IBM Cloud Secrets Manager"
25+
description: "Creates a custom credentials engine in a Secrets Manager instance"
2626

2727
# Use a comma-separated list of topics to set on the repo (ensure not to use any caps in the topic string).
2828
topics: terraform, ibm-cloud, terraform-module, core-team, custom-credentials, secrets-manager

.releaserc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
}],
1111
["@semantic-release/exec", {
1212
"successCmd": "echo \"SEMVER_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
13+
}],
14+
["@semantic-release/exec",{
15+
"publishCmd": "./ci/trigger-catalog-onboarding-pipeline.sh --version=v${nextRelease.version}"
1316
}]
1417
]
1518
}

.secrets.baseline

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2024-11-22T17:36:38Z",
6+
"generated_at": "2025-08-19T08:13:41Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -76,18 +76,7 @@
7676
"name": "TwilioKeyDetector"
7777
}
7878
],
79-
"results": {
80-
"README.md": [
81-
{
82-
"hashed_secret": "ff9ee043d85595eb255c05dfe32ece02a53efbb2",
83-
"is_secret": false,
84-
"is_verified": false,
85-
"line_number": 74,
86-
"type": "Secret Keyword",
87-
"verified_result": null
88-
}
89-
]
90-
},
79+
"results": {},
9180
"version": "0.13.1+ibm.62.dss",
9281
"word_list": {
9382
"file": null,

README.md

Lines changed: 72 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,131 @@
1-
<!-- Update this title with a descriptive name. Use sentence case. -->
2-
# Secrets Manager custom credentials engine
3-
4-
<!--
5-
Update status and "latest release" badges:
6-
1. For the status options, see https://terraform-ibm-modules.github.io/documentation/#/badge-status
7-
2. Update the "latest release" badge to point to the correct module's repo. Replace "terraform-ibm-module-template" in two places.
8-
-->
9-
[![Incubating (Not yet consumable)](https://img.shields.io/badge/status-Incubating%20(Not%20yet%20consumable)-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
10-
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-secrets-manager-custom-credentials-engine?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager-custom-credentials-engine/releases/latest)
1+
# Secrets Manager custom credentials engine module
2+
3+
[![Graduated (Supported)](https://img.shields.io/badge/Status-Graduated%20(Supported)-brightgreen)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
114
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
5+
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-secrets-manager-custom-credentials-engine?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager-custom-credentials-engine/releases/latest)
126
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
137
[![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)
148

15-
<!--
16-
Add a description of modules in this repo.
17-
Expand on the repo short description in the .github/settings.yml file.
9+
This module configures a custom credentials engine for a Secrets Manager instance. For more information about enabling Secrets Manager for custom credentials engine, see [Preparing to create custom credentials engine](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-custom-credentials-prepare).
10+
11+
The module handles the following components:
1812

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-
-->
13+
- [IAM service authorization]((https://cloud.ibm.com/docs/account?topic=account-serviceauth&interface=ui)) policy creation between Secrets Manager as source and Code Engine Project as target
14+
- [IAM credentials secret](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-iam-credentials&interface=terraform) creation for allowing code engine job to fetch secrets
15+
- [Custom credentials engine](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-custom-credentials-config&interface=terraform)
2216

23-
TODO: Replace this with a description of the modules in this repo.
17+
These components are needed in order to create the custom credentials secret in SM instance.
2418

2519

2620
<!-- The following content is automatically populated by the pre-commit hook -->
2721
<!-- BEGIN OVERVIEW HOOK -->
2822
## Overview
2923
* [terraform-ibm-secrets-manager-custom-credentials-engine](#terraform-ibm-secrets-manager-custom-credentials-engine)
3024
* [Examples](./examples)
31-
* [Advanced example](./examples/advanced)
32-
* [Basic example](./examples/basic)
25+
* [Complete example](./examples/complete)
3326
* [Contributing](#contributing)
3427
<!-- END OVERVIEW HOOK -->
3528

3629

37-
<!--
38-
If this repo contains any reference architectures, uncomment the heading below and link to them.
39-
(Usually in the `/reference-architectures` directory.)
40-
See "Reference architecture" in the public documentation at
41-
https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=reference-architecture
42-
-->
43-
<!-- ## Reference architectures -->
30+
## Reference architectures
31+
32+
[Secrets Manager Custom Credential Engine](./reference-architecture/secrets_manager_custom_credentials_engine.svg)
4433

4534

46-
<!-- Replace this heading with the name of the root level module (the repo name) -->
4735
## terraform-ibm-secrets-manager-custom-credentials-engine
4836

4937
### Usage
5038

51-
<!--
52-
Add an example of the use of the module in the following code block.
53-
54-
Use real values instead of "var.<var_name>" or other placeholder values
55-
unless real values don't help users know what to change.
56-
-->
57-
5839
```hcl
59-
terraform {
60-
required_version = ">= 1.9.0"
61-
required_providers {
62-
ibm = {
63-
source = "IBM-Cloud/ibm"
64-
version = "X.Y.Z" # Lock into a provider version that satisfies the module constraints
65-
}
66-
}
67-
}
68-
69-
locals {
70-
region = "us-south"
71-
}
72-
73-
provider "ibm" {
74-
ibmcloud_api_key = "XXXXXXXXXX" # replace with apikey value
75-
region = local.region
40+
module "custom_credential_engine" {
41+
source = "terraform-ibm-modules/secrets-manager-custom-credentials-engine/ibm"
42+
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
43+
secrets_manager_guid = "<secrets_manager_instance_id>"
44+
secrets_manager_region = "<secrets_manager_instance_region>"
45+
custom_credential_engine_name = "My Custom Credentials Engine"
46+
endpoint_type = "public"
47+
code_engine_project_id = "<code_engine_project_id>"
48+
code_engine_job_name = "<code_engine_project_job_name>"
49+
code_engine_region = "<code_engine_region>"
50+
task_timeout = "5m"
51+
service_id_name = "My Service ID"
52+
iam_credential_secret_name = "My Credentials Secret"
7653
}
7754
78-
module "module_template" {
79-
source = "terraform-ibm-modules/<replace>/ibm"
80-
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
81-
region = local.region
82-
name = "instance-name"
83-
resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX" # Replace with the actual ID of resource group to use
84-
}
8555
```
8656

87-
### Required access policies
88-
89-
<!-- PERMISSIONS REQUIRED TO RUN MODULE
90-
If this module requires permissions, uncomment the following block and update
91-
the sample permissions, following the format.
92-
Replace the 'Sample IBM Cloud' service and roles with applicable values.
93-
The required information can usually be found in the services official
94-
IBM Cloud documentation.
95-
To view all available service permissions, you can go in the
96-
console at Manage > Access (IAM) > Access groups and click into an existing group
97-
(or create a new one) and in the 'Access' tab click 'Assign access'.
98-
-->
99-
100-
<!--
101-
You need the following permissions to run this module:
102-
103-
- Service
104-
- **Resource group only**
105-
- `Viewer` access on the specific resource group
106-
- **Sample IBM Cloud** service
107-
- `Editor` platform access
108-
- `Manager` service access
109-
-->
11057

111-
<!-- NO PERMISSIONS FOR MODULE
112-
If no permissions are required for the module, uncomment the following
113-
statement instead the previous block.
114-
-->
11558

116-
<!-- No permissions are needed to run this module.-->
59+
### Required IAM access policies
11760

61+
You need the following permissions to run this module.
62+
63+
- Account Management
64+
- **IAM Identity** services
65+
- `Administrator` platform access
66+
- `Service ID Creator` service access
67+
- **All Identity and Access enabled** services
68+
- `Administrator` platform access
69+
- IAM Services
70+
- **Secrets Manager** service
71+
- `Administrator` platform access
72+
- `Manager` service access
11873

119-
<!-- The following content is automatically populated by the pre-commit hook -->
12074
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
12175
### Requirements
12276

12377
| Name | Version |
12478
|------|---------|
12579
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
126-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.71.2, < 2.0.0 |
80+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.79.2, < 2.0.0 |
81+
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1, < 1.0.0 |
12782

12883
### Modules
12984

130-
No modules.
85+
| Name | Source | Version |
86+
|------|--------|---------|
87+
| <a name="module_sm_iam_credential_secret"></a> [sm\_iam\_credential\_secret](#module\_sm\_iam\_credential\_secret) | terraform-ibm-modules/iam-serviceid-apikey-secrets-manager/ibm | 1.2.0 |
13188

13289
### Resources
13390

13491
| Name | Type |
13592
|------|------|
136-
| [ibm_resource_instance.cos_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
93+
| [ibm_iam_authorization_policy.sm_ce_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |
94+
| [ibm_iam_service_id.sm_service_id](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_service_id) | resource |
95+
| [ibm_iam_service_policy.sm_service_id_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_service_policy) | resource |
96+
| [ibm_sm_custom_credentials_configuration.custom_credentials_configuration](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/sm_custom_credentials_configuration) | resource |
97+
| [time_sleep.wait_for_service_id](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
98+
| [time_sleep.wait_for_sm_ce_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
13799

138100
### Inputs
139101

140102
| Name | Description | Type | Default | Required |
141103
|------|-------------|------|---------|:--------:|
142-
| <a name="input_name"></a> [name](#input\_name) | A descriptive name used to identify the resource instance. | `string` | n/a | yes |
143-
| <a name="input_plan"></a> [plan](#input\_plan) | The name of the plan type supported by service. | `string` | `"standard"` | no |
144-
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The ID of the resource group where you want to create the service. | `string` | n/a | yes |
145-
| <a name="input_resource_tags"></a> [resource\_tags](#input\_resource\_tags) | List of resource tag to associate with the instance. | `list(string)` | `[]` | no |
104+
| <a name="input_code_engine_job_name"></a> [code\_engine\_job\_name](#input\_code\_engine\_job\_name) | The code engine job name used by this custom credentials configuration. | `string` | n/a | yes |
105+
| <a name="input_code_engine_project_id"></a> [code\_engine\_project\_id](#input\_code\_engine\_project\_id) | The Project ID of the code engine project used by the custom credentials configuration. | `string` | n/a | yes |
106+
| <a name="input_code_engine_region"></a> [code\_engine\_region](#input\_code\_engine\_region) | The region of the code engine project. | `string` | n/a | yes |
107+
| <a name="input_custom_credential_engine_name"></a> [custom\_credential\_engine\_name](#input\_custom\_credential\_engine\_name) | The name of the custom credentials engine to be created. | `string` | n/a | yes |
108+
| <a name="input_endpoint_type"></a> [endpoint\_type](#input\_endpoint\_type) | The endpoint type to communicate with the provided secrets manager instance. Possible values are `public` or `private`. | `string` | `"public"` | no |
109+
| <a name="input_iam_credential_secret_auto_rotation_interval"></a> [iam\_credential\_secret\_auto\_rotation\_interval](#input\_iam\_credential\_secret\_auto\_rotation\_interval) | The rotation interval for the rotation policy. | `string` | `60` | no |
110+
| <a name="input_iam_credential_secret_auto_rotation_unit"></a> [iam\_credential\_secret\_auto\_rotation\_unit](#input\_iam\_credential\_secret\_auto\_rotation\_unit) | The unit of time for rotation policy. Acceptable values are `day` or `month`. | `string` | `"day"` | no |
111+
| <a name="input_iam_credential_secret_group_id"></a> [iam\_credential\_secret\_group\_id](#input\_iam\_credential\_secret\_group\_id) | Secret Group ID of secret where IAM Secret will be added to, leave default (null) to add in the default secret group. | `string` | `null` | no |
112+
| <a name="input_iam_credential_secret_labels"></a> [iam\_credential\_secret\_labels](#input\_iam\_credential\_secret\_labels) | Optional list of up to 30 labels to be created on the secret. Labels can be used to search for secrets in the Secrets Manager instance. | `list(string)` | `[]` | no |
113+
| <a name="input_iam_credential_secret_name"></a> [iam\_credential\_secret\_name](#input\_iam\_credential\_secret\_name) | The name of the IAM credential secret to allow code engine job to pull secrets from Secrets Manager. | `string` | n/a | yes |
114+
| <a name="input_iam_credential_secret_ttl"></a> [iam\_credential\_secret\_ttl](#input\_iam\_credential\_secret\_ttl) | Specify validity / lease duration of ServiceID API key. Accepted values and formats are: SECONDS, Xm or Xh (where X is the number of minutes or hours appended to m or h respectively). | `string` | `"7776000"` | no |
115+
| <a name="input_secrets_manager_guid"></a> [secrets\_manager\_guid](#input\_secrets\_manager\_guid) | GUID of secrets manager instance to create the secret engine in. | `string` | n/a | yes |
116+
| <a name="input_secrets_manager_region"></a> [secrets\_manager\_region](#input\_secrets\_manager\_region) | The region of the secrets manager instance. | `string` | n/a | yes |
117+
| <a name="input_service_id_name"></a> [service\_id\_name](#input\_service\_id\_name) | The name of the service ID to be created to allow code engine job to pull secrets from Secrets Manager. | `string` | n/a | yes |
118+
| <a name="input_skip_secrets_manager_code_engine_auth_policy"></a> [skip\_secrets\_manager\_code\_engine\_auth\_policy](#input\_skip\_secrets\_manager\_code\_engine\_auth\_policy) | Whether to skip the creation of the IAM authorization policies required between the Code engine project and Secrets Manager instance. If set to false, policies will be created that grants the Secrets Manager instance 'Viewer' and 'Writer' access to the Code engine project. | `bool` | `false` | no |
119+
| <a name="input_task_timeout"></a> [task\_timeout](#input\_task\_timeout) | The maximum allowed time for a code engine job to be completed. | `string` | `"5m"` | no |
146120

147121
### Outputs
148122

149123
| Name | Description |
150124
|------|-------------|
151-
| <a name="output_account_id"></a> [account\_id](#output\_account\_id) | An alpha-numeric value identifying the account ID. |
152-
| <a name="output_crn"></a> [crn](#output\_crn) | The CRN of the resource instance. |
153-
| <a name="output_guid"></a> [guid](#output\_guid) | The GUID of the resource instance. |
154-
| <a name="output_id"></a> [id](#output\_id) | The unique identifier of the resource instance. |
125+
| <a name="output_code_engine_key_ref"></a> [code\_engine\_key\_ref](#output\_code\_engine\_key\_ref) | The IAM API key used by the credentials system to access the secrets manager instance. |
126+
| <a name="output_custom_config_engine_id"></a> [custom\_config\_engine\_id](#output\_custom\_config\_engine\_id) | The unique identifier of the engine created. |
127+
| <a name="output_custom_config_engine_name"></a> [custom\_config\_engine\_name](#output\_custom\_config\_engine\_name) | The name of the engine created. |
128+
| <a name="output_secrets_manager_custom_credentials_configuration_schema"></a> [secrets\_manager\_custom\_credentials\_configuration\_schema](#output\_secrets\_manager\_custom\_credentials\_configuration\_schema) | The schema that defines the format of the input and output parameters. |
155129
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
156130

157131
<!-- Leave this section as is so that your module has a link to local development environment set-up steps for contributors to follow -->

cra-config.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@
77

88
version: "v1"
99
CRA_TARGETS:
10-
- CRA_TARGET: "examples/advanced" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
10+
- CRA_TARGET: "solutions/fully-configurable" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
1111
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json"
1212
PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile).
1313
# 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.
1414
# SCC_REGION: "" # The IBM Cloud region that the SCC instance is in. If not provided, a default global value will be used.
1515
CRA_ENVIRONMENT_VARIABLES: # An optional map of environment variables for CRA, where the key is the variable name and value is the value. Useful for providing TF_VARs.
1616
TF_VAR_prefix: "mock"
1717
TF_VAR_region: "us-south"
18+
TF_VAR_provider_visibility: "public"
19+
TF_VAR_existing_secrets_manager_crn: "crn:v1:bluemix:public:secrets-manager:us-south:a/abac0df06b644a9cabc6e44f55b3880e:79c6d411-c18f-4670-b009-b0044a238667::"
20+
TF_VAR_custom_credential_engine_name: "test-engine"
21+
TF_VAR_service_id_name: "test-service-id"
22+
TF_VAR_iam_credential_secret_name: "test-credential-secret"
23+
TF_VAR_existing_code_engine_project_id: "d731565f-835d-4c1b-b116-a03fa4e703df"
24+
TF_VAR_existing_code_engine_job_name: "ce-job-name"
25+
TF_VAR_existing_code_engine_region: "us-south"

examples/advanced/README.md

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

0 commit comments

Comments
 (0)