Class Alias
A new alias to a particular version of a Lambda function.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Alias : QualifiedFunctionBase, IClientVpnConnectionHandler, IAlias, IFunction, IResource, IConnectable, IGrantable
Syntax (vb)
Public Class Alias
Inherits QualifiedFunctionBase
Implements IClientVpnConnectionHandler, IAlias, IFunction, IResource, IConnectable, IGrantable
Remarks
ExampleMetadata: infused
Examples
var lambdaCode = Code.FromCfnParameters();
var func = new Function(this, "Lambda", new FunctionProps {
Code = lambdaCode,
Handler = "index.handler",
Runtime = Runtime.NODEJS_LATEST
});
// used to make sure each CDK synthesis produces a different Version
var version = func.CurrentVersion;
var alias = new Alias(this, "LambdaAlias", new AliasProps {
AliasName = "Prod",
Version = version
});
new LambdaDeploymentGroup(this, "DeploymentGroup", new LambdaDeploymentGroupProps {
Alias = alias,
DeploymentConfig = LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE
});
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 | Name of this alias. |
Architecture | The architecture of this Lambda Function. |
CanCreatePermissions | Whether the addPermission() call adds any permissions. |
FunctionArn | ARN of this alias. |
FunctionName | ARN of this alias. |
GrantPrincipal | The principal this Lambda Function is running as. |
Lambda | The underlying |
Qualifier | The qualifier of the version or alias of this function. |
Role | The IAM role associated with this function. |
Version | The underlying Lambda function version. |
Methods
AddAutoScaling(IAutoScalingOptions) | Configure provisioned concurrency autoscaling on a function alias. |
FromAliasAttributes(Construct, String, IAliasAttributes) | |
Metric(String, IMetricOptions) | Return the given named metric for this Function. |
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
Name of this alias.
public virtual string AliasName { get; }
Property Value
System.String
Remarks
Attribute: true
Architecture
The architecture of this Lambda Function.
public override Architecture Architecture { get; }
Property Value
Overrides
CanCreatePermissions
Whether the addPermission() call adds any permissions.
protected override bool CanCreatePermissions { get; }
Property Value
System.Boolean
Overrides
Remarks
True for new Lambdas, false for version $LATEST and imported Lambdas from different accounts.
FunctionArn
ARN of this alias.
public override string FunctionArn { get; }
Property Value
System.String
Overrides
Remarks
Used to be able to use Alias in place of a regular Lambda. Lambda accepts ARNs everywhere it accepts function names.
FunctionName
ARN of this alias.
public override string FunctionName { get; }
Property Value
System.String
Overrides
Remarks
Used to be able to use Alias in place of a regular Lambda. Lambda accepts ARNs everywhere it accepts function names.
GrantPrincipal
The principal this Lambda Function is running as.
public override IPrincipal GrantPrincipal { get; }
Property Value
Overrides
Lambda
The underlying IFunction
.
public override IFunction Lambda { get; }
Property Value
Overrides
Qualifier
The qualifier of the version or alias of this function.
protected override string Qualifier { get; }
Property Value
System.String
Overrides
Remarks
A qualifier is the identifier that's appended to a version or alias ARN.
Role
The IAM role associated with this function.
public override IRole Role { get; }
Property Value
Overrides
Remarks
Undefined if the function was imported without a role.
Version
The underlying Lambda function version.
public virtual IVersion Version { get; }
Property Value
Methods
AddAutoScaling(IAutoScalingOptions)
Configure provisioned concurrency autoscaling on a function alias.
public virtual IScalableFunctionAttribute AddAutoScaling(IAutoScalingOptions options)
Parameters
- options IAutoScalingOptions
Autoscaling options.
Returns
Remarks
Returns a scalable attribute that can call
scaleOnUtilization()
and scaleOnSchedule()
.
FromAliasAttributes(Construct, String, IAliasAttributes)
public static IAlias FromAliasAttributes(Construct scope, string id, IAliasAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IAliasAttributes
Returns
Metric(String, IMetricOptions)
Return the given named metric for this Function.
public override Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.String
- props IMetricOptions
Returns