Show / Hide Table of Contents

Class Alias

Defines a display name for a customer master key (CMK) in AWS Key Management Service (AWS KMS).

Inheritance
System.Object
Construct
Resource
Alias
Implements
IAlias
IKey
IResource
IConstruct
Constructs.IConstruct
IDependable
Inherited Members
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Validate()
Construct.Node
Namespace: Amazon.CDK.AWS.KMS
Assembly: Amazon.CDK.AWS.KMS.dll
Syntax (csharp)
public class Alias : Resource, IAlias, IKey, IResource, IConstruct, IConstruct, IDependable
Syntax (vb)
Public Class Alias
    Inherits Resource
    Implements IAlias, IKey, IResource, IConstruct, IConstruct, IDependable
Remarks

Using an alias to refer to a key can help you simplify key management. For example, when rotating keys, you can just update the alias mapping instead of tracking and changing key IDs. For more information, see Working with Aliases in the AWS Key Management Service Developer Guide.

You can also add an alias for a key by calling key.addAlias(alias).

Resource: AWS::KMS::Alias

Synopsis

Constructors

Alias(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

Alias(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Alias(Construct, String, IAliasProps)

Properties

AliasName

The name of the alias.

AliasTargetKey

The Key to which the Alias refers.

KeyArn

The ARN of the key.

KeyId

The ID of the key (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab).

Methods

AddAlias(String)

Defines a new alias for the key.

AddToResourcePolicy(PolicyStatement, Nullable<Boolean>)

Adds a statement to the KMS key resource policy.

FromAliasAttributes(Construct, String, IAliasAttributes)

Import an existing KMS Alias defined outside the CDK app.

FromAliasName(Construct, String, String)

Import an existing KMS Alias defined outside the CDK app, by the alias name.

GeneratePhysicalName()
Grant(IGrantable, String[])

Grant the indicated permissions on this key to the given principal.

GrantDecrypt(IGrantable)

Grant decryption permissions using this key to the given principal.

GrantEncrypt(IGrantable)

Grant encryption permissions using this key to the given principal.

GrantEncryptDecrypt(IGrantable)

Grant encryption and decryption permissions using this key to the given principal.

Constructors

Alias(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected Alias(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

Alias(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected Alias(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Alias(Construct, String, IAliasProps)

public Alias(Construct scope, string id, IAliasProps props)
Parameters
scope Constructs.Construct
id System.String
props IAliasProps

Properties

AliasName

The name of the alias.

public virtual string AliasName { get; }
Property Value

System.String

AliasTargetKey

The Key to which the Alias refers.

public virtual IKey AliasTargetKey { get; }
Property Value

IKey

KeyArn

The ARN of the key.

public virtual string KeyArn { get; }
Property Value

System.String

KeyId

The ID of the key (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab).

public virtual string KeyId { get; }
Property Value

System.String

Methods

AddAlias(String)

Defines a new alias for the key.

public virtual Alias AddAlias(string alias)
Parameters
alias System.String
Returns

Alias

AddToResourcePolicy(PolicyStatement, Nullable<Boolean>)

Adds a statement to the KMS key resource policy.

public virtual IAddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement, Nullable<bool> allowNoOp = null)
Parameters
statement PolicyStatement
allowNoOp System.Nullable<System.Boolean>
Returns

IAddToResourcePolicyResult

FromAliasAttributes(Construct, String, IAliasAttributes)

Import an existing KMS Alias defined outside the CDK app.

public static IAlias FromAliasAttributes(Construct scope, string id, IAliasAttributes attrs)
Parameters
scope Constructs.Construct

The parent creating construct (usually this).

id System.String

The construct's name.

attrs IAliasAttributes

the properties of the referenced KMS Alias.

Returns

IAlias

FromAliasName(Construct, String, String)

Import an existing KMS Alias defined outside the CDK app, by the alias name.

public static IAlias FromAliasName(Construct scope, string id, string aliasName)
Parameters
scope Constructs.Construct

The parent creating construct (usually this).

id System.String

The construct's name.

aliasName System.String

The full name of the KMS Alias (e.g., 'alias/aws/s3', 'alias/myKeyAlias').

Returns

IAlias

Remarks

This method should be used instead of 'fromAliasAttributes' when the underlying KMS Key ARN is not available. This Alias will not have a direct reference to the KMS Key, so addAlias and grant* methods are not supported.

GeneratePhysicalName()

protected override string GeneratePhysicalName()
Returns

System.String

Overrides
Resource.GeneratePhysicalName()

Grant(IGrantable, String[])

Grant the indicated permissions on this key to the given principal.

public virtual Grant Grant(IGrantable grantee, params string[] actions)
Parameters
grantee IGrantable
actions System.String[]
Returns

Grant

GrantDecrypt(IGrantable)

Grant decryption permissions using this key to the given principal.

public virtual Grant GrantDecrypt(IGrantable grantee)
Parameters
grantee IGrantable
Returns

Grant

GrantEncrypt(IGrantable)

Grant encryption permissions using this key to the given principal.

public virtual Grant GrantEncrypt(IGrantable grantee)
Parameters
grantee IGrantable
Returns

Grant

GrantEncryptDecrypt(IGrantable)

Grant encryption and decryption permissions using this key to the given principal.

public virtual Grant GrantEncryptDecrypt(IGrantable grantee)
Parameters
grantee IGrantable
Returns

Grant

Implements

IAlias
IKey
IResource
IConstruct
Constructs.IConstruct
IDependable
Back to top Generated by DocFX