Alibaba Cloud
getKeyPairs
This data source provides the Ecp Key Pairs of the current Alibaba Cloud user.
NOTE: Available in v1.130.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var ids = Output.Create(AliCloud.Ecp.GetKeyPairs.InvokeAsync());
this.EcpKeyPairId1 = ids.Apply(ids => ids.Pairs?[0]?.Id);
var nameRegex = Output.Create(AliCloud.Ecp.GetKeyPairs.InvokeAsync(new AliCloud.Ecp.GetKeyPairsArgs
{
NameRegex = "^my-KeyPair",
}));
this.EcpKeyPairId2 = nameRegex.Apply(nameRegex => nameRegex.Pairs?[0]?.Id);
}
[Output("ecpKeyPairId1")]
public Output<string> EcpKeyPairId1 { get; set; }
[Output("ecpKeyPairId2")]
public Output<string> EcpKeyPairId2 { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := ecp.GetKeyPairs(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("ecpKeyPairId1", ids.Pairs[0].Id)
nameRegex, err := ecp.GetKeyPairs(ctx, &ecp.GetKeyPairsArgs{
NameRegex: pulumi.StringRef("^my-KeyPair"),
}, nil)
if err != nil {
return err
}
ctx.Export("ecpKeyPairId2", nameRegex.Pairs[0].Id)
return nil
})
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.ecp.get_key_pairs()
pulumi.export("ecpKeyPairId1", ids.pairs[0].id)
name_regex = alicloud.ecp.get_key_pairs(name_regex="^my-KeyPair")
pulumi.export("ecpKeyPairId2", name_regex.pairs[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.ecp.getKeyPairs({});
export const ecpKeyPairId1 = ids.then(ids => ids.pairs?[0]?.id);
const nameRegex = alicloud.ecp.getKeyPairs({
nameRegex: "^my-KeyPair",
});
export const ecpKeyPairId2 = nameRegex.then(nameRegex => nameRegex.pairs?[0]?.id);
Coming soon!
Using getKeyPairs
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getKeyPairs(args: GetKeyPairsArgs, opts?: InvokeOptions): Promise<GetKeyPairsResult>
function getKeyPairsOutput(args: GetKeyPairsOutputArgs, opts?: InvokeOptions): Output<GetKeyPairsResult>
def get_key_pairs(ids: Optional[Sequence[str]] = None,
key_pair_finger_print: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetKeyPairsResult
def get_key_pairs_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
key_pair_finger_print: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetKeyPairsResult]
func GetKeyPairs(ctx *Context, args *GetKeyPairsArgs, opts ...InvokeOption) (*GetKeyPairsResult, error)
func GetKeyPairsOutput(ctx *Context, args *GetKeyPairsOutputArgs, opts ...InvokeOption) GetKeyPairsResultOutput
> Note: This function is named GetKeyPairs
in the Go SDK.
public static class GetKeyPairs
{
public static Task<GetKeyPairsResult> InvokeAsync(GetKeyPairsArgs args, InvokeOptions? opts = null)
public static Output<GetKeyPairsResult> Invoke(GetKeyPairsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetKeyPairsResult> getKeyPairs(GetKeyPairsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: alicloud:ecp/getKeyPairs:getKeyPairs
Arguments:
# Arguments dictionary
The following arguments are supported:
- Ids List<string>
A list of Key Pair IDs. Its element value is same as Key Pair Name.
- Key
Pair stringFinger Print The Private Key of the Fingerprint.
- Name
Regex string A regex string to filter results by Key Pair name.
- Output
File string
- Ids []string
A list of Key Pair IDs. Its element value is same as Key Pair Name.
- Key
Pair stringFinger Print The Private Key of the Fingerprint.
- Name
Regex string A regex string to filter results by Key Pair name.
- Output
File string
- ids
List
A list of Key Pair IDs. Its element value is same as Key Pair Name.
- key
Pair StringFinger Print The Private Key of the Fingerprint.
- name
Regex String A regex string to filter results by Key Pair name.
- output
File String
- ids string[]
A list of Key Pair IDs. Its element value is same as Key Pair Name.
- key
Pair stringFinger Print The Private Key of the Fingerprint.
- name
Regex string A regex string to filter results by Key Pair name.
- output
File string
- ids Sequence[str]
A list of Key Pair IDs. Its element value is same as Key Pair Name.
- key_
pair_ strfinger_ print The Private Key of the Fingerprint.
- name_
regex str A regex string to filter results by Key Pair name.
- output_
file str
- ids
List
A list of Key Pair IDs. Its element value is same as Key Pair Name.
- key
Pair StringFinger Print The Private Key of the Fingerprint.
- name
Regex String A regex string to filter results by Key Pair name.
- output
File String
getKeyPairs Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Pairs
List<Pulumi.
Ali Cloud. Ecp. Outputs. Get Key Pairs Pair> - Key
Pair stringFinger Print - Name
Regex string - Output
File string
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Pairs
[]Get
Key Pairs Pair - Key
Pair stringFinger Print - Name
Regex string - Output
File string
- id String
The provider-assigned unique ID for this managed resource.
- ids
List
- names
List
- pairs
List
Key Pairs Pair> - key
Pair StringFinger Print - name
Regex String - output
File String
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- pairs
Get
Key Pairs Pair[] - key
Pair stringFinger Print - name
Regex string - output
File string
- id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- pairs
Sequence[Get
Key Pairs Pair] - key_
pair_ strfinger_ print - name_
regex str - output_
file str
- id String
The provider-assigned unique ID for this managed resource.
- ids
List
- names
List
- pairs
List
- key
Pair StringFinger Print - name
Regex String - output
File String
Supporting Types
GetKeyPairsPair
- Id string
The ID of the Key Pair. Its value is same as Queue Name.
- Key
Pair stringFinger Print The Private Key of the Fingerprint.
- Key
Pair stringName The Key Name.
- Id string
The ID of the Key Pair. Its value is same as Queue Name.
- Key
Pair stringFinger Print The Private Key of the Fingerprint.
- Key
Pair stringName The Key Name.
- id String
The ID of the Key Pair. Its value is same as Queue Name.
- key
Pair StringFinger Print The Private Key of the Fingerprint.
- key
Pair StringName The Key Name.
- id string
The ID of the Key Pair. Its value is same as Queue Name.
- key
Pair stringFinger Print The Private Key of the Fingerprint.
- key
Pair stringName The Key Name.
- id str
The ID of the Key Pair. Its value is same as Queue Name.
- key_
pair_ strfinger_ print The Private Key of the Fingerprint.
- key_
pair_ strname The Key Name.
- id String
The ID of the Key Pair. Its value is same as Queue Name.
- key
Pair StringFinger Print The Private Key of the Fingerprint.
- key
Pair StringName The Key Name.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.