This Pulumi example will demonstrate how to provision Resource Group, Key Protect, Object Storage and Watson Discovery instances using Terraform IBM Modules.
Before you begin, ensure you have:
a) Pulumi CLI installed
b) IBM Cloud CLI installed and configured (optional)
c) An IBM Cloud API key
d) Git installed
1. Clone the repository
git clone https://github.com/terraform-ibm-modules/sample-iac-solutions.git
cd sample-iac-solutions/pulumi-egs/pulumi2. Log in to Pulumi (either you can create an account in Pulumi or use local-only mode).
pulumi login --local3. Create new Pulumi Stack
Provide the Stack details and Passphrase to be used
pulumi stack init dev # dev is name of the new stack that will be created.4. Install dependencies
Add pulumi IBM provider package and Terraform modules to the project :
pulumi package add terraform-provider ibm-cloud/ibm
pulumi package add terraform-module terraform-ibm-modules/cos/ibm 10.7.2 ibm_cos_module
pulumi package add terraform-module terraform-ibm-modules/kms-all-inclusive/ibm 5.5.5 ibm_kms_module
pulumi package add terraform-module terraform-ibm-modules/resource-group/ibm 1.4.6 ibm_rg_module
pulumi package add terraform-module terraform-ibm-modules/watsonx-discovery/ibm 1.11.1 wx_discovery5. Configure IBM Cloud credentials
Export your API key:
export IBMCLOUD_API_KEY=<your_ibmcloud_api_key> # pragma: allowlist secret6. Set Pulumi stack config
If required to change the default values, update the configuration file for region, prefix and access group:
pulumi config set region us-south # Provide region
pulumi config set prefix pulumi-demo # Provide the prefix
pulumi config set access_group "Public Access" # Replace with Access group of your choice. Make sure the provided Access Group exists in IBMCloud account.7. Preview the changes
pulumi preview8. Apply the changes
pulumi up9. Destroy the resources
pulumi downAfter deployment, verify that resources were provisioned successfully:
- Pulumi Console Output – Confirm resource creation summary.
- Login to IBM Cloud Console and verify –
- COS instance and bucket under Object Storage
- Watson Discovery instance in the dashboard
- Resource Group and Key Protect instance under Resource List



