Package com.pulumi

Class Config

java.lang.Object
com.pulumi.Config

@ParametersAreNonnullByDefault public class Config extends Object
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.
See Also:
  • Constructor Details

  • Method Details

    • of

      @InternalUse @Deprecated public static Config of(String name)
      Deprecated.
      will be removed in the future, use ConfigContext.config(String)
      For internal use by providers.
      See Also:
    • getName

      @Nonnull public String getName()
      The configuration bag's logical name and uniquely identifies it. The default is the name of the current project.
      Returns:
      unique logical configuration bag name
    • get

      public Optional<String> get(String key)
      Loads an optional configuration value by its key, or returns empty if it doesn't exist.
    • getSecret

      public Output<Optional<String>> getSecret(String key)
      Loads an optional configuration value by its key, marking it as a secret, or empty if it doesn't exist.
    • getBoolean

      public Optional<Boolean> getBoolean(String key)
      Loads an optional configuration value, as a boolean, by its key, or null if it doesn't exist. If the configuration value isn't a legal boolean, this function will throw an error.
    • getSecretBoolean

      public Output<Optional<Boolean>> getSecretBoolean(String key)
      Loads an optional configuration value, as a boolean, by its key, making it as a secret or null if it doesn't exist. If the configuration value isn't a legal boolean, this function will throw an error.
    • getInteger

      public Optional<Integer> getInteger(String key)
      Loads an optional configuration value, as a number, by its key, or null if it doesn't exist. If the configuration value isn't a legal number, this function will throw an error.
    • getDouble

      public Optional<Double> getDouble(String key)
      Loads an optional configuration value, as a number, by its key, or null if it doesn't exist. If the configuration value isn't a legal number, this function will throw an error.
    • getSecretInteger

      public Output<Optional<Integer>> getSecretInteger(String key)
      Loads an optional configuration value, as a number, by its key, marking it as a secret or null if it doesn't exist. If the configuration value isn't a legal number, this function will throw an error.
    • getObject

      public <T> Optional<T> getObject(String key, Class<T> classOfT)
      Loads an optional configuration value as a JSON string and deserializes it as an object, by its key, or null if it doesn't exist. This works by taking the value associated with key and passing it to Gson.fromJson(Reader, Class).
    • getSecretObject

      public <T> Output<Optional<T>> getSecretObject(String key, Class<T> classOfT)
      Loads an optional configuration value as a JSON string and deserializes it as an object, by its key, marking it as a secret or null (empty) if it doesn't exist. This works by taking the value associated with key and passing it to Gson.fromJson(Reader, Class).
    • getObject

      public <T> Optional<T> getObject(String key, TypeShape<T> shapeOfT)
      See Also:
    • getSecretObject

      public <T> Output<Optional<T>> getSecretObject(String key, TypeShape<T> shapeOfT)
      See Also:
    • require

      public String require(String key)
      Loads a configuration value by its given key. If it doesn't exist, an error is thrown.
    • requireSecret

      public Output<String> requireSecret(String key)
      Loads a configuration value by its given key, marking it as a secret. If it doesn't exist, an error is thrown.
    • requireBoolean

      public boolean requireBoolean(String key)
      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.
    • requireSecretBoolean

      public Output<Boolean> requireSecretBoolean(String key)
      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.
    • requireInteger

      public int requireInteger(String key)
      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.
    • requireSecretInteger

      public Output<Integer> requireSecretInteger(String key)
      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.
    • requireDouble

      public double requireDouble(String key)
      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.
    • requireSecretDouble

      public Output<Double> requireSecretDouble(String key)
      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.
    • requireObject

      public <T> T requireObject(String key, Class<T> classOfT)
      Loads a configuration value as a JSON string and deserializes it into an object. If it doesn't exist, or the configuration value cannot be converted using Gson.fromJson(Reader, Class), an error is thrown.
    • requireSecretObject

      public <T> Output<T> requireSecretObject(String key, Class<T> classOfT)
      Loads a configuration value as a JSON string and deserializes it into an object, marking it as a secret. If it doesn't exist, or the configuration value cannot be converted using Gson.fromJson(Reader, Class), an error is thrown.