Skip to content

CMDB Tenant Defaults Overview

What Does it Do?

Imagine a complex Template with many inputs, this is not a great user experience. CMDB Tenant Defaults takes care of this.

ESS can request defaults for Tenant/ Template combinations from any CMDB via an API call.

For each tenant/ template combination it is possible to define default values. This is a very powerful feature when it comes to self-service. Variables on Deployment forms can be pre-filled per Tenant which, depending on the use case, can make self-service deployment of infrastructure as simple as one click.

Defaults can be specified to provide dropdown lists of options, such as compute instance sizes, or access policies for storage resources. Defaults can be readonly for the form, invisible or choices, each use case is catered for. Defaults hide technical details required for Templates but can expose informational parameters where necessary, and provide choices where they should be limited instead of free-form entries.

API Specification

The API has only to conform to a basic specification:

  • It needs to accept GET requests
  • If needs to accept 2 parameters as query strings, tenant and template. These are the same names as used in ESS
  • It should return an object with the fields needed for the template and how those fields should be displayed on the form. An example API response is shown below:
{
  "variables": {
    "disk_size": {
      "value": [
        "50",
        "100",
        "200"
      ]
    },
    "vpc_name": {
      "type": "readonly",
      "value": "prod-vpc"
    },
    "instance_profile": {
      "type": "readonly",
      "value": "AmazonSSMRoleForInstancesQuickSetup"
    },
    "ami": {
      "type": "hidden",
      "value": "ami-08f32efd140b7d89f"
    },
    "instance_type": {
      "value": [
        "t3.medium",
        "t3.large"
      ]
    }
  }
}

This provides the defaults for the following variables defined in the template:

variable "instance_type" {
  description = "Choose an instance type for your EC2"
  type    = string
  default = "t3.large"
}

variable "ami" {
    type = string
}

variable "instance_profile" {
    type = string
}

variable "vpc_name" {
    type = string
}

variable "disk_size" {
    type = number
}

Thetype field in the API response changes how the individual fields are displayed in the Deployment creation form:

CMDB Tenant Defaults

Sample code for an AWS based API backed by a DynamoDB database for defaults is available in our public repository: WIP

To learn more about Tenant based configuration defaults click here