Skip to content
v2.274.0

FunctionVersionUpgrade Class ​

Aspect for upgrading function versions when the provided feature flag is enabled.

This can be necessary when the feature flag changes the function hash, as such changes must be associated with a new version. This aspect will change the function description in these cases, which "validates" the new function hash.

Example ​

ts
const stack = new Stack();
Aspects.of(stack).add(new lambda.FunctionVersionUpgrade(LAMBDA_RECOGNIZE_VERSION_PROPS));
python
stack = Stack()
Aspects.of(stack).add(lambda_.FunctionVersionUpgrade(LAMBDA_RECOGNIZE_VERSION_PROPS))
java
Stack stack = new Stack();
Aspects.of(stack).add(new FunctionVersionUpgrade(LAMBDA_RECOGNIZE_VERSION_PROPS));
csharp
// Install: dotnet add package Amazon.CDK.Lib
var stack = new Stack();
Aspects.Of(stack).Add(new FunctionVersionUpgrade(LAMBDA_RECOGNIZE_VERSION_PROPS));
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
stack := awscdk.Newstack()
awscdk.Aspects_Of(stack).Add(lambda.NewFunctionVersionUpgrade(awscdklibcxapi.LAMBDA_RECOGNIZE_VERSION_PROPS))

Initializer ​

ts
new FunctionVersionUpgrade(featureFlag: string, enabled?: boolean)
python
FunctionVersionUpgrade(feature_flag: str, enabled: typing.Optional[bool] = None)
java
new FunctionVersionUpgrade(String featureFlag, Boolean enabled)
csharp
new FunctionVersionUpgrade(string featureFlag, bool? enabled = null)
go
NewFunctionVersionUpgrade(FeatureFlag *string, Enabled *bool)

Methods ​

visit(node: IConstruct): voiddef visit(self, node: IConstruct) -> Nonepublic void visit(IConstruct node)public void Visit(IConstruct node)func Visit(Node IConstruct)#
All aspects can visit an IConstruct.