@adobe/helix-deploy 12.0.10 → 12.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [12.1.1](https://github.com/adobe/helix-deploy/compare/v12.1.0...v12.1.1) (2024-09-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Removing awsLayers does not remove layers from a deployed function [#734](https://github.com/adobe/helix-deploy/issues/734) ([#735](https://github.com/adobe/helix-deploy/issues/735)) ([b2bb82b](https://github.com/adobe/helix-deploy/commit/b2bb82bffc5c07abfac2d9db2f3e8d30b219e9cd))
7
+
8
+ # [12.1.0](https://github.com/adobe/helix-deploy/compare/v12.0.10...v12.1.0) (2024-08-28)
9
+
10
+
11
+ ### Features
12
+
13
+ * **aws:** support configuring Lambda Handler ([#733](https://github.com/adobe/helix-deploy/issues/733)) ([dfb1be9](https://github.com/adobe/helix-deploy/commit/dfb1be95ee1ed58359c2b49cf32ccdfacb3da036))
14
+
1
15
  ## [12.0.10](https://github.com/adobe/helix-deploy/compare/v12.0.9...v12.0.10) (2024-08-24)
2
16
 
3
17
 
package/README.md CHANGED
@@ -137,6 +137,7 @@ AWS Deployment Options
137
137
  --aws-tracing-mode The lambda tracing mode. Can be either "Active" or "PassThrough". [string]
138
138
  --aws-extra-permissions A list of additional invoke permissions to add to the lambda function in the form <SourceARN>@<Principal>. Optionally, you can use <SourceARN>@<Principal>:<Alias> if you want to scope the permission to a specific alias. [array]
139
139
  --aws-tags A list of additional tags to attach to the lambda function in the form key=value. To remove a tag, use key= (i.e. without a value). [array]
140
+ --aws-handler Set custom lambda Handler. For example, set if an AWS layer provides another function entry point. [string]
140
141
 
141
142
  Google Deployment Options
142
143
  --google-project-id the Google Cloud project to deploy to. Optional when the key file is a JSON file [string] [default: ""]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-deploy",
3
- "version": "12.0.10",
3
+ "version": "12.1.1",
4
4
  "description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/adobe/helix-deploy#readme",
@@ -35,6 +35,7 @@ export default class AWSConfig {
35
35
  tracingMode: undefined,
36
36
  extraPermissions: undefined,
37
37
  tags: undefined,
38
+ handler: undefined,
38
39
  });
39
40
  }
40
41
 
@@ -58,7 +59,8 @@ export default class AWSConfig {
58
59
  .withAWSLayers(argv.awsLayers)
59
60
  .withAWSTracingMode(argv.awsTracingMode)
60
61
  .withAWSExtraPermissions(argv.awsExtraPermissions)
61
- .withAWSTags(argv.awsTags);
62
+ .withAWSTags(argv.awsTags)
63
+ .withAWSHandler(argv.awsHandler);
62
64
  }
63
65
 
64
66
  withAWSRegion(value) {
@@ -162,13 +164,18 @@ export default class AWSConfig {
162
164
  return this;
163
165
  }
164
166
 
167
+ withAWSHandler(value) {
168
+ this.handler = value;
169
+ return this;
170
+ }
171
+
165
172
  static yarg(yargs) {
166
173
  return yargs
167
174
  .group(['aws-region', 'aws-api', 'aws-role', 'aws-cleanup-buckets', 'aws-cleanup-integrations',
168
175
  'aws-cleanup-versions', 'aws-create-routes', 'aws-create-authorizer', 'aws-attach-authorizer',
169
176
  'aws-lambda-format', 'aws-parameter-manager', 'aws-deploy-template', 'aws-arch', 'aws-update-secrets',
170
177
  'aws-deploy-bucket', 'aws-identity-source', 'aws-log-format', 'aws-layers',
171
- 'aws-tracing-mode', 'aws-extra-permissions', 'aws-tags'], 'AWS Deployment Options')
178
+ 'aws-tracing-mode', 'aws-extra-permissions', 'aws-tags', 'aws-handler'], 'AWS Deployment Options')
172
179
  .option('aws-region', {
173
180
  description: 'the AWS region to deploy lambda functions to',
174
181
  type: 'string',
@@ -263,6 +270,10 @@ export default class AWSConfig {
263
270
  description: 'A list of additional tags to attach to the lambda function in the form key=value. To remove a tag, use key= (i.e. without a value).',
264
271
  type: 'array',
265
272
  array: true,
273
+ })
274
+ .option('aws-handler', {
275
+ description: 'Set custom lambda Handler. For example, set if an AWS layer provides another function entry point.',
276
+ type: 'string',
266
277
  });
267
278
  }
268
279
  }
@@ -218,9 +218,8 @@ export default class AWSDeployer extends BaseDeployer {
218
218
  this.log.info(chalk`{green ok:} deleted deploy package {blueBright s3://${this._bucket}/${this._key}}.`);
219
219
  }
220
220
 
221
- async createLambda() {
221
+ get functionConfig() {
222
222
  const { cfg, functionName, additionalTags } = this;
223
- const functionVersion = cfg.version.replace(/\./g, '_');
224
223
 
225
224
  const functionConfig = {
226
225
  Code: {
@@ -247,12 +246,12 @@ export default class AWSDeployer extends BaseDeployer {
247
246
  Environment: {
248
247
  Variables: cfg.params,
249
248
  },
250
- Handler: cfg.esm ? 'esm-adapter/index.handler' : 'index.lambda',
249
+ Handler: this._cfg.handler || (cfg.esm ? 'esm-adapter/index.handler' : 'index.lambda'),
251
250
  Architectures: [
252
251
  this._cfg.arch,
253
252
  ],
254
253
  LoggingConfig: this._cfg.logFormat ? { Format: this._cfg.logFormat } : undefined,
255
- Layers: this._cfg.layers,
254
+ Layers: this._cfg.layers || [],
256
255
  TracingConfig: this._cfg.tracingMode ? { Mode: this._cfg.tracingMode } : undefined,
257
256
  };
258
257
 
@@ -263,6 +262,15 @@ export default class AWSDeployer extends BaseDeployer {
263
262
  }
264
263
  });
265
264
 
265
+ return functionConfig;
266
+ }
267
+
268
+ async createLambda() {
269
+ const {
270
+ cfg, functionName, additionalTags, functionConfig,
271
+ } = this;
272
+ const functionVersion = cfg.version.replace(/\./g, '_');
273
+
266
274
  this.log.info(`--: using lambda role "${this._cfg.role}"`);
267
275
 
268
276
  // check if function already exists