# Resource Attribute Aliases

Resource Attribute Aliases let you define shorthand names and default values for resource properties, making your desired state templates shorter and more readable.

### Overview

When authoring desired state YAML, certain resource properties require long or hard-to-remember values (e.g., Azure VM image references, disk SKUs). Instead of looking these up every time, you can define aliases that map a friendly name to the actual value, and set default values for properties you use frequently.

### How It Works

Aliases are configured per **team**, **cloud provider**, and **resource type**. Each alias mapping has three fields:

| Field         | Description                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------- |
| **Attribute** | The resource property path (e.g., `storage_profile.image_reference`)                        |
| **Alias**     | A short, memorable name you can use in templates (e.g., `ubuntu-arm64`)                     |
| **Default**   | A default value applied automatically if the property is not specified in the desired state |

### Managing Aliases

Navigate to **Infrastructure → Stateless IaC Aliases** in the MechCloud console.

1. Select a **Team** and **Cloud Provider**
2. Click **New Alias** to create a mapping for a resource type
3. Define one or more attribute mappings with alias names and/or default values
4. Click **Save**

### Supported Providers

Aliases are available for all cloud providers that support Stateless IaC:

* **AWS** — e.g., AMI aliases (see [Resource Id Aliases](https://github.com/pistonportal/gitbook-mechcloud/blob/main/cloud-computing/stateless-iac/common-concepts.md#resource-id-aliases) for the `{{Image|alias}}` syntax)
* **Azure** — e.g., VM image references, disk types, VM sizes
* **GCP** — e.g., machine types, disk types, image families

### Benefits

* **Shorter templates** — Replace verbose property values with short alias names
* **Consistency** — Default values ensure all resources of a type use the same base configuration
* **Less errors** — No need to look up exact values for common properties
* **Team-scoped** — Each team can define their own aliases matching their standards


---

# 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.mechcloud.io/cloud-computing/stateless-iac/resource-attribute-aliases.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.
