Class InputMap<TValue>
A mapping of strings to values that can be passed in as the arguments to a
Resource. The individual values are themselves Input<T>s. i.e.
the individual values can be concrete values or Output<T>s.
InputMap<TValue> differs from a normal
IDictionary<TKey, TValue> in that it is
itself an
Input<T>. For example, a
Resource that accepts an
InputMap<TValue> will accept not just a dictionary but an
Output<T>
of a dictionary as well. This is important for cases where the
Output<T>
map from some
Resource needs to be passed into another
Resource.
Or for cases where creating the map invariably produces an
Output<T> because
its resultant value is dependent on other
Output<T>s.
This benefit of InputMap<TValue> is also a limitation. Because it represents a
list of values that may eventually be created, there is no way to simply iterate over, or
access the elements of the map synchronously.
InputMap<TValue> is designed to be easily used in object and collection
initializers. For example, a resource that accepts a map of values can be written easily in
this form:
new SomeResource("name", new SomeResourceArgs {
MapProperty = {
{ Key1, Value1 },
{ Key2, Value2 },
{ Key3, Value3 },
},
});
Inheritance
InputMap<TValue>
Assembly: Pulumi.dll
public sealed class InputMap<TValue> : Input<ImmutableDictionary<string, TValue>>, IEnumerable, IAsyncEnumerable<Input<KeyValuePair<string, TValue>>>
Type Parameters
Constructors
View Source
Declaration
Properties
View Source
Declaration
public Input<TValue> this[string key] { set; }
Parameters
| Type |
Name |
Description |
| string |
key |
|
Property Value
| Type |
Description |
| Input<TValue> |
|
Methods
View Source
Note: this is non-standard convenience for use with collection initializers.
Declaration
public void Add(InputMap<TValue> values)
Parameters
| Type |
Name |
Description |
| InputMap<TValue> |
values |
|
View Source
Declaration
public void Add(string key, Input<TValue> value)
Parameters
View Source
Declaration
public void AddRange(InputMap<TValue> values)
Parameters
| Type |
Name |
Description |
| InputMap<TValue> |
values |
|
View Source
Returns an enumerator that iterates asynchronously through the collection.
Declaration
public IAsyncEnumerator<Input<KeyValuePair<string, TValue>>> GetAsyncEnumerator(CancellationToken cancellationToken)
Parameters
Returns
View Source
Merge two instances of <xref href="Pulumi.InputMap%601" data-throw-if-not-resolved="false"></xref>. Returns a new <xref href="Pulumi.InputMap%601" data-throw-if-not-resolved="false"></xref>
without modifying any of the arguments.
<p></p>
If both maps contain the same key, the value from the second map takes over.
Declaration
public static InputMap<TValue> Merge(InputMap<TValue> first, InputMap<TValue> second)
Parameters
Returns
Operators
View Source
Declaration
public static implicit operator InputMap<TValue>(Output<Dictionary<string, TValue>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputMap<TValue>(Output<IDictionary<string, TValue>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputMap<TValue>(Output<ImmutableDictionary<string, TValue>> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputMap<TValue>(Dictionary<string, TValue> values)
Parameters
Returns
View Source
Declaration
public static implicit operator InputMap<TValue>(ImmutableDictionary<string, TValue> values)
Parameters
Returns
Implements
Extension Methods