1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. kms
  5. getAliases
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.kms.getAliases

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    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.
    NameRegex string
    A regex string to filter the results by the KMS alias name.
    OutputFile 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.
    NameRegex string
    A regex string to filter the results by the KMS alias name.
    OutputFile 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.
    nameRegex String
    A regex string to filter the results by the KMS alias name.
    outputFile 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.
    nameRegex string
    A regex string to filter the results by the KMS alias name.
    outputFile 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.
    nameRegex String
    A regex string to filter the results by the KMS alias name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getAliases Result

    The following output properties are available:

    Aliases List<Pulumi.AliCloud.Kms.Outputs.GetAliasesAlias>
    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.
    NameRegex string
    OutputFile string
    Aliases []GetAliasesAlias
    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.
    NameRegex string
    OutputFile string
    aliases List<GetAliasesAlias>
    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.
    nameRegex String
    outputFile String
    aliases GetAliasesAlias[]
    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.
    nameRegex string
    outputFile string
    aliases Sequence[GetAliasesAlias]
    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.
    nameRegex String
    outputFile String

    Supporting Types

    GetAliasesAlias

    AliasName string
    The unique identifier of the alias.
    Id string
    ID of the alias. The value is same as KMS alias_name.
    KeyId string
    ID of the key.
    AliasName string
    The unique identifier of the alias.
    Id string
    ID of the alias. The value is same as KMS alias_name.
    KeyId string
    ID of the key.
    aliasName String
    The unique identifier of the alias.
    id String
    ID of the alias. The value is same as KMS alias_name.
    keyId String
    ID of the key.
    aliasName string
    The unique identifier of the alias.
    id string
    ID of the alias. The value is same as KMS alias_name.
    keyId string
    ID of the key.
    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.
    aliasName String
    The unique identifier of the alias.
    id String
    ID of the alias. The value is same as KMS alias_name.
    keyId String
    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.
    alicloud logo
    Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi