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
,IFunction
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-21T06:34:10.314Z")
@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 Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IAlias
IAlias.Jsii$Default, IAlias.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IClientVpnConnectionHandler
IClientVpnConnectionHandler.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IFunction
IFunction.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
Alias
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Alias
(software.amazon.jsii.JsiiObjectRef objRef) Alias
(software.constructs.Construct scope, String id, AliasProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddAutoScaling
(AutoScalingOptions options) Configure provisioned concurrency autoscaling on a function alias.static IAlias
fromAliasAttributes
(software.constructs.Construct scope, String id, AliasAttributes attrs) Name of this alias.The architecture of this Lambda Function.protected Boolean
Whether 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 String
The 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.QualifiedFunctionBase
configureAsyncInvoke, considerWarningOnInvokeFunctionPermissions, getLatestVersion, getPermissionsNode, getResourceArnsForGrantInvoke
Methods inherited from class software.amazon.awscdk.services.lambda.FunctionBase
addEventSource, addEventSourceMapping, addFunctionUrl, addFunctionUrl, addPermission, addToRolePolicy, getConnections, getIsBoundToVpc, grantInvoke, grantInvokeCompositePrincipal, grantInvokeLatestVersion, grantInvokeUrl, grantInvokeVersion, metricDuration, metricDuration, metricErrors, metricErrors, metricInvocations, metricInvocations, metricThrottles, metricThrottles, warnInvokeFunctionPermissions
Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.services.ec2.IConnectable
getConnections
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.services.lambda.IFunction
addEventSource, addEventSourceMapping, addFunctionUrl, addFunctionUrl, addPermission, addToRolePolicy, configureAsyncInvoke, getIsBoundToVpc, getLatestVersion, getPermissionsNode, getResourceArnsForGrantInvoke, grantInvoke, grantInvokeCompositePrincipal, grantInvokeLatestVersion, grantInvokeUrl, grantInvokeVersion, metricDuration, metricDuration, metricErrors, metricErrors, metricInvocations, metricInvocations, metricThrottles, metricThrottles
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Alias
protected Alias(software.amazon.jsii.JsiiObjectRef objRef) -
Alias
protected 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:
metric
in interfaceIFunction
- Overrides:
metric
in classFunctionBase
- Parameters:
metricName
- This parameter is required.props
-
-
metric
Return the given named metric for this Function.- Specified by:
metric
in interfaceIFunction
- Overrides:
metric
in classFunctionBase
- Parameters:
metricName
- This parameter is required.
-
getAliasName
Name of this alias.- Specified by:
getAliasName
in interfaceIAlias
-
getArchitecture
The architecture of this Lambda Function.- Specified by:
getArchitecture
in interfaceIFunction
- Specified by:
getArchitecture
in classFunctionBase
-
getCanCreatePermissions
Whether the addPermission() call adds any permissions.True for new Lambdas, false for version $LATEST and imported Lambdas from different accounts.
- Specified by:
getCanCreatePermissions
in classFunctionBase
-
getFunctionArn
ARN 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:
getFunctionArn
in interfaceIClientVpnConnectionHandler
- Specified by:
getFunctionArn
in interfaceIFunction
- Specified by:
getFunctionArn
in classFunctionBase
-
getFunctionName
ARN 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:
getFunctionName
in interfaceIClientVpnConnectionHandler
- Specified by:
getFunctionName
in interfaceIFunction
- Specified by:
getFunctionName
in classFunctionBase
-
getGrantPrincipal
The principal this Lambda Function is running as.- Specified by:
getGrantPrincipal
in interfaceIGrantable
- Specified by:
getGrantPrincipal
in classFunctionBase
-
getLambda
The underlyingIFunction
.- Specified by:
getLambda
in classQualifiedFunctionBase
-
getQualifier
The 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:
getQualifier
in classQualifiedFunctionBase
- See Also:
-
getVersion
The underlying Lambda function version.- Specified by:
getVersion
in interfaceIAlias
-
getRole
The IAM role associated with this function.Undefined if the function was imported without a role.
- Specified by:
getRole
in interfaceIFunction
- Specified by:
getRole
in classFunctionBase
-