get Secrets
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
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.kms.KmsFunctions;
import com.pulumi.alicloud.kms.inputs.GetSecretsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var kmsSecretsDs = KmsFunctions.getSecrets(GetSecretsArgs.builder()
.fetchTags(true)
.nameRegex("name_regex")
.tags(Map.ofEntries(
Map.entry("k-aa", "v-aa"),
Map.entry("k-bb", "v-bb")
))
.build());
ctx.export("firstSecretId", kmsSecretsDs.applyValue(getSecretsResult -> getSecretsResult.secrets()[0].id()));
}
}Return
A collection of values returned by getSecrets.
Parameters
A collection of arguments for invoking getSecrets.
Return
A collection of values returned by getSecrets.
See also
Parameters
Default to false. Set it to true can output more details.
Whether to include the predetermined resource tag in the return value. Default to false.
The secret filter. The filter consists of one or more key-value pairs. More details see API ListSecrets.
A list of KMS Secret ids. The value is same as KMS secret_name.
A regex string to filter the results by the KMS secret_name.
A mapping of tags to assign to the resource.
Return
A collection of values returned by getSecrets.
See also
Parameters
Builder for com.pulumi.alicloud.kms.kotlin.inputs.GetSecretsPlainArgs.