---
title: "<parameter> Element"
url: https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/parameter-descriptor-element
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# \<parameter> Element

A `parameter` element defines a [template](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-templates.md) parameter. Template parameters must be declared with this element to be used in template instantiation.

This element may only appear as a child of a [server-template](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/server-template-descriptor-element.md) element or a [service-template](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/service-template-descriptor-element.md) element.

The following attributes are supported:

| **Attribute** | **Description** | **Required** |
| --- | --- | --- |
| `name` | The name of the parameter. For example, if `index` is used as the name of a parameter, it can be referenced using `${index}` in the server or service template. | Yes |
| `default` | An optional default value for the parameter. This value is used if the parameter is not defined when a server or service is instantiated. | No |

Here is an example to demonstrate the use of this element:

```xml
<server-template id="MyServerTemplate">
    <parameter name="index"/>
    <parameter name="exepath" default="/opt/myapp/bin/server"/>
    ...
</server-template>
```

## See Also

- [IceGrid Templates](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-templates.md)
- [Server-Template Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/server-template-descriptor-element.md)
- [Service-Template Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/service-template-descriptor-element.md)
- [Using Descriptor Variables and Parameters](https://docs.zeroc.com/ice/3.8/services/icegrid/using-descriptor-variables-and-parameters.md)
