Cloudability Setup IBM Cloud Credentials using Cloudability Method
Summary
Connect or credential your IBM Cloud accounts to Cloudability to enable the ingestion of cost and usage data. This document focuses on the Cloudability method and provides a step-by-step guide for setting up an IBM Cloud workspace using Terraform. The workspace will be used to deploy infrastructure using Terraform configurations hosted on a GitHub repository.
Prerequisite
Enabling your IBM account to export usage data
Before you can enable your IBM account to export usage data, you need to have administrator or editor role on the Billing account management service. For more information, see IAM access .
- From the IBM Cloud console, go to Manage > Billing and usage , and select Settings .
- Click Connect .
- Select a Cloud Object Storage instance and Bucket . By selecting these, you
are choosing which bucket will store your usage reports.
-
Optional: If you don't want to select an existing instance, click Select an instance > Create new .
-
Optional: Select a bucket or create a new bucket by clicking Create new bucket from the dropdown. For more information, see Getting started with IBM Cloud Object Storage .
-
- For service to service authorizations, click Authorize . For the required access, select Object Writer and Content Reader . Click Review and then Assign .
- Click Connect after you review your folder details.
Reference: Exporting your usage data for continual insights
Copy Account Details
For account where enterprise is configured
- Navigate to Manage .
- Select Enterprise from the dropdown.
- Access Dashboard and locate the ID field.
- Navigate to Manage .
- Click Enterprise from the dropdown and then select Accounts .
- Identify the account labeled as 'This account is the enterprise account' and copy its ID.
For Account where Enterprise is not configured
- Navigate to Manage .
- Click Account from the dropdown and then select Account Settings .
- Copy its ID.
- Access the IBM Cloud navigation menu.
- Go to Resource List and select Storage .
- Choose the Cloud Object Storage instance that contains the Bucket where the Usage
Report is exported.
- Access the IBM Cloud Navigation Menu.
- Go to Resource List , select Storage and then choose Storage Instance .
- Find the Buckets section and select the Bucket where the Usage Report is exported.
- Navigate to Configuration and copy the Bucket Name and Location (Region).
- Access the IBM Cloud Navigation Menu.
- Go to Resource List , select Storage and then choose Storage Instance .
- Find the Buckets section and select the Bucket where the Usage Report is exported.
- Access the IBM Cloud Navigation menu and select the Bucket where the Usage Report is exported.
Copy the prefix located between the Bucket Name and the folder name (containing year and month; e.g., 2023-10), excluding both the Bucket Name and the Year-Month folder name.
- Access the IBM Cloud Navigation Menu.
- Go to Resource List , select Storage and then choose Storage Instance .
- Find the Buckets section and select the Bucket where the Usage Report is exported.
- Access the IBM Cloud Navigation menu and select the Bucket where the Usage Report is exported.
- Navigate to any Year-Month folder and copy the file name named 'manifest' (the default file name
is manifest). Note:
Do not copy the file name extension. It should be just ‘manifest’ and not manifest.json.
- Ensure all details are copied and readily accessible.
- Login to Cloudability UI and navigate to Settings: Vendor
Credentials: Click ‘Add Datasource’ and select 'IBM'.
- Under Add IBM Account side panel, click Next .
- Enter all the details copied earlier and click Generate Template . Note:
Cost Report Name should not have the filename extension (.json).
Executing the Terraform
- Ensure that Terraform has been downloaded and is hosted on a repository such as GitHub. Note:
If your GitHub repository is private, you will need to generate a Personal Access Token (PAT) as described here.
- Also, make sure that you have Account Owner or Manager Service access and Administrator Platform access for Schematics Service in your IAM Access.
Steps for Execution
- Navigate to the IBM Cloud login page.
- Enter your IBM Cloud credentials and log in to your IBM Cloud account.
- After logging in, access the Navigation menu within IBM Cloud.
- From the Navigation menu, select Schematics .
- Click Workspaces to access the workspace management interface.
- Click Create Workspace to initiate the workspace creation process.
- Provide the GitHub repository URL where your Terraform configuration files are hosted.
- If your GitHub repository is private, provide the Personal Access Token (PAT) that you generated
during the prerequisites.
Reference: Managing your personal access tokens
- Select the latest Terraform Version, in this case, terraform_v1.5 . Note:
Terraform version should be v1.5 and above.
- Click Next to proceed.
- Provide a name for your workspace, e.g., 'CldyWorkspace'.
- Under Tags , add a tag named "createdFor" with the value 'Cldy'.
- Leave the Resource Group as 'Default'.
- Choose a location for your workspace, as it determines where workspace actions will be executed.
- Description is optional.
- Click Next to continue.
Step 5: Apply the Terraform Plan
- Click Create to confirm and create the workspace.
- Your CldyWorkspace will be created.
- Select 'CldyWorkspace' from the list of workspaces.
- Navigate to Settings for 'CldyWorkspace'.
- From the Variables section, expand three dots (ellipsis), and select Edit .
-
Your CldyWorkspace will be created. Provide your ibmcloud_api_key, which must have the necessary access to create IAM resources.
Reference: Managing user API Keys
- Select Sensitive checkbox if you want to treat this variable value as sensitive or
secret information. This prevents it from being exposed in workspace details, CLI output, or log
output.
- After configuring the variables, return to 'CldyWorkspace' and go to the Jobs section.
- Click Apply plan to initiate the deployment of Terraform configuration.
- Once Apply plan is successful, you can access the resources that were created in the
Manage section.
- Custom Roles can be found under Access (IAM) > Roles .
- This concludes you have successfully deployed resources and can manage access and roles as needed .
- Once terraform plan is applied successfully, come back to the Cloudability UI and click Verify Credentials . The green
check mark indicates that the credentialing process has been successful.
Note:
To learn more, visit Vendor Credentials .
Sample Terraform Script
(Expandable Header)