Skip to content

Commit

Permalink
docs(lambda): remove references to deprecated addVersion() (#19601)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
peterwoodworth authored Mar 29, 2022
1 parent 6a63924 commit 64b266f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-applicationautoscaling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const handler = new lambda.Function(this, 'MyFunction', {
reservedConcurrentExecutions: 2,
});

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

const target = new appscaling.ScalableTarget(this, 'ScalableTarget', {
serviceNamespace: appscaling.ServiceNamespace.LAMBDA,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codedeploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ To create a new CodeDeploy Deployment Group that deploys to a Lambda function:
```ts
declare const myApplication: codedeploy.LambdaApplication;
declare const func: lambda.Function;
const version = func.addVersion('1');
const version = func.currentVersion;
const version1Alias = new lambda.Alias(this, 'alias', {
aliasName: 'prod',
version,
Expand All @@ -222,7 +222,7 @@ const deploymentGroup = new codedeploy.LambdaDeploymentGroup(this, 'BlueGreenDep

In order to deploy a new version of this function:

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

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ const func = new lambda.Function(this, 'Lambda', {
runtime: lambda.Runtime.NODEJS_12_X,
});
// used to make sure each CDK synthesis produces a different Version
const version = func.addVersion('NewVersion');
const version = func.currentVersion;
const alias = new lambda.Alias(this, 'LambdaAlias', {
aliasName: 'Prod',
version,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/lib/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface AliasProps extends AliasOptions {
/**
* Function version this alias refers to
*
* Use lambda.addVersion() to obtain a new lambda version to refer to.
* Use lambda.currentVersion to reference a version with your latest changes.
*/
readonly version: IVersion;
}
Expand Down

0 comments on commit 64b266f

Please sign in to comment.