Class Alias
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.lambda.FunctionBase
software.amazon.awscdk.services.lambda.QualifiedFunctionBase
software.amazon.awscdk.services.lambda.Alias
- All Implemented Interfaces:
- IResource,- IClientVpnConnectionHandler,- IConnectable,- IGrantable,- IAlias,- IAliasRef,- IFunction,- IFunctionRef,- software.amazon.jsii.JsiiSerializable,- software.constructs.IConstruct,- software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
           date="2025-10-29T11:15:42.508Z")
@Stability(Stable)
public class Alias
extends QualifiedFunctionBase
implements IAlias
A new alias to a particular version of a Lambda function.
 
Example:
 CfnParametersCode lambdaCode = Code.fromCfnParameters();
 Function func = Function.Builder.create(this, "Lambda")
         .code(lambdaCode)
         .handler("index.handler")
         .runtime(Runtime.NODEJS_LATEST)
         .build();
 // used to make sure each CDK synthesis produces a different Version
 Version version = func.getCurrentVersion();
 Alias alias = Alias.Builder.create(this, "LambdaAlias")
         .aliasName("Prod")
         .version(version)
         .build();
 LambdaDeploymentGroup.Builder.create(this, "DeploymentGroup")
         .alias(alias)
         .deploymentConfig(LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE)
         .build();
 - 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IAliasIAlias.Jsii$Default, IAlias.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IClientVpnConnectionHandlerIClientVpnConnectionHandler.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstructsoftware.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IFunctionIFunction.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResourceIResource.Jsii$Default
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAlias(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedAlias(software.amazon.jsii.JsiiObjectRef objRef) Alias(software.constructs.Construct scope, String id, AliasProps props) 
- 
Method SummaryModifier and TypeMethodDescriptionaddAutoScaling(AutoScalingOptions options) Configure provisioned concurrency autoscaling on a function alias.static IAliasfromAliasAttributes(software.constructs.Construct scope, String id, AliasAttributes attrs) Name of this alias.A reference to a Alias resource.The architecture of this Lambda Function.protected BooleanWhether the addPermission() call adds any permissions.ARN of this alias.ARN of this alias.The principal this Lambda Function is running as.The underlyingIFunction.protected StringThe qualifier of the version or alias of this function.getRole()The IAM role associated with this function.The underlying Lambda function version.Return the given named metric for this Function.metric(String metricName, MetricOptions props) Return the given named metric for this Function.Methods inherited from class software.amazon.awscdk.services.lambda.QualifiedFunctionBaseconfigureAsyncInvoke, considerWarningOnInvokeFunctionPermissions, getLatestVersion, getPermissionsNode, getResourceArnsForGrantInvokeMethods inherited from class software.amazon.awscdk.services.lambda.FunctionBaseaddEventSource, addEventSourceMapping, addFunctionUrl, addFunctionUrl, addPermission, addToRolePolicy, getConnections, getFunctionRef, getIsBoundToVpc, grantInvoke, grantInvokeCompositePrincipal, grantInvokeLatestVersion, grantInvokeUrl, grantInvokeVersion, metricDuration, metricDuration, metricErrors, metricErrors, metricInvocations, metricInvocations, metricThrottles, metricThrottles, warnInvokeFunctionPermissionsMethods inherited from class software.amazon.awscdk.ResourceapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.ConstructgetNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.services.ec2.IConnectablegetConnectionsMethods inherited from interface software.amazon.awscdk.services.lambda.IFunctionaddEventSource, addEventSourceMapping, addFunctionUrl, addFunctionUrl, addPermission, addToRolePolicy, configureAsyncInvoke, getIsBoundToVpc, getLatestVersion, getPermissionsNode, getResourceArnsForGrantInvoke, grantInvoke, grantInvokeCompositePrincipal, grantInvokeLatestVersion, grantInvokeUrl, grantInvokeVersion, metricDuration, metricDuration, metricErrors, metricErrors, metricInvocations, metricInvocations, metricThrottles, metricThrottlesMethods inherited from interface software.amazon.awscdk.services.lambda.IFunctionRefgetFunctionRefMethods inherited from interface software.amazon.awscdk.IResourceapplyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Field Details- 
PROPERTY_INJECTION_IDUniquely identifies this class.
 
- 
- 
Constructor Details- 
Aliasprotected Alias(software.amazon.jsii.JsiiObjectRef objRef) 
- 
Aliasprotected Alias(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) 
- 
Alias@Stability(Stable) public Alias(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AliasProps props) - Parameters:
- scope- This parameter is required.
- id- This parameter is required.
- props- This parameter is required.
 
 
- 
- 
Method Details- 
fromAliasAttributes@Stability(Stable) @NotNull public static IAlias fromAliasAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AliasAttributes attrs) - Parameters:
- scope- This parameter is required.
- id- This parameter is required.
- attrs- This parameter is required.
 
