Package com.pulumi
Class Config
- java.lang.Object
-
- com.pulumi.Config
-
@ParametersAreNonnullByDefault public class Config extends java.lang.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 ispulumi:foo
, with keysa
,b
, andc
, is entirely separate from a bag whose name ispulumi:bar
with the same simple key names. Each key has a fully qualified names, such aspulumi:foo:a
, ..., andpulumi:bar:a
, respectively.- See Also:
ConfigContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Config.ConfigMissingException
ConfigMissingException is used when a configuration value is completely missing.
-
Constructor Summary
Constructors Constructor Description Config(com.pulumi.deployment.internal.DeploymentImpl.Config internalConfig, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
get(java.lang.String key)
Loads an optional configuration value by its key, or returns empty if it doesn't exist.java.util.Optional<java.lang.Boolean>
getBoolean(java.lang.String key)
Loads an optional configuration value, as a boolean, by its key, or null if it doesn't exist.java.util.Optional<java.lang.Double>
getDouble(java.lang.String key)
Loads an optional configuration value, as a number, by its key, or null if it doesn't exist.java.util.Optional<java.lang.Integer>
getInteger(java.lang.String key)
Loads an optional configuration value, as a number, by its key, or null if it doesn't exist.java.lang.String
getName()
The configuration bag's logical name and uniquely identifies it.<T> java.util.Optional<T>
getObject(java.lang.String key, TypeShape<T> shapeOfT)
<T> java.util.Optional<T>
getObject(java.lang.String key, java.lang.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.Output<java.util.Optional<java.lang.String>>
getSecret(java.lang.String key)
Loads an optional configuration value by its key, marking it as a secret, or empty if it doesn't exist.Output<java.util.Optional<java.lang.Boolean>>
getSecretBoolean(java.lang.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.Output<java.util.Optional<java.lang.Integer>>
getSecretInteger(java.lang.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.<T> Output<java.util.Optional<T>>
getSecretObject(java.lang.String key, TypeShape<T> shapeOfT)
<T> Output<java.util.Optional<T>>
getSecretObject(java.lang.String key, java.lang.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.static Config
of(java.lang.String name)
Deprecated.will be removed in the future, useConfigContext.config(String)
java.lang.String
require(java.lang.String key)
Loads a configuration value by its given key.boolean
requireBoolean(java.lang.String key)
Loads a configuration value, as a boolean, by its given key.int
requireInteger(java.lang.String key)
Loads a configuration value, as a number, by its given key.<T> T
requireObject(java.lang.String key, java.lang.Class<T> classOfT)
Loads a configuration value as a JSON string and deserializes it into an object.Output<java.lang.String>
requireSecret(java.lang.String key)
Loads a configuration value by its given key, marking it as a secret.Output<java.lang.Boolean>
requireSecretBoolean(java.lang.String key)
Loads a configuration value, as a boolean, by its given key, marking it as a secret.Output<java.lang.Integer>
requireSecretInteger(java.lang.String key)
Loads a configuration value, as a number, by its given key, marking it as a secret.<T> Output<T>
requireSecretObject(java.lang.String key, java.lang.Class<T> classOfT)
Loads a configuration value as a JSON string and deserializes it into an object, marking it as a secret.
-
-
-
Method Detail
-
of
@InternalUse @Deprecated public static Config of(java.lang.String name)
Deprecated.will be removed in the future, useConfigContext.config(String)
For internal use by providers.
-
getName
@Nonnull public java.lang.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 java.util.Optional<java.lang.String> get(java.lang.String key)
Loads an optional configuration value by its key, or returns empty if it doesn't exist.
-
getSecret
public Output<java.util.Optional<java.lang.String>> getSecret(java.lang.String key)
Loads an optional configuration value by its key, marking it as a secret, or empty if it doesn't exist.
-
getBoolean
public java.util.Optional<java.lang.Boolean> getBoolean(java.lang.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<java.util.Optional<java.lang.Boolean>> getSecretBoolean(java.lang.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 java.util.Optional<java.lang.Integer> getInteger(java.lang.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 java.util.Optional<java.lang.Double> getDouble(java.lang.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<java.util.Optional<java.lang.Integer>> getSecretInteger(java.lang.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> java.util.Optional<T> getObject(java.lang.String key, java.lang.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 withkey
and passing it toGson.fromJson(Reader, Class)
.
-
getSecretObject
public <T> Output<java.util.Optional<T>> getSecretObject(java.lang.String key, java.lang.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 withkey
and passing it toGson.fromJson(Reader, Class)
.
-
getObject
public <T> java.util.Optional<T> getObject(java.lang.String key, TypeShape<T> shapeOfT)
- See Also:
getObject(String, Class)
-
getSecretObject
public <T> Output<java.util.Optional<T>> getSecretObject(java.lang.String key, TypeShape<T> shapeOfT)
- See Also:
getSecretObject(String, Class)
-
require
public java.lang.String require(java.lang.String key)
Loads a configuration value by its given key. If it doesn't exist, an error is thrown.
-
requireSecret
public Output<java.lang.String> requireSecret(java.lang.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(java.lang.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<java.lang.Boolean> requireSecretBoolean(java.lang.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(java.lang.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<java.lang.Integer> requireSecretInteger(java.lang.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(java.lang.String key, java.lang.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 usingGson.fromJson(Reader, Class)
, an error is thrown.
-
requireSecretObject
public <T> Output<T> requireSecretObject(java.lang.String key, java.lang.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 usingGson.fromJson(Reader, Class)
, an error is thrown.
-
-