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:
- 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.
- Name
Regex string A regex string to filter the results by the KMS secret_name.
- Output
File string - Dictionary<string, object>
A mapping of tags to assign to the resource.
- 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.
- Name
Regex string A regex string to filter the results by the KMS secret_name.
- Output
File string - map[string]interface{}
A mapping of tags to assign to the resource.
- 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.
- name
Regex string A regex string to filter the results by the KMS secret_name.
- output
File string - {[key: string]: any}
A mapping of tags to assign to the resource.
- 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 - 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.
Ali Cloud. Kms. Outputs. Get Secrets Secret> A list of KMS Secrets. Each element contains the following attributes:
- bool
- Name
Regex string - Output
File string - 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
[]Get
Secrets Secret A list of KMS Secrets. Each element contains the following attributes:
- bool
- Name
Regex string - Output
File string - 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
Get
Secrets Secret[] A list of KMS Secrets. Each element contains the following attributes:
- boolean
- name
Regex string - output
File string - {[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[Get
Secrets Secret] A list of KMS Secrets. Each element contains the following attributes:
- bool
- name_
regex str - output_
file str - 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.
- Planned
Delete stringTime Schedule deletion time.
- Secret
Name string Name of the KMS Secret.
- 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.
- Planned
Delete stringTime Schedule deletion time.
- Secret
Name string Name of the KMS Secret.
- 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.
- planned
Delete stringTime Schedule deletion time.
- secret
Name string Name of the KMS Secret.
- {[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_ strtime Schedule deletion time.
- secret_
name str Name of the KMS Secret.
- 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
alicloudTerraform Provider.