GetSecrets

This data source provides a list of KMS Secrets in an Alibaba Cloud account according to the specified filters.

NOTE: Available in v1.86.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var kmsSecretsDs = Output.Create(AliCloud.Kms.GetSecrets.InvokeAsync(new AliCloud.Kms.GetSecretsArgs
        {
            FetchTags = true,
            NameRegex = "name_regex",
            Tags = 
            {
                { "k-aa", "v-aa" },
                { "k-bb", "v-bb" },
            },
        }));
        this.FirstSecretId = kmsSecretsDs.Apply(kmsSecretsDs => kmsSecretsDs.Secrets[0].Id);
    }

    [Output("firstSecretId")]
    public Output<string> FirstSecretId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

kms_secrets_ds = alicloud.kms.get_secrets(fetch_tags=True,
    name_regex="name_regex",
    tags={
        "k-aa": "v-aa",
        "k-bb": "v-bb",
    })
pulumi.export("firstSecretId", kms_secrets_ds.secrets[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Declare the data source
const kmsSecretsDs = pulumi.output(alicloud.kms.getSecrets({
    fetchTags: true,
    nameRegex: "name_regex",
    tags: {
        "k-aa": "v-aa",
        "k-bb": "v-bb",
    },
}, { async: true }));

export const firstSecretId = kmsSecretsDs.secrets[0].id;

Using GetSecrets

function getSecrets(args: GetSecretsArgs, opts?: InvokeOptions): Promise<GetSecretsResult>
function  get_secrets(fetch_tags=None, ids=None, name_regex=None, output_file=None, tags=None, opts=None)
func GetSecrets(ctx *Context, args *GetSecretsArgs, opts ...InvokeOption) (*GetSecretsResult, error)
public static class GetSecrets {
    public static Task<GetSecretsResult> InvokeAsync(GetSecretsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

FetchTags bool

Whether to include the predetermined resource tag in the return value. Default to false.

Ids List<string>

A list of KMS Secret ids. The value is same as KMS secret_name.

NameRegex string

A regex string to filter the results by the KMS secret_name.

OutputFile string
Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

FetchTags bool

Whether to include the predetermined resource tag in the return value. Default to false.

Ids []string

A list of KMS Secret ids. The value is same as KMS secret_name.

NameRegex string

A regex string to filter the results by the KMS secret_name.

OutputFile string
Tags map[string]interface{}

A mapping of tags to assign to the resource.

fetchTags boolean

Whether to include the predetermined resource tag in the return value. Default to false.

ids string[]

A list of KMS Secret ids. The value is same as KMS secret_name.

nameRegex string

A regex string to filter the results by the KMS secret_name.

outputFile string
tags {[key: string]: any}

A mapping of tags to assign to the resource.

fetch_tags bool

Whether to include the predetermined resource tag in the return value. Default to false.

ids List[str]

A list of KMS Secret ids. The value is same as KMS secret_name.

name_regex str

A regex string to filter the results by the KMS secret_name.

output_file str
tags Dict[str, Any]

A mapping of tags to assign to the resource.

GetSecrets 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 Secret ids. The value is same as KMS secret_name.

Names List<string>

A list of KMS Secret names.

Secrets List<Pulumi.AliCloud.Kms.Outputs.GetSecretsSecret>

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

FetchTags bool
NameRegex string
OutputFile string
Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of Kms Secret ids. The value is same as KMS secret_name.

Names []string

A list of KMS Secret names.

Secrets []GetSecretsSecret

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

FetchTags bool
NameRegex string
OutputFile string
Tags map[string]interface{}

A mapping of tags to assign to the resource.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of Kms Secret ids. The value is same as KMS secret_name.

names string[]

A list of KMS Secret names.

secrets GetSecretsSecret[]

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

fetchTags boolean
nameRegex string
outputFile string
tags {[key: string]: any}

A mapping of tags to assign to the resource.

id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of Kms Secret ids. The value is same as KMS secret_name.

names List[str]

A list of KMS Secret names.

secrets List[GetSecretsSecret]

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

fetch_tags bool
name_regex str
output_file str
tags Dict[str, Any]

A mapping of tags to assign to the resource.

Supporting Types

GetSecretsSecret

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Id string

ID of the Kms Secret. The value is same as KMS secret_name.

PlannedDeleteTime string

Schedule deletion time.

SecretName string

Name of the KMS Secret.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

Id string

ID of the Kms Secret. The value is same as KMS secret_name.

PlannedDeleteTime string

Schedule deletion time.

SecretName string

Name of the KMS Secret.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

id string

ID of the Kms Secret. The value is same as KMS secret_name.

plannedDeleteTime string

Schedule deletion time.

secretName string

Name of the KMS Secret.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

id str

ID of the Kms Secret. The value is same as KMS secret_name.

planned_delete_time str

Schedule deletion time.

secret_name str

Name of the KMS Secret.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.