Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lambda): add a newVersion method #2099

Merged
merged 1 commit into from
Mar 29, 2019

Conversation

skinny85
Copy link
Contributor

This method is useful when deploying a Lambda through a CodePipeline.
It creates a new Version every time the CDK code is executed,
that way making sure an updated Lambda Alias will not point to an old Version.


Pull Request Checklist

  • Testing
    • Unit test added (prefer not to modify an existing test, otherwise, it's probably a breaking change)
    • CLI change?: coordinate update of integration tests with team
    • cdk-init template change?: coordinated update of integration tests with team
  • Docs
    • jsdocs: All public APIs documented
    • README: README and/or documentation topic updated
  • Title and Description
    • Change type: title prefixed with fix, feat will appear in changelog
    • Title: use lower-case and doesn't end with a period
    • Breaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"
    • Issues: Indicate issues fixed via: "Fixes #xxx" or "Closes #xxx"
  • Sensitive Modules (requires 2 PR approvers)
    • IAM Policy Document (in @aws-cdk/aws-iam)
    • EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)
    • Grant APIs (only if not based on official documentation with a reference)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.

@skinny85 skinny85 requested a review from a team as a code owner March 27, 2019 00:16
* even though it traveled through the entire Pipeline,
* because the Alias is still pointing to an old Version.
* This method creates a new, unique Version every time the CDK code is executed,
* and so prevents that from happening.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with the new-lines here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally try to break docs on sentence boundaries, so that future diffs of changes here will look better.

The newlines are not rendered in the docs themselves.

packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
@Doug-AWS
Copy link
Contributor

Is any of this visible to the user? Would they care?

@skinny85
Copy link
Contributor Author

Is any of this visible to the user? Would they care?

Yes. Yes.

@skinny85 skinny85 self-assigned this Mar 28, 2019
This method is useful when deploying a Lambda through a CodePipeline.
It creates a new Version every time the CDK code is executed,
that way making sure an updated Lambda Alias will not point to an old Version.
@skinny85 skinny85 force-pushed the feature/new-version-for-lambda branch from 28f9e9b to 1b5272d Compare March 29, 2019 00:58
@skinny85
Copy link
Contributor Author

Rebased and changed the method to use Date#toISOString().

@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 29, 2019

I kinda would hope we'd have a better solution than this (source hash, most likely), but until we do this'll do (pig).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants