Values, data types, and aliases

Most of the things you can do with the Puppet language involve some form of data. An individual piece of data is called a value, and every value has a data type, which determines what kind of information that value can contain and how you can interact with it.

Strings are the most common and useful data type, but you’ll also work with others, including numbers, arrays, and some Puppet-specific data types like resource references.

Note that once created, Puppet's values are immutable — they cannot be modified in any way.

For information on type conversion, see Typecasting.

Literal data types as values

Although you’ll mostly interact with values of the various data types, Puppet also includes values like String that represent data types.

You can use these special values to examine a piece of data or enforce rules. Usually, they act like patterns, similar to a regular expression: given a value and a data type, you can test whether the value matches the data type, and then either adjust your code’s behavior accordingly, or raise an error if something has gone wrong.

The pages in this section provide details about using each of the data types as a value. For information about the syntax and behavior of literal data types, see Data type syntax. For information about special abstract data types, which you can use to do more sophisticated or permissive type checking, see Abstract data types.

Puppet data types

See the following pages to learn more about the syntax, parameters, and usage for each of the data types.