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:

DescriptionRegex string

A regex string to filter the results by the KMS key description.

Ids List<string>

A list of KMS key IDs.

OutputFile string
Status string

Filter the results by status of the KMS keys. Valid values: Enabled, Disabled, PendingDeletion.

DescriptionRegex string

A regex string to filter the results by the KMS key description.

Ids []string

A list of KMS key IDs.

OutputFile string
Status string

Filter the results by status of the KMS keys. Valid values: Enabled, Disabled, PendingDeletion.

descriptionRegex string

A regex string to filter the results by the KMS key description.

ids string[]

A list of KMS key IDs.

outputFile 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.AliCloud.Kms.Outputs.GetKeysKey>

A list of KMS keys. Each element contains the following attributes:

DescriptionRegex string
OutputFile string
Status string

Status of the key. Possible values: Enabled, Disabled and PendingDeletion.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of KMS key IDs.

Keys []GetKeysKey

A list of KMS keys. Each element contains the following attributes:

DescriptionRegex string
OutputFile string
Status string

Status of the key. Possible values: Enabled, Disabled and PendingDeletion.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of KMS key IDs.

keys GetKeysKey[]

A list of KMS keys. Each element contains the following attributes:

descriptionRegex string
outputFile string
status string

Status of the key. Possible values: Enabled, Disabled and PendingDeletion.

id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of KMS key IDs.

keys List[GetKeysKey]

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, Disabled and PendingDeletion.

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.

CreationDate string

Creation date of key.

Creator string

The owner of the key.

DeleteDate 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.

CreationDate string

Creation date of key.

Creator string

The owner of the key.

DeleteDate 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.

creationDate string

Creation date of key.

creator string

The owner of the key.

deleteDate 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 alicloud Terraform Provider.