Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.27.0 published on Monday, Aug 8, 2022 by Pulumi

getAliases

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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var kmsAliases = Output.Create(AliCloud.Kms.GetAliases.InvokeAsync(new AliCloud.Kms.GetAliasesArgs
        {
            Ids = 
            {
                "d89e8a53-b708-41aa-8c67-6873axxx",
            },
            NameRegex = "alias/tf-testKmsAlias_123",
        }));
        this.FirstKeyId = data.Alicloud_kms_keys.Kms_keys_ds.Keys[0].Id;
    }

    [Output("firstKeyId")]
    public Output<string> FirstKeyId { get; set; }
}
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 {
		_, 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", data.Alicloud_kms_keys.Kms_keys_ds.Keys[0].Id)
		return nil
	})
}
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) {
        final var kmsAliases = KmsFunctions.getAliases(GetAliasesArgs.builder()
            .ids("d89e8a53-b708-41aa-8c67-6873axxx")
            .nameRegex("alias/tf-testKmsAlias_123")
            .build());

        ctx.export("firstKeyId", data.alicloud_kms_keys().kms_keys_ds().keys()[0].id());
    }
}
import pulumi
import pulumi_alicloud as alicloud

kms_aliases = alicloud.kms.get_aliases(ids=["d89e8a53-b708-41aa-8c67-6873axxx"],
    name_regex="alias/tf-testKmsAlias_123")
pulumi.export("firstKeyId", data["alicloud_kms_keys"]["kms_keys_ds"]["keys"][0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Declare the data source
const kmsAliases = pulumi.output(alicloud.kms.getAliases({
    ids: ["d89e8a53-b708-41aa-8c67-6873axxx"],
    nameRegex: "alias/tf-testKmsAlias_123",
}));

export const firstKeyId = alicloud_kms_keys_kms_keys_ds.keys.0.id;
variables:
  kmsAliases:
    Fn::Invoke:
      Function: alicloud:kms:getAliases
      Arguments:
        ids:
          - d89e8a53-b708-41aa-8c67-6873axxx
        nameRegex: alias/tf-testKmsAlias_123
outputs:
  firstKeyId: ${data.alicloud_kms_keys.kms_keys_ds.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
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
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
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
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
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

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
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.