Cloud Services

Enterprise Marketplace

Terraform Automation integration
Published On Oct 08, 2024 - 8:47 AM

Terraform Automation integration

This page covers the steps to configure Terraform Automation to integrate with your tenant.

Associate Terraform Automation Namespace to Kyndryl Modern Operations Applications

Create context values for Terraform Namespace using the following steps:
  1. Log in to the tenant.
  2. Navigate to the
    Context Type
    page. To learn more about navigating to the different services from each tenant, refer to Landing page navigation or Kyndryl Bridge Landing page navigation.
  3. Click the
    Actions
    icon for the Terraform_Namespace and select
    Add Context Value
    .
  4. Enter an
    ID
    and
    Name
    for the new context value.
  5. Click
    Create
    to add the new context value to Terraform_Namespace.
  6. Repeat steps 3 to 5 for each context value that you want to add.
You can click the
Actions
icon for the context values to access the following options:
  • Edit:
    You can edit the existing context value.
  • Delete:
    You can delete the selected context value.
You also need to associate the Terraform Namespace context with a Buyer in a team. To do so, complete the following steps:
  1. Log in your tenant.
  2. Navigate to the
    User Access
    page. To learn more about navigating to the different services from each tenant, refer to Landing page navigation or Kyndryl Bridge Landing page navigation.
  3. Click the
    Actions
    icon for the Team and select
    View Details
    .
  4. Under
    Roles
    , click the
    Actions
    icon for the Buyer and select
    View Details
    .
  5. Click
    Edit
    .
  6. Add the
    Namespace
    association for the
    Terraform Namespace
    context.

Setting up a provider account

Complete the following steps to set up the Terraform Automation provider
  1. Log in to your tenant.
  2. Navigate to the
    Provider Account
    page. To learn more about navigating to the different services from each tenant, refer to Landing page navigation or Kyndryl Bridge Landing page navigation.
  3. Click the
    Asset Accounts
    tab.
  4. Click
    New Asset Accounts
    .
  5. Click
    Terraform Automation
    .
  6. On the
    New Asset Account
    page, enter the following parameters and then click
    Create
    :
    • Name:
      The name of the provider account.
    • Description:
      You can provide an optional description of the provider account.
    • CloudPak MCM Team:
      The name of the MCM team.
    • Terraform Automation Endpoint URL:
      The Terraform Automation URL.
    • CloudPak MCM Endpoint URL:
      The Cloud Pak URL.
    • Tenant ID:
      The Tenant ID of Terraform Automation.
    • Proxy Flag:
      If MCM and your tenant are deployed in the same network, set this flag to
      False
      . Otherwise, set it as
      True
      .
  7. Click
    Add Credential
    .
  8. On the
    Add Credential
    page, enter the following parameters and then click
    Add
    .
    • Name:
      Enter a name for the credential.
    • Purpose:
      Select the purpose of the credential as
      Provisioning and Catalog Ingestion
      if you want to use the same provider account for Catalog Ingestion and Provisioning.
    • User Name:
      Enter the Cloud Pak user name that you want to use.
    • Select either
      Create New
      or
      Update Credential in Vault
      .
    • Password:
      Enter the password for the CloudPak user name that you entered.
    • Associate/select the context and assign their respective Values:
      • Organization/Team
      • Terraform Namespace

Catalog ingestion

After configuring the provider account, the Catalog Admin can initiate the Catalog Discovery by selecting Terraform Automation as a provider. The Catalog Admin can observe the discovery state for Terraform Automation in the
Provider
section on the
Catalog Admin
page. After the Discovery completes successfully, all the published catalogs of Terraform Automation will be available and visible in the
Drafts
section of the Catalog Admin.

Publishing catalogs

After successful Catalog Discovery, all the catalogs along with their different versions will be available in Enterprise Marketplace in the Draft state. The Catalog Admin can edit the catalog including the following details:
  • The
    Icon
    of the catalog
  • Select Category
  • Group
  • Enable Multi-quantity
  • Labels
After editing, the catalog moves into the Work In Progress state. After all the required changes are complete, the Catalog Admin can move the catalog from Work in Progress to the Published state. After the catalog is published, it will be available on the
Catalog
page.

Provisioning catalogs

The Buyer can log in to Enterprise Marketplace and view the catalogs available in Terraform Automation on the
Catalog
page. Select the catalog that you want to configure. If the catalog contains multiple versions, then all those versions are displayed along with other details such as
Feature
,
Starting price
for the catalog,
Details
, and
Namespace
. You can select the version of the catalog that you want and configure it by filling in the appropriate details in the
Main Parameter
and
Additional parameter
tabs. Review the order and then submit it for provisioning. For more information, see Catalog ordering.

Order and approval management

After placing the order for provisioning, the order appears on the
Approve orders
page for the Technical and Financial approver in the Approval in progress state. After the order is approved, it initiates the provisioning of services for the respective provider, in this case Terraform Automation. On the
Order History
page the state of service is displayed as Provisioning in Progress. After the order is successfully provisioned, the service is shown as Completed. In the case of failure, it shows as Failed on the
Order History
catalog
The Buyer can see various details for the order like
Order Details
,
catalog Details
,
Bill of Material
, and logs.

Failure management

From Enterprise Marketplace, the Buyer can order the catalog. After the order is approved, it is provisioned to the provider. If the order fails, the buyer can perform the following actions on the failed order from the
Order History
page.

Retry

If Provisioning fails, the order shows as Failed on the
Order History
page. The buyer can Retry the failed order from the
Order History
page. The Retry action deletes all the resources associated with the catalog, which includes both successfully deployed and partially deployed resources. The action then tries to deploy the catalog again. If this retry is successful, the order state changes to Completed. Otherwise, it remains in the Failed state.

Cancel

If provisioning fails, the order shows as Failed on the
Order History
page. The buyer and team can Cancel the failed order from the
Order History
page. The Cancel action deletes all the resources associated with the catalog, which includes successfully deployed as well as partially deployed resources. If the Cancel action is successful, the order state changes to Cancelled. Otherwise, it remains in the Failed state.

View failures

A
View Failures
link is visible for any Failed catalogs on the
Order History
page. You can click this link to view the catalog failure details. The details page provides links to the Service logs and Resource logs that can help determine the reason for the failure. These logs can also be exported for further study.
The
View Failures
link is not visible for failed Custom operation orders.

Inventory view

After an order has been successfully provisioned, the stack will be visible in Inventory. The following operations can be carried out at the stack and stack component levels:

Standard operations at the stack component level

The following standard operations can be carried out at the stack component level:
  • Access Component:
    Provides buyer with Instructions on how to connect to the virtual machine including the IP address. This is only applicable to virtual machines (VMs).
  • View Component:
    Shows a detailed view for the selected component.
  • Shutdown:
    Gracefully turns off a VM.
  • Start:
    Powers on a stopped VM.
  • Stop:
    Performs a forced power off of a VM without an operating system shutdown.
  • Taint:
    Marks a Terraform managed resource as tainted. The tainted resource is deleted and recreated during the next apply.
  • Untaint:
    Removes the Taint flag from the resource.

Edit stack

After successful provisioning of Order, the stack will be visible in Inventory. Enterprise Marketplace allows you to edit an already provisioned stack (active catalog instance). You can do so by clicking the
Edit
option that is visible after you click
Service Instance
in the
Inventory
page.
You can configure catalog parameters to make the stacks based on that catalog editable or not editable in Terraform Automation. By default, the parameters are editable at Terraform Automation. In Enterprise Marketplace, while performing
Edit Service
operation, you can edit editable parameters. For non-editable parameters, the user interface will show the previously selected values and not allow the user to edit those parameters. After you submit an edit order, it follows the order workflow and it provisions the catalog with the new specified parameter.

Upgrade and downgrade at the stack level

In Terraform Automation, a catalog can have more than one catalog version associated with it. To enable upgrade and downgrade the stacks based on that catalog, the feature should be enabled before publishing it at Terraform Automation. All the versions of the catalog should have the same plan for upgrading and downgrading to different versions of the catalog.
After successful provisioning of such a catalog through Enterprise Marketplace, the stack will be visible in the
Inventory
page. The Buyer can check the Available Versions for the catalog from stack and can upgrade or downgrade the catalog version available for that stack.
By selecting upgrade or downgrade configuration from stack, the order will invoke and then follow the order approval flow. Upon successful order provision, the respective stack will reflect the appropriate catalog version and stack component in the stack.
Do you have two minutes for a quick survey?
Take Survey