Show / Hide Table of Contents

Class Config

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.

Inheritance
object
Config
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Pulumi
Assembly: Pulumi.dll
Syntax
public sealed class Config

Constructors

View Source

Config(string?)

Creates a new Config instance. name is the configuration bag's logical name and uniquely identifies it. The default is the name of the current project.

Declaration
public Config(string? name = null)
Parameters
Type Name Description
string name

Methods

View Source

Get(string)

Loads an optional configuration value by its key, or null if it doesn't exist.

Declaration
public string? Get(string key)
Parameters
Type Name Description
string key
Returns
Type Description
string
View Source

GetBoolean(string)

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.

Declaration
public bool? GetBoolean(string key)
Parameters
Type Name Description
string key
Returns
Type Description
bool?
View Source

GetInt32(string)

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.

Declaration
public int? GetInt32(string key)
Parameters
Type Name Description
string key
Returns
Type Description
int?
View Source

GetObject<T>(string)

Loads an optional configuration value, 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 Deserialize<TValue>(string, JsonSerializerOptions).

Declaration
public T GetObject<T>(string key)
Parameters
Type Name Description
string key
Returns
Type Description
T
Type Parameters
Name Description
T
View Source

GetSecret(string)

Loads an optional configuration value by its key, marking it as a secret, or null if it doesn't exist.

Declaration
public Output<string>? GetSecret(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Output<string>
View Source

GetSecretBoolean(string)

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.

Declaration
public Output<bool>? GetSecretBoolean(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Output<bool>
View Source

GetSecretInt32(string)

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.

Declaration
public Output<int>? GetSecretInt32(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Output<int>
View Source

GetSecretObject<T>(string)

Loads an optional configuration value, as an object, by its key, marking it as a secret or null if it doesn't exist. This works by taking the value associated with key and passing it to Deserialize<TValue>(string, JsonSerializerOptions).

Declaration
public Output<T>? GetSecretObject<T>(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Output<T>
Type Parameters
Name Description
T
View Source

Require(string)

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

Declaration
public string Require(string key)
Parameters
Type Name Description
string key
Returns
Type Description
string
View Source

RequireBoolean(string)

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.

Declaration
public bool RequireBoolean(string key)
Parameters
Type Name Description
string key
Returns
Type Description
bool
View Source

RequireInt32(string)

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.

Declaration
public int RequireInt32(string key)
Parameters
Type Name Description
string key
Returns
Type Description
int
View Source

RequireObject<T>(string)

Loads a configuration value as a JSON string and deserializes the JSON into an object. object. If it doesn't exist, or the configuration value cannot be converted using Deserialize<TValue>(string, JsonSerializerOptions), an error is thrown.

Declaration
public T RequireObject<T>(string key)
Parameters
Type Name Description
string key
Returns
Type Description
T
Type Parameters
Name Description
T
View Source

RequireSecret(string)

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

Declaration
public Output<string> RequireSecret(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Output<string>
View Source

RequireSecretBoolean(string)

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.

Declaration
public Output<bool> RequireSecretBoolean(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Output<bool>
View Source

RequireSecretInt32(string)

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.

Declaration
public Output<int> RequireSecretInt32(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Output<int>
View Source

RequireSecretObject<T>(string)

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 cannot be converted using Deserialize<TValue>(string, JsonSerializerOptions), an error is thrown.

Declaration
public Output<T> RequireSecretObject<T>(string key)
Parameters
Type Name Description
string key
Returns
Type Description
Output<T>
Type Parameters
Name Description
T
  • View Source
Back to top Copyright 2016-2023, Pulumi Corporation.