https://github.com/terraform-ibm-modules/terraform-ibm-cloudant
Deploys and configures an IBM Cloudant instance
https://github.com/terraform-ibm-modules/terraform-ibm-cloudant
cloudant core-team deployable-architecture graduated supported terraform-module
Last synced: 17 days ago
JSON representation
Deploys and configures an IBM Cloudant instance
- Host: GitHub
- URL: https://github.com/terraform-ibm-modules/terraform-ibm-cloudant
- Owner: terraform-ibm-modules
- License: apache-2.0
- Created: 2021-06-01T12:15:49.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2026-05-26T08:27:36.000Z (20 days ago)
- Last Synced: 2026-05-26T10:23:52.202Z (20 days ago)
- Topics: cloudant, core-team, deployable-architecture, graduated, supported, terraform-module
- Language: HCL
- Size: 916 KB
- Stars: 0
- Watchers: 13
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Cloudant Module
[-brightgreen)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
[](https://github.com/terraform-ibm-modules/terraform-ibm-cloudant/releases/latest)
[](https://github.com/semantic-release/semantic-release)
[](https://github.com/pre-commit/pre-commit)
[](https://renovatebot.com/)
[](https://registry.terraform.io/modules/terraform-ibm-modules/cloudant/ibm/latest)
This module supports provisioning a instance of the IBM Cloudant service. With a Lite plan, the instance is provisioned on a multi-tenant environment. With a standard plan, the instance can be provisioned either on a multi-tenant or on a dedicated environment. For more information, see [Plans and provisioning](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-ibm-cloud-public).
## Overview
- terraform-ibm-cloudant
-
Submodules
-
Examples
-
Basic cloudant instance and database creation
-
Cloudant instance, access controls, and rotation of credentials through Secret Manager
-
Financial Services Cloud profile example
ℹ️ Ctrl/Cmd+Click or right-click on the Schematics deploy button to open in a new tab.
-
-
Deployable Architectures
- Contributing
## cloudant-module
### Usage
#### Usage to create a cloudant instance on a multi-tenant environment:
```hcl
module "cloudant" {
source = "terraform-ibm-modules/cloudant/ibm"
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
instance_name = "my-cloudant-instance"
}
```
#### Usage to create a cloudant instance on a dedicated environment:
```hcl
module "cloudant" {
source = "terraform-ibm-modules/cloudant/ibm"
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
instance_name = "dedicated-cloudant-instance"
environment_crn = "crn:<...>" # CRN of dedicated environment
}
```
### Required IAM access policies
You need the following permissions to run this module.
- IAM Services
- Cloudant service
- `Manager` service access
### Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.9.0 |
| [ibm](#requirement\_ibm) | >= 1.88.0, < 3.0.0 |
### Modules
No modules.
### Resources
| Name | Type |
|------|------|
| [ibm_cloudant.cloudant_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cloudant) | resource |
| [ibm_cloudant_database.cloudant_database](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cloudant_database) | resource |
| [ibm_resource_key.service_credentials](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_key) | resource |
| [ibm_resource_tag.access_tags](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_tag) | resource |
| [ibm_iam_access_tag.access_tag](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/iam_access_tag) | data source |
### Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [access\_tags](#input\_access\_tags) | Add access management tags to the Cloudant instance to control access. [Learn more](https://cloud.ibm.com/docs/account?topic=account-tag&interface=ui#create-access-console). | `list(string)` | `[]` | no |
| [allow\_credentials](#input\_allow\_credentials) | Boolean value to allow authentication credentials. This will only be used if enable\_cors is set to true. | `bool` | `true` | no |
| [capacity](#input\_capacity) | Number of blocks of throughput units. See https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-ibm-cloud-public#provisioned-throughput-capacity. Capacity modification is not supported for lite plan. | `number` | `1` | no |
| [database\_config](#input\_database\_config) | (Optional, List) The databases with their corresponding partitioning and shards to be created in the cloudant instance |
list(object({
db = string
partitioned = optional(bool)
shards = optional(number)
})) | `[]` | no |
| [enable\_cors](#input\_enable\_cors) | Boolean value to enable cross-origin resource sharing (CORS). | `bool` | `false` | no |
| [environment\_crn](#input\_environment\_crn) | Optional CRN of the IBM Cloudant Dedicated Hardware plan instance to provision a cloudant instance | `string` | `null` | no |
| [include\_data\_events](#input\_include\_data\_events) | Include data event types in events sent to IBM Cloud Activity Tracker. If set to false, only management events will be sent to Activity Tracker. | `bool` | `false` | no |
| [instance\_name](#input\_instance\_name) | The name of the Cloudant instance | `string` | n/a | yes |
| [legacy\_credentials](#input\_legacy\_credentials) | Use both legacy credentials, in addition to IAM credentials for authentication. If set to false, use use only IAM credentials. | `bool` | `false` | no |
| [origins](#input\_origins) | An array of strings that contain allowed origin domains. This value is only used if enable\_cors is set to true. | `list(string)` | `[]` | no |
| [plan](#input\_plan) | The plan for the Cloudant instance. Standard or lite. | `string` | `"standard"` | no |
| [region](#input\_region) | The IBM Cloud region where the Cloudant instance will be provisioned. | `string` | `"us-south"` | no |
| [resource\_group\_id](#input\_resource\_group\_id) | The Id of an existing IBM Cloud resource group where the instance will be grouped. | `string` | n/a | yes |
| [service\_credential\_names](#input\_service\_credential\_names) | List of service credentials to create for the cloudant database, including name and optionally role and endpoint type. |
list(object({
name = string
role = optional(string, "Reader")
endpoint = optional(string, "private")
})) | `[]` | no |
| [service\_endpoints](#input\_service\_endpoints) | Sets the endpoint of the instance, valid values are 'public', 'private', or 'public-and-private' | `string` | `"public-and-private"` | no |
| [tags](#input\_tags) | Add user resource tags to the Cloudant instance to organize, track, and manage costs. [Learn more](https://cloud.ibm.com/docs/account?topic=account-tag&interface=ui#tag-types). | `list(string)` | `[]` | no |
### Outputs
| Name | Description |
|------|-------------|
| [capacity](#output\_capacity) | A number of blocks of throughput units |
| [crn](#output\_crn) | CRN of the resource instance |
| [db\_map](#output\_db\_map) | A map of the Cloudant database names created and their respective IDs |
| [instance\_guid](#output\_instance\_guid) | Global identifier of the cloudant instance created |
| [instance\_id](#output\_instance\_id) | The id of the cloudant instance created |
| [instance\_name](#output\_instance\_name) | Name of the cloudant instance |
| [instance\_url](#output\_instance\_url) | The dashboard URL to access resource |
| [plan](#output\_plan) | The plan used to create cloudant instance |
| [private\_endpoint](#output\_private\_endpoint) | The external private endpoint |
| [public\_endpoint](#output\_public\_endpoint) | The external public endpoint |
| [resource\_group\_name](#output\_resource\_group\_name) | The resource group name in which resource is provisioned |
| [resource\_keys\_url](#output\_resource\_keys\_url) | The relative path to the resource keys for the instance |
| [service\_credentials\_json](#output\_service\_credentials\_json) | Service credentials json map |
| [service\_credentials\_object](#output\_service\_credentials\_object) | Service credentials object |
| [state](#output\_state) | The current state of the instance |
## Contributing
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).
To set up your local development environment, see [Local development setup](https://terraform-ibm-modules.github.io/documentation/#/local-dev-setup) in the project documentation.