Class InputMap<V>
Show / Hide Table of Contents

Class InputMap<V>

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<V> differs from a normal IDictionary<TKey, TValue> in that it is itself an Input<T>. For example, a Resource that accepts an InputMap<V> 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<V> 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<V> 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
object
Input<ImmutableDictionary<string, V>>
InputMap<V>
Implements
IEnumerable
IAsyncEnumerable<Input<KeyValuePair<string, V>>>
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 InputMap<V> : Input<ImmutableDictionary<string, V>>, IEnumerable, IAsyncEnumerable<Input<KeyValuePair<string, V>>>
Type Parameters
Name Description
V

Constructors

View Source

InputMap()

Declaration
public InputMap()

Properties

View Source

this[string]

Declaration
public Input<V> this[string key] { set; }
Parameters
Type Name Description
string key
Property Value
Type Description
Input<V>

Methods

View Source

Add(InputMap<V>)

Note: this is non-standard convenience for use with collection initializers.

Declaration
public void Add(InputMap<V> values)
Parameters
Type Name Description
InputMap<V> values
View Source

Add(string, Input<V>)

Declaration
public void Add(string key, Input<V> value)
Parameters
Type Name Description
string key
Input<V> value
View Source

AddRange(InputMap<V>)

Declaration
public void AddRange(InputMap<V> values)
Parameters
Type Name Description
InputMap<V> values
View Source

GetAsyncEnumerator(CancellationToken)

Declaration
public IAsyncEnumerator<Input<KeyValuePair<string, V>>> GetAsyncEnumerator(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
IAsyncEnumerator<Input<KeyValuePair<string, V>>>
View Source

Merge(InputMap<V>, InputMap<V>)

Merge two instances of InputMap<V>. Returns a new InputMap<V> without modifying any of the arguments.

If both maps contain the same key, the value from the second map takes over.
Declaration
public static InputMap<V> Merge(InputMap<V> first, InputMap<V> second)
Parameters
Type Name Description
InputMap<V> first

The first InputMap<V>. Has lower priority in case of key clash.

InputMap<V> second

The second InputMap<V>. Has higher priority in case of key clash.

Returns
Type Description
InputMap<V>

A new instance of InputMap<V> that contains the items from both input maps.

Operators

View Source

implicit operator InputMap<V>(Output<Dictionary<string, V>>)

Declaration
public static implicit operator InputMap<V>(Output<Dictionary<string, V>> values)
Parameters
Type Name Description
Output<Dictionary<string, V>> values
Returns
Type Description
InputMap<V>
View Source

implicit operator InputMap<V>(Output<IDictionary<string, V>>)

Declaration
public static implicit operator InputMap<V>(Output<IDictionary<string, V>> values)
Parameters
Type Name Description
Output<IDictionary<string, V>> values
Returns
Type Description
InputMap<V>
View Source

implicit operator InputMap<V>(Output<ImmutableDictionary<string, V>>)

Declaration
public static implicit operator InputMap<V>(Output<ImmutableDictionary<string, V>> values)
Parameters
Type Name Description
Output<ImmutableDictionary<string, V>> values
Returns
Type Description
InputMap<V>
View Source

implicit operator InputMap<V>(Dictionary<string, V>)

Declaration
public static implicit operator InputMap<V>(Dictionary<string, V> values)
Parameters
Type Name Description
Dictionary<string, V> values
Returns
Type Description
InputMap<V>
View Source

implicit operator InputMap<V>(ImmutableDictionary<string, V>)

Declaration
public static implicit operator InputMap<V>(ImmutableDictionary<string, V> values)
Parameters
Type Name Description
ImmutableDictionary<string, V> values
Returns
Type Description
InputMap<V>

Implements

IEnumerable
IAsyncEnumerable<T>

Extension Methods

InputExtensions.Apply<T, U>(Input<T>?, Func<T, U>)
InputExtensions.Apply<T, U>(Input<T>?, Func<T, Input<U>?>)
InputExtensions.Apply<T, U>(Input<T>?, Func<T, Output<U>?>)
InputExtensions.Apply<T, U>(Input<T>?, Func<T, Task<U>>)
InputExtensions.ToOutput<T>(Input<T>?)
  • View Source
Back to top Copyright 2016-2023, Pulumi Corporation.