get Ecs Key Pairs
This data source provides the Ecs Key Pairs of the current Alibaba Cloud user.
NOTE: Available in v1.121.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.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetEcsKeyPairsArgs;
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 example = EcsFunctions.getEcsKeyPairs(GetEcsKeyPairsArgs.builder()
.ids("key_pair_name")
.nameRegex("key_pair_name")
.build());
ctx.export("firstEcsKeyPairId", example.applyValue(getEcsKeyPairsResult -> getEcsKeyPairsResult.pairs()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getEcsKeyPairs.
Parameters
argument
A collection of arguments for invoking getEcsKeyPairs.
suspend fun getEcsKeyPairs(fingerPrint: String? = null, ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, resourceGroupId: String? = null, tags: Map<String, Any>? = null): GetEcsKeyPairsResult
Return
A collection of values returned by getEcsKeyPairs.
See also
Parameters
finger Print
The finger print of the key pair.
ids
A list of Key Pair IDs.
name Regex
A regex string to filter results by Key Pair name.
output File
resource Group Id
The Resource Group Id.
tags
The tags.
suspend fun getEcsKeyPairs(argument: suspend GetEcsKeyPairsPlainArgsBuilder.() -> Unit): GetEcsKeyPairsResult
Return
A collection of values returned by getEcsKeyPairs.
See also
Parameters
argument
Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetEcsKeyPairsPlainArgs.