# Actions

{% hint style="info" %}
Only users that belongs to Terrakube administrator group can create and edit actions. This group is defined in the terrakube settings during deployment, for more details see [#administrator-group](https://docs.terrakube.io/getting-started/security#administrator-group "mention")
{% endhint %}

Terrakube actions allow you to extend the UI in Workspaces, functioning similarly to plugins. These actions enable you to add new functions to your Workspace, transforming it into a hub where you can monitor and manage your infrastructure and gain valuable insights. With Terrakube actions, you can quickly observe your infrastructure and apply necessary actions.

### **Key Benefits of Terrakube Actions:**

* **Extend Functionality:** Customize your Workspace with additional functions specifics to your needs.
* **Monitor Infrastructure:** Gain real-time insights into your infrastructure with various metrics and monitoring tools.
* **Manage Resources:** Directly manage and interact with your resources from within the Workspace.
* **Flexibility:** Quickly disable an action if it is not useful for your organization or set conditions for actions to appear, such as if a resource is hosted in GCP or if the workspace is `Dev`.
* **Cloud-Agnostic Hub:** Manage multi-cloud infrastructure from a single point, providing observability and actionability without needing to navigate individual cloud portals.

### **Examples of Terrakube Actions:**

* **Manage Infrastructure:** Restart your Azure VM or add an action to quickly navigate to the resource in the Azure portal directly from Terrakube.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-1daf576cb6597b15f01ec6a5f2f3ec2e76f51a48%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Monitor Metrics:** Track and display resource metrics for performance monitoring using tools like Prometheus, Azure Monitor or AWS Cloudwatch.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-e94df8231dbd7930fde1d6e490380fbae63598d3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Integrate with Tools:** Seamlessly integrate with tools like Infracost to display resource and Workspace costs.
* **AI Integration:** Use AI to diagnose issues in your Workspaces. By integrating with models like OpenAI, Claude, and Gemini, you can quickly resolve errors in your infrastructure.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-0c9bb80be9bb9cb1dc2eab2af5510ee031f2ef88%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Project and Incident Management:** Integrate with Jira, GitHub Issues, and ServiceNow to identify Workspaces with pending work items or reported errors.
* **Documentation:** Link your Confluence documentation or wiki pages in your preferred tool, allowing quick access to documents related to your Workspace infrastructure.

### Built-in Actions

Terrakube provides several [built-in actions](https://docs.terrakube.io/user-guide/workspaces/actions/built-in-actions) that you can start using some are enabled by default. Please refer to the documentation for detailed information on each action, including usage and setup instructions.

### Developing Actions

If you are interested in creating your own actions, you only need knowledge of JavaScript and React, as an action is essentially a React component. For more details please check our [quick start guide](https://docs.terrakube.io/user-guide/workspaces/actions/developing-actions/quick-start), or visit our [GitHub Terrakube Actions repository](https://github.com/AzBuilder/terrakube-actions) to see some examples, contribute new actions or suggest improvements.

### Creating an Action

After you develop your action. To create a new action in Terrakube:

1. Navigate to the settings in any Terrakube organization.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-82ebc5b9c1d0632e4c15252c90963562e681ff0e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Click the `Add Action` button.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-f31fd9721a14c5d337b3cf56ae702d51b2eda8b0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Provide the required information as detailed in the table below:

| Field Name       | Description                                                                                                                                                                                                                                                      |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ID               | A unique ID for your action. Example: `terrakube.demo-action` or `myorg.my-action`                                                                                                                                                                               |
| Name             | A unique name for your action.                                                                                                                                                                                                                                   |
| Type             | Defines the section where this action will appear. Refer to [Action Types ](https://docs.terrakube.io/user-guide/workspaces/actions/developing-actions/action-types)to see the specific area where the action will be rendered.                                  |
| Label            | For tabs actions, this will be displayed as the tab name. For action buttons, it should be displayed as the button name.                                                                                                                                         |
| Category         | This helps to organize the actions based on their function. Example: General, Azure, Cost, Monitor.                                                                                                                                                              |
| Version          | Must follow semantic versioning (e.g., 1.0.0).                                                                                                                                                                                                                   |
| Description      | A brief description of the action.                                                                                                                                                                                                                               |
| Display Criteria | Defines the conditions under which the action should appear based on the context. For more details, check the [Display Criteria ](https://docs.terrakube.io/user-guide/workspaces/actions/developing-actions/display-criteria)documentation.                     |
| Action           | A JavaScript function equivalent to a React component. Receives the context with some data related to the context. See our [quick start ](https://docs.terrakube.io/user-guide/workspaces/actions/developing-actions/quick-start)guide to start creating actions |
| Active           | Enables or disables an action.                                                                                                                                                                                                                                   |

4. Click the `Save` button.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-5ad30e1284f16de26c98b3e369560613669904d3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

\\


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.terrakube.io/user-guide/workspaces/actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