- 
addAutoScaling@Stability(Stable) @NotNull public IScalableFunctionAttribute addAutoScaling(@NotNull AutoScalingOptions options) Configure provisioned concurrency autoscaling on a function alias.Returns a scalable attribute that can call scaleOnUtilization()andscaleOnSchedule().- Parameters:
- options- Autoscaling options. This parameter is required.
 
- 
metric@Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) Return the given named metric for this Function.- Specified by:
- metricin interface- IFunction
- Overrides:
- metricin class- FunctionBase
- Parameters:
- metricName- This parameter is required.
- props-
 
- 
metricReturn the given named metric for this Function.- Specified by:
- metricin interface- IFunction
- Overrides:
- metricin class- FunctionBase
- Parameters:
- metricName- This parameter is required.
 
- 
getAliasNameName of this alias.- Specified by:
- getAliasNamein interface- IAlias
 
- 
getAliasRefA reference to a Alias resource.- Specified by:
- getAliasRefin interface- IAliasRef
 
- 
getArchitectureThe architecture of this Lambda Function.- Specified by:
- getArchitecturein interface- IFunction
- Specified by:
- getArchitecturein class- FunctionBase
 
- 
getCanCreatePermissionsWhether the addPermission() call adds any permissions.True for new Lambdas, false for version $LATEST and imported Lambdas from different accounts. - Specified by:
- getCanCreatePermissionsin class- FunctionBase
 
- 
getFunctionArnARN of this alias.Used to be able to use Alias in place of a regular Lambda. Lambda accepts ARNs everywhere it accepts function names. - Specified by:
- getFunctionArnin interface- IClientVpnConnectionHandler
- Specified by:
- getFunctionArnin interface- IFunction
- Specified by:
- getFunctionArnin class- FunctionBase
 
- 
getFunctionNameARN of this alias.Used to be able to use Alias in place of a regular Lambda. Lambda accepts ARNs everywhere it accepts function names. - Specified by:
- getFunctionNamein interface- IClientVpnConnectionHandler
- Specified by:
- getFunctionNamein interface- IFunction
- Specified by:
- getFunctionNamein class- FunctionBase
 
- 
getGrantPrincipalThe principal this Lambda Function is running as.- Specified by:
- getGrantPrincipalin interface- IGrantable
- Specified by:
- getGrantPrincipalin class- FunctionBase
 
- 
getLambdaThe underlyingIFunction.- Specified by:
- getLambdain class- QualifiedFunctionBase
 
- 
getQualifierThe qualifier of the version or alias of this function.A qualifier is the identifier that's appended to a version or alias ARN. - Specified by:
- getQualifierin class- QualifiedFunctionBase
- See Also:
 
- 
getVersionThe underlying Lambda function version.- Specified by:
- getVersionin interface- IAlias
 
- 
getRoleThe IAM role associated with this function.Undefined if the function was imported without a role. - Specified by:
- getRolein interface- IFunction
- Specified by:
- getRolein class- FunctionBase
 
 
-