Skip to main content
Glama

terraform-cloud-mcp

create_variable_in_variable_set

Add a new Terraform or environment variable to a variable set. Define key, category, and optional parameters like value, description, HCL status, or sensitivity to manage infrastructure configurations effectively.

Instructions

Create a new variable in a variable set.

Creates a new Terraform or environment variable within a variable set. Variables can be marked as sensitive to hide their values.

API endpoint: POST /varsets/{varset_id}/relationships/vars

Args: varset_id: The ID of the variable set (format: "varset-xxxxxxxx") key: The variable name/key category: Variable category ("terraform" or "env")

params: Additional variable parameters (optional): - value: Variable value - description: Description of the variable - hcl: Whether the value is HCL code (terraform variables only) - sensitive: Whether the variable value is sensitive

Returns: The created variable with its configuration and metadata

See: docs/tools/variables.md#create-variable-in-variable-set for reference documentation

Input Schema

NameRequiredDescriptionDefault
categoryYes
keyYes
paramsNo
varset_idYes

Input Schema (JSON Schema)

{ "$defs": { "VariableCategory": { "description": "Variable category options for workspace variables.\n\nDefines the type of variable:\n- TERRAFORM: Terraform input variables available in configuration\n- ENV: Environment variables available during plan/apply operations\n\nReference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/workspace-variables\n\nSee:\n docs/models/variables.md for reference", "enum": [ "terraform", "env" ], "title": "VariableCategory", "type": "string" }, "VariableSetVariableParams": { "description": "Parameters for variable set variable operations without routing fields.\n\nThis model provides all optional parameters for creating or updating variables\nwithin variable sets, separating configuration parameters from routing information\nlike variable set ID and variable ID.\n\nReference: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/variable-sets\n\nSee:\n docs/models/variables.md for reference", "properties": { "category": { "anyOf": [ { "$ref": "#/$defs/VariableCategory" }, { "type": "null" } ], "default": null, "description": "Variable category (terraform or env)" }, "description": { "anyOf": [ { "maxLength": 512, "type": "string" }, { "type": "null" } ], "default": null, "description": "Description of the variable", "title": "Description" }, "hcl": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "Whether the value is HCL code (only valid for terraform variables)", "title": "Hcl" }, "key": { "anyOf": [ { "maxLength": 255, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Variable name/key", "title": "Key" }, "sensitive": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "Whether the variable value is sensitive", "title": "Sensitive" }, "value": { "anyOf": [ { "maxLength": 256000, "type": "string" }, { "type": "null" } ], "default": null, "description": "Variable value", "title": "Value" } }, "title": "VariableSetVariableParams", "type": "object" } }, "properties": { "category": { "title": "Category", "type": "string" }, "key": { "title": "Key", "type": "string" }, "params": { "anyOf": [ { "$ref": "#/$defs/VariableSetVariableParams" }, { "type": "null" } ], "default": null, "title": "Params" }, "varset_id": { "title": "Varset Id", "type": "string" } }, "required": [ "varset_id", "key", "category" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/severity1/terraform-cloud-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server