GetKeys
This data source provides a list of KMS keys in an Alibaba Cloud account according to the specified filters.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var kmsKeysDs = Output.Create(AliCloud.Kms.GetKeys.InvokeAsync(new AliCloud.Kms.GetKeysArgs
{
DescriptionRegex = "Hello KMS",
OutputFile = "kms_keys.json",
}));
this.FirstKeyId = kmsKeysDs.Apply(kmsKeysDs => kmsKeysDs.Keys[0].Id);
}
[Output("firstKeyId")]
public Output<string> FirstKeyId { get; set; }
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
kms_keys_ds = alicloud.kms.get_keys(description_regex="Hello KMS",
output_file="kms_keys.json")
pulumi.export("firstKeyId", kms_keys_ds.keys[0]["id"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Declare the data source
const kmsKeysDs = pulumi.output(alicloud.kms.getKeys({
descriptionRegex: "Hello KMS",
outputFile: "kms_keys.json",
}, { async: true }));
export const firstKeyId = kmsKeysDs.keys[0].id;Using GetKeys
function getKeys(args: GetKeysArgs, opts?: InvokeOptions): Promise<GetKeysResult>function get_keys(description_regex=None, ids=None, output_file=None, status=None, opts=None)func GetKeys(ctx *Context, args *GetKeysArgs, opts ...InvokeOption) (*GetKeysResult, error)public static class GetKeys {
public static Task<GetKeysResult> InvokeAsync(GetKeysArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Description
Regex string A regex string to filter the results by the KMS key description.
- Ids List<string>
A list of KMS key IDs.
- Output
File string - Status string
Filter the results by status of the KMS keys. Valid values:
Enabled,Disabled,PendingDeletion.
- Description
Regex string A regex string to filter the results by the KMS key description.
- Ids []string
A list of KMS key IDs.
- Output
File string - Status string
Filter the results by status of the KMS keys. Valid values:
Enabled,Disabled,PendingDeletion.
- description
Regex string A regex string to filter the results by the KMS key description.
- ids string[]
A list of KMS key IDs.
- output
File string - status string
Filter the results by status of the KMS keys. Valid values:
Enabled,Disabled,PendingDeletion.
- description_
regex str A regex string to filter the results by the KMS key description.
- ids List[str]
A list of KMS key IDs.
- output_
file str - status str
Filter the results by status of the KMS keys. Valid values:
Enabled,Disabled,PendingDeletion.
GetKeys Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of KMS key IDs.
- Keys
List<Pulumi.
Ali Cloud. Kms. Outputs. Get Keys Key> A list of KMS keys. Each element contains the following attributes:
- Description
Regex string - Output
File string - Status string
Status of the key. Possible values:
Enabled,DisabledandPendingDeletion.
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of KMS key IDs.
- Keys
[]Get
Keys Key A list of KMS keys. Each element contains the following attributes:
- Description
Regex string - Output
File string - Status string
Status of the key. Possible values:
Enabled,DisabledandPendingDeletion.
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of KMS key IDs.
- keys
Get
Keys Key[] A list of KMS keys. Each element contains the following attributes:
- description
Regex string - output
File string - status string
Status of the key. Possible values:
Enabled,DisabledandPendingDeletion.
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
A list of KMS key IDs.
- keys
List[Get
Keys Key] A list of KMS keys. Each element contains the following attributes:
- description_
regex str - output_
file str - status str
Status of the key. Possible values:
Enabled,DisabledandPendingDeletion.
Supporting Types
GetKeysKey
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Arn string
The Alibaba Cloud Resource Name (ARN) of the key.
- Creation
Date string Creation date of key.
- Creator string
The owner of the key.
- Delete
Date string Deletion date of key.
- Description string
Description of the key.
- Id string
ID of the key.
- Status string
Filter the results by status of the KMS keys. Valid values:
Enabled,Disabled,PendingDeletion.
- Arn string
The Alibaba Cloud Resource Name (ARN) of the key.
- Creation
Date string Creation date of key.
- Creator string
The owner of the key.
- Delete
Date string Deletion date of key.
- Description string
Description of the key.
- Id string
ID of the key.
- Status string
Filter the results by status of the KMS keys. Valid values:
Enabled,Disabled,PendingDeletion.
- arn string
The Alibaba Cloud Resource Name (ARN) of the key.
- creation
Date string Creation date of key.
- creator string
The owner of the key.
- delete
Date string Deletion date of key.
- description string
Description of the key.
- id string
ID of the key.
- status string
Filter the results by status of the KMS keys. Valid values:
Enabled,Disabled,PendingDeletion.
- arn str
The Alibaba Cloud Resource Name (ARN) of the key.
- creation_
date str Creation date of key.
- creator str
The owner of the key.
- delete_
date str Deletion date of key.
- description str
Description of the key.
- id str
ID of the key.
- status str
Filter the results by status of the KMS keys. Valid values:
Enabled,Disabled,PendingDeletion.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.