get Key Pairs
This data source provides the Ens Key Pairs of the current Alibaba Cloud user.
NOTE: Available in v1.133.0+.
Example Usage
Basic Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ens.EnsFunctions;
import com.pulumi.alicloud.ens.inputs.GetKeyPairsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var nameRegex = EnsFunctions.getKeyPairs(GetKeyPairsArgs.builder()
.version("example_value")
.nameRegex("^my-KeyPair")
.build());
ctx.export("ensKeyPairId1", nameRegex.applyValue(getKeyPairsResult -> getKeyPairsResult.pairs()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getKeyPairs.
Parameters
argument
A collection of arguments for invoking getKeyPairs.
suspend fun getKeyPairs(keyPairName: String? = null, nameRegex: String? = null, outputFile: String? = null, version: String): GetKeyPairsResult
Return
A collection of values returned by getKeyPairs.
See also
Parameters
key Pair Name
The name of the key pair.
name Regex
A regex string to filter results by Key Pair name.
output File
version
The version number.
suspend fun getKeyPairs(argument: suspend GetKeyPairsPlainArgsBuilder.() -> Unit): GetKeyPairsResult
Return
A collection of values returned by getKeyPairs.
See also
Parameters
argument
Builder for com.pulumi.alicloud.ens.kotlin.inputs.GetKeyPairsPlainArgs.