getKeyPairs

DEPRECATED: This datasource has been renamed to alicloud.ecs.getEcsKeyPairs from version 1.121.0. This data source provides a list of key pairs in an Alibaba Cloud account according to the specified filters.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.KeyPair;
import com.pulumi.alicloud.ecs.KeyPairArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.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) {
var defaultKeyPair = new KeyPair("defaultKeyPair", KeyPairArgs.builder()
.keyName("keyPairDatasource")
.build());
final var defaultKeyPairs = EcsFunctions.getKeyPairs(GetKeyPairsArgs.builder()
.nameRegex(defaultKeyPair.keyName())
.build());
}
}

Return

A collection of values returned by getKeyPairs.

Parameters

argument

A collection of arguments for invoking getKeyPairs.


suspend fun getKeyPairs(fingerPrint: String? = null, ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, resourceGroupId: String? = null, tags: Map<String, Any>? = null): GetKeyPairsResult

Return

A collection of values returned by getKeyPairs.

See also

Parameters

fingerPrint

A finger print used to retrieve specified key pair.

ids

A list of key pair IDs.

nameRegex

A regex string to apply to the resulting key pairs.

outputFile

File name where to save data source results (after running pulumi preview).

resourceGroupId

The Id of resource group which the key pair belongs.

tags

A mapping of tags to assign to the resource.


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.ecs.kotlin.inputs.GetKeyPairsPlainArgs.