GetAlias

Use this data source to get the ARN of a KMS key alias. By using this data source, you can reference key alias without having to hard code the ARN as input.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var s3 = Output.Create(Aws.Kms.GetAlias.InvokeAsync(new Aws.Kms.GetAliasArgs
        {
            Name = "alias/aws/s3",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/kms"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := kms.LookupAlias(ctx, &kms.LookupAliasArgs{
            Name: "alias/aws/s3",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

s3 = aws.kms.get_alias(name="alias/aws/s3")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const s3 = pulumi.output(aws.kms.getAlias({
    name: "alias/aws/s3",
}, { async: true }));

Using GetAlias

function getAlias(args: GetAliasArgs, opts?: InvokeOptions): Promise<GetAliasResult>
function  get_alias(name=None, opts=None)
func LookupAlias(ctx *Context, args *LookupAliasArgs, opts ...InvokeOption) (*LookupAliasResult, error)

Note: This function is named LookupAlias in the Go SDK.

public static class GetAlias {
    public static Task<GetAliasResult> InvokeAsync(GetAliasArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The display name of the alias. The name must start with the word “alias” followed by a forward slash (alias/)

Name string

The display name of the alias. The name must start with the word “alias” followed by a forward slash (alias/)

name string

The display name of the alias. The name must start with the word “alias” followed by a forward slash (alias/)

name str

The display name of the alias. The name must start with the word “alias” followed by a forward slash (alias/)

GetAlias Result

The following output properties are available:

Arn string

The Amazon Resource Name(ARN) of the key alias.

Id string

The provider-assigned unique ID for this managed resource.

Name string
TargetKeyArn string

ARN pointed to by the alias.

TargetKeyId string

Key identifier pointed to by the alias.

Arn string

The Amazon Resource Name(ARN) of the key alias.

Id string

The provider-assigned unique ID for this managed resource.

Name string
TargetKeyArn string

ARN pointed to by the alias.

TargetKeyId string

Key identifier pointed to by the alias.

arn string

The Amazon Resource Name(ARN) of the key alias.

id string

The provider-assigned unique ID for this managed resource.

name string
targetKeyArn string

ARN pointed to by the alias.

targetKeyId string

Key identifier pointed to by the alias.

arn str

The Amazon Resource Name(ARN) of the key alias.

id str

The provider-assigned unique ID for this managed resource.

name str
target_key_arn str

ARN pointed to by the alias.

target_key_id str

Key identifier pointed to by the alias.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.