Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 9.4.0

- Add support for `Architectures` property to Lambda shortcuts.

## 9.3.2

- Dependency update to avoid security vulnerabilities (@aws-sdk/client-cloudformation).

## 9.3.1

- Add `GlueIcebergTable` shortcut for creating AWS Glue tables backed by Apache Iceberg format with support for table optimizers.
Expand Down
1 change: 1 addition & 0 deletions lib/shortcuts/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ Log Group, a Role, an Alarm on function errors, and the Lambda Function itself.
| options | <code>Object</code> | | Options. |
| options.LogicalName | <code>String</code> | | The logical name of the Lambda function within the CloudFormation template. This is used to construct the logical names of the other resources, as well as the Lambda function's name. |
| options.Code | <code>Object</code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html). |
| [options.Architectures] | <code>Array.&lt;String&gt;</code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-architectures). |
| [options.ImageConfig] | <code>Object</code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig). |
| [options.DeadLetterConfig] | <code>Object</code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-deadletterconfig). |
| [options.Description] | <code>String</code> | <code>&#x27;${logical name} in the ${stack name} stack&#x27;</code> | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-description). |
Expand Down
3 changes: 3 additions & 0 deletions lib/shortcuts/lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ServiceRole = require('./service-role');
* within the CloudFormation template. This is used to construct the logical
* names of the other resources, as well as the Lambda function's name.
* @param {Object} options.Code - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html).
* @param {Array<String>} [options.Architectures=undefined] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-architectures).
* @param {Object} [options.ImageConfig=undefined] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig).
* @param {Object} [options.DeadLetterConfig=undefined] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-deadletterconfig).
* @param {String} [options.Description='${logical name} in the ${stack name} stack'] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-description).
Expand Down Expand Up @@ -72,6 +73,7 @@ class Lambda {
const {
LogicalName,
Code,
Architectures,
ImageConfig,
DeadLetterConfig,
Description = { 'Fn::Sub': `${LogicalName} in the \${AWS::StackName} stack` },
Expand Down Expand Up @@ -155,6 +157,7 @@ class Lambda {
DependsOn,
Properties: {
Code,
Architectures,
ImageConfig,
DeadLetterConfig,
Description,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mapbox/cloudfriend",
"version": "9.3.2",
"version": "9.4.0",
"description": "Helper functions for assembling CloudFormation templates in JavaScript",
"main": "index.js",
"engines": {
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/shortcuts/lambda-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"S3Bucket": "my-code-bucket",
"S3Key": "path/to/code.zip"
},
"Architectures": [
"arm64"
],
"DeadLetterConfig": {
"TargetArn": "arn:aws:sqs:us-east-1:123456789012:queue/fake"
},
Expand Down
1 change: 1 addition & 0 deletions test/shortcuts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ describe('[shortcuts] lambda', () => {
S3Bucket: 'my-code-bucket',
S3Key: 'path/to/code.zip'
},
Architectures: ['arm64'],
DeadLetterConfig: {
TargetArn: 'arn:aws:sqs:us-east-1:123456789012:queue/fake'
},
Expand Down