Skip to content

Commit 6a4d75d

Browse files
feat: ElasticLoadBalancingV2 TargetGroups, provisioned concurrency support (#26)
* Scoped package, version bump, publish job * Add ELBV2 and existing target alias support Co-authored-by: Matthew Elwell <[email protected]>
1 parent a6bfb25 commit 6a4d75d

13 files changed

+1361
-331
lines changed

.github/workflows/publish-package.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
name: Tests & Publish
11+
12+
steps:
13+
- name: Cloning repo
14+
uses: actions/checkout@v2
15+
16+
- name: Setup Node.js
17+
id: setup-node
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version-file: .nvmrc
21+
cache: npm
22+
23+
- name: Install dependencies
24+
run: npm ci --ignore-scripts
25+
26+
- name: Run tests
27+
run: npm run test
28+
29+
- name: Publish package
30+
run: npm publish --access public
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/run-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ jobs:
2323
with:
2424
node-version-file: .nvmrc
2525
cache: npm
26-
26+
2727
- name: Install dependencies
28-
if: steps.setup-node.outputs.cache-hit != 'true'
2928
run: npm ci --ignore-scripts
3029

3130
- name: Run tests

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Some values are only available as top-level configurations. They are:
104104
The plugin relies on the [AWS Lambda traffic shifting feature](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) to balance traffic between versions and [AWS CodeDeploy](https://docs.aws.amazon.com/lambda/latest/dg/automating-updates-to-serverless-apps.html) to automatically update its weight. It modifies the `CloudFormation` template generated by [Serverless](https://github.com/serverless/serverless), so that:
105105

106106
1. It creates a Lambda function Alias for each function with deployment settings.
107+
- For functions that already have a target alias due to provisioned concurrency or SnapStart configuration, the CodeDeploy-related settings are applied to it.
107108
2. It creates a CodeDeploy Application and adds a [CodeDeploy DeploymentGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentgroup.html) per Lambda function, according to the specified settings.
108109
3. It modifies events that trigger Lambda functions, so that they invoke the newly created alias.
109110

@@ -119,6 +120,7 @@ For now, the plugin only works with Lambda functions invoked by
119120
* CloudWatch Logs
120121
* IoT rules
121122
* AppSync DataSources
123+
* ElasticLoadBalancingV2 TargetGroups
122124

123125
[More events](https://serverless.com/framework/docs/providers/aws/events/) will be added soon.
124126

0 commit comments

Comments
 (0)