Show / Hide Table of Contents

Class InputMap<V>

A mapping of System.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 System.Collections.Generic.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
System.Object
Input<System.Collections.Immutable.ImmutableDictionary<System.String, V>>
InputMap<V>
Implements
System.Collections.IEnumerable
System.Collections.Generic.IAsyncEnumerable<Input<System.Collections.Generic.KeyValuePair<System.String, V>>>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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

Item[String]

Declaration
public Input<V> this[string key] { set; }
Parameters
Type Name Description
System.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
System.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 async IAsyncEnumerator<Input<KeyValuePair<string, V>>> GetAsyncEnumerator(CancellationToken cancellationToken)
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Collections.Generic.IAsyncEnumerator<Input<System.Collections.Generic.KeyValuePair<System.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(Output<Dictionary<String, V>> to InputMap<V>)

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

Implicit(Output<IDictionary<String, V>> to InputMap<V>)

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

Implicit(Output<ImmutableDictionary<String, V>> to InputMap<V>)

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

Implicit(Dictionary<String, V> to InputMap<V>)

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

Implicit(ImmutableDictionary<String, V> to InputMap<V>)

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

Explicit Interface Implementations

View Source

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

System.Collections.IEnumerable
System.Collections.Generic.IAsyncEnumerable<T>

Extension Methods

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