Config is a bag of related configuration state. Each bag contains any number of configuration variables, indexed by simple keys, and each has a name that uniquely identifies it; two bags with different names do not share values for variables that otherwise share the same key. For example, a bag whose name is pulumi:foo, with keys a, b, and c, is entirely separate from a bag whose name is pulumi:bar with the same simple key names. Each key has a fully qualified names, such as pulumi:foo:a, ..., and pulumi:bar:a, respectively.

Constructors

Properties

name: string

name is the configuration bag's logical name and uniquely identifies it. The default is the name of the current project.

Methods

  • get loads an optional configuration value by its key, or undefined if it doesn't exist.

    Type Parameters

    • K extends string = string

    Parameters

    • key: string

      The key to lookup.

    • Optional opts: StringConfigOptions<K>

      An options bag to constrain legal values.

    Returns undefined | K

  • getBoolean loads an optional configuration value, as a boolean, by its key, or undefined if it doesn't exist. If the configuration value isn't a legal boolean, this function will throw an error.

    Parameters

    • key: string

      The key to lookup.

    Returns undefined | boolean

  • getNumber loads an optional configuration value, as a number, by its key, or undefined if it doesn't exist. If the configuration value isn't a legal number, this function will throw an error.

    Parameters

    • key: string

      The key to lookup.

    • Optional opts: NumberConfigOptions

      An options bag to constrain legal values.

    Returns undefined | number

  • getObject loads an optional configuration value, as an object, by its key, or undefined if it doesn't exist. This routine simply JSON parses and doesn't validate the shape of the contents.

    Type Parameters

    • T

    Parameters

    • key: string

      The key to lookup.

    Returns undefined | T

  • getSecret loads an optional configuration value by its key, marking it as a secret, or undefined if it doesn't exist.

    Type Parameters

    • K extends string = string

    Parameters

    • key: string

      The key to lookup.

    • Optional opts: StringConfigOptions<K>

      An options bag to constrain legal values.

    Returns undefined | Output<K>

  • getSecretBoolean loads an optional configuration value, as a boolean, by its key, making it as a secret or undefined if it doesn't exist. If the configuration value isn't a legal boolean, this function will throw an error.

    Parameters

    • key: string

      The key to lookup.

    Returns undefined | OutputInstance<boolean>

  • getSecretNumber loads an optional configuration value, as a number, by its key, marking it as a secret or undefined if it doesn't exist. If the configuration value isn't a legal number, this function will throw an error.

    Parameters

    • key: string

      The key to lookup.

    • Optional opts: NumberConfigOptions

      An options bag to constrain legal values.

    Returns undefined | OutputInstance<number>

  • getSecretObject loads an optional configuration value, as an object, by its key, marking it as a secret or undefined if it doesn't exist. This routine simply JSON parses and doesn't validate the shape of the contents.

    Type Parameters

    • T

    Parameters

    • key: string

      The key to lookup.

    Returns undefined | Output<T>

  • require loads a configuration value by its given key. If it doesn't exist, an error is thrown.

    Type Parameters

    • K extends string = string

    Parameters

    • key: string

      The key to lookup.

    • Optional opts: StringConfigOptions<K>

      An options bag to constrain legal values.

    Returns K

  • requireBoolean loads a configuration value, as a boolean, by its given key. If it doesn't exist, or the configuration value is not a legal boolean, an error is thrown.

    Parameters

    • key: string

      The key to lookup.

    Returns boolean

  • requireNumber loads a configuration value, as a number, by its given key. If it doesn't exist, or the configuration value is not a legal number, an error is thrown.

    Parameters

    • key: string

      The key to lookup.

    • Optional opts: NumberConfigOptions

      An options bag to constrain legal values.

    Returns number

  • requireObject loads a configuration value as a JSON string and deserializes the JSON into a JavaScript object. If it doesn't exist, or the configuration value is not a legal JSON string, an error is thrown.

    Type Parameters

    • T

    Parameters

    • key: string

      The key to lookup.

    Returns T

  • require loads a configuration value by its given key, marking it as a secret. If it doesn't exist, an error is thrown.

    Type Parameters

    • K extends string = string

    Parameters

    • key: string

      The key to lookup.

    • Optional opts: StringConfigOptions<K>

      An options bag to constrain legal values.

    Returns Output<K>

  • requireSecretBoolean loads a configuration value, as a boolean, by its given key, marking it as a secret. If it doesn't exist, or the configuration value is not a legal boolean, an error is thrown.

    Parameters

    • key: string

      The key to lookup.

    Returns OutputInstance<boolean>

  • requireSecretNumber loads a configuration value, as a number, by its given key, marking it as a secret. If it doesn't exist, or the configuration value is not a legal number, an error is thrown.

    Parameters

    • key: string

      The key to lookup.

    • Optional opts: NumberConfigOptions

      An options bag to constrain legal values.

    Returns OutputInstance<number>

  • requireSecretObject loads a configuration value as a JSON string and deserializes the JSON into a JavaScript object, marking it as a secret. If it doesn't exist, or the configuration value is not a legal JSON string, an error is thrown.

    Type Parameters

    • T

    Parameters

    • key: string

      The key to lookup.

    Returns Output<T>

Generated using TypeDoc