Skip to content

Commit 64b266f

Browse files
docs(lambda): remove references to deprecated addVersion() (#19601)
fixes #19594 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 6a63924 commit 64b266f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

packages/@aws-cdk/aws-applicationautoscaling/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ const handler = new lambda.Function(this, 'MyFunction', {
222222
reservedConcurrentExecutions: 2,
223223
});
224224

225-
const fnVer = handler.addVersion('CDKLambdaVersion', undefined, 'demo alias', 10);
225+
const fnVer = handler.currentVersion;
226226

227227
const target = new appscaling.ScalableTarget(this, 'ScalableTarget', {
228228
serviceNamespace: appscaling.ServiceNamespace.LAMBDA,

packages/@aws-cdk/aws-codedeploy/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ To create a new CodeDeploy Deployment Group that deploys to a Lambda function:
207207
```ts
208208
declare const myApplication: codedeploy.LambdaApplication;
209209
declare const func: lambda.Function;
210-
const version = func.addVersion('1');
210+
const version = func.currentVersion;
211211
const version1Alias = new lambda.Alias(this, 'alias', {
212212
aliasName: 'prod',
213213
version,
@@ -222,7 +222,7 @@ const deploymentGroup = new codedeploy.LambdaDeploymentGroup(this, 'BlueGreenDep
222222

223223
In order to deploy a new version of this function:
224224

225-
1. Increment the version, e.g. `const version = func.addVersion('2')`.
225+
1. Reference the version with the latest changes `const version = func.currentVersion`.
226226
2. Re-deploy the stack (this will trigger a deployment).
227227
3. Monitor the CodeDeploy deployment as traffic shifts between the versions.
228228

packages/@aws-cdk/aws-codepipeline-actions/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ const func = new lambda.Function(this, 'Lambda', {
765765
runtime: lambda.Runtime.NODEJS_12_X,
766766
});
767767
// used to make sure each CDK synthesis produces a different Version
768-
const version = func.addVersion('NewVersion');
768+
const version = func.currentVersion;
769769
const alias = new lambda.Alias(this, 'LambdaAlias', {
770770
aliasName: 'Prod',
771771
version,

packages/@aws-cdk/aws-lambda/lib/alias.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export interface AliasProps extends AliasOptions {
7575
/**
7676
* Function version this alias refers to
7777
*
78-
* Use lambda.addVersion() to obtain a new lambda version to refer to.
78+
* Use lambda.currentVersion to reference a version with your latest changes.
7979
*/
8080
readonly version: IVersion;
8181
}

0 commit comments

Comments
 (0)