Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.kms.getAliases
Explore with Pulumi AI
This data source provides a list of KMS aliases in an Alibaba Cloud account according to the specified filters.
NOTE: Available in v1.79.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Declare the data source
const kmsAliases = alicloud.kms.getAliases({
ids: ["d89e8a53-b708-41aa-8c67-6873axxx"],
nameRegex: "alias/tf-testKmsAlias_123",
});
export const firstKeyId = kmsKeysDs.keys[0].id;
import pulumi
import pulumi_alicloud as alicloud
# Declare the data source
kms_aliases = alicloud.kms.get_aliases(ids=["d89e8a53-b708-41aa-8c67-6873axxx"],
name_regex="alias/tf-testKmsAlias_123")
pulumi.export("firstKeyId", kms_keys_ds["keys"][0]["id"])
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Declare the data source
_, err := kms.GetAliases(ctx, &kms.GetAliasesArgs{
Ids: []string{
"d89e8a53-b708-41aa-8c67-6873axxx",
},
NameRegex: pulumi.StringRef("alias/tf-testKmsAlias_123"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstKeyId", kmsKeysDs.Keys[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
// Declare the data source
var kmsAliases = AliCloud.Kms.GetAliases.Invoke(new()
{
Ids = new[]
{
"d89e8a53-b708-41aa-8c67-6873axxx",
},
NameRegex = "alias/tf-testKmsAlias_123",
});
return new Dictionary<string, object?>
{
["firstKeyId"] = kmsKeysDs.Keys[0].Id,
};
});
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.GetAliasesArgs;
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) {
// Declare the data source
final var kmsAliases = KmsFunctions.getAliases(GetAliasesArgs.builder()
.ids("d89e8a53-b708-41aa-8c67-6873axxx")
.nameRegex("alias/tf-testKmsAlias_123")
.build());
ctx.export("firstKeyId", kmsKeysDs.keys()[0].id());
}
}
variables:
# Declare the data source
kmsAliases:
fn::invoke:
Function: alicloud:kms:getAliases
Arguments:
ids:
- d89e8a53-b708-41aa-8c67-6873axxx
nameRegex: alias/tf-testKmsAlias_123
outputs:
firstKeyId: ${kmsKeysDs.keys[0].id}
Using getAliases
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAliases(args: GetAliasesArgs, opts?: InvokeOptions): Promise<GetAliasesResult>
function getAliasesOutput(args: GetAliasesOutputArgs, opts?: InvokeOptions): Output<GetAliasesResult>
def get_aliases(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAliasesResult
def get_aliases_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAliasesResult]
func GetAliases(ctx *Context, args *GetAliasesArgs, opts ...InvokeOption) (*GetAliasesResult, error)
func GetAliasesOutput(ctx *Context, args *GetAliasesOutputArgs, opts ...InvokeOption) GetAliasesResultOutput
> Note: This function is named GetAliases
in the Go SDK.
public static class GetAliases
{
public static Task<GetAliasesResult> InvokeAsync(GetAliasesArgs args, InvokeOptions? opts = null)
public static Output<GetAliasesResult> Invoke(GetAliasesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAliasesResult> getAliases(GetAliasesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:kms/getAliases:getAliases
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of KMS aliases IDs. The value is same as KMS alias_name.
- Name
Regex string - A regex string to filter the results by the KMS alias name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Ids []string
- A list of KMS aliases IDs. The value is same as KMS alias_name.
- Name
Regex string - A regex string to filter the results by the KMS alias name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- ids List<String>
- A list of KMS aliases IDs. The value is same as KMS alias_name.
- name
Regex String - A regex string to filter the results by the KMS alias name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- ids string[]
- A list of KMS aliases IDs. The value is same as KMS alias_name.
- name
Regex string - A regex string to filter the results by the KMS alias name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- ids Sequence[str]
- A list of KMS aliases IDs. The value is same as KMS alias_name.
- name_
regex str - A regex string to filter the results by the KMS alias name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- ids List<String>
- A list of KMS aliases IDs. The value is same as KMS alias_name.
- name
Regex String - A regex string to filter the results by the KMS alias name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getAliases Result
The following output properties are available:
- Aliases
List<Pulumi.
Ali Cloud. Kms. Outputs. Get Aliases Alias> - A list of KMS User alias. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of kms aliases IDs. The value is same as KMS alias_name.
- Names List<string>
- A list of KMS alias name.
- Name
Regex string - Output
File string
- Aliases
[]Get
Aliases Alias - A list of KMS User alias. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of kms aliases IDs. The value is same as KMS alias_name.
- Names []string
- A list of KMS alias name.
- Name
Regex string - Output
File string
- aliases
List<Get
Aliases Alias> - A list of KMS User alias. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of kms aliases IDs. The value is same as KMS alias_name.
- names List<String>
- A list of KMS alias name.
- name
Regex String - output
File String
- aliases
Get
Aliases Alias[] - A list of KMS User alias. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of kms aliases IDs. The value is same as KMS alias_name.
- names string[]
- A list of KMS alias name.
- name
Regex string - output
File string
- aliases
Sequence[Get
Aliases Alias] - A list of KMS User alias. Each element contains the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of kms aliases IDs. The value is same as KMS alias_name.
- names Sequence[str]
- A list of KMS alias name.
- name_
regex str - output_
file str
- aliases List<Property Map>
- A list of KMS User alias. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of kms aliases IDs. The value is same as KMS alias_name.
- names List<String>
- A list of KMS alias name.
- name
Regex String - output
File String
Supporting Types
GetAliasesAlias
- alias_
name str - The unique identifier of the alias.
- id str
- ID of the alias. The value is same as KMS alias_name.
- key_
id str - ID of the key.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.