get Key Pairs
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
A collection of arguments for invoking getKeyPairs.
Return
A collection of values returned by getKeyPairs.
See also
Parameters
A finger print used to retrieve specified key pair.
A list of key pair IDs.
A regex string to apply to the resulting key pairs.
File name where to save data source results (after running pulumi preview
).
The Id of resource group which the key pair belongs.
A mapping of tags to assign to the resource.
Return
A collection of values returned by getKeyPairs.
See also
Parameters
Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetKeyPairsPlainArgs.