Skip to content

Commit a1e7009

Browse files
authored
Merge pull request #166 from mapbox/add_architectures_to_lambda
add architectures property to lambda shortcuts
2 parents 030e077 + 97038e0 commit a1e7009

File tree

7 files changed

+19
-3
lines changed

7 files changed

+19
-3
lines changed

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 9.4.0
4+
5+
- Add support for `Architectures` property to Lambda shortcuts.
6+
7+
## 9.3.2
8+
9+
- Dependency update to avoid security vulnerabilities (@aws-sdk/client-cloudformation).
10+
311
## 9.3.1
412

513
- Add `GlueIcebergTable` shortcut for creating AWS Glue tables backed by Apache Iceberg format with support for table optimizers.

lib/shortcuts/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ Log Group, a Role, an Alarm on function errors, and the Lambda Function itself.
428428
| options | <code>Object</code> | | Options. |
429429
| 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. |
430430
| options.Code | <code>Object</code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html). |
431+
| [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). |
431432
| [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). |
432433
| [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). |
433434
| [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). |

lib/shortcuts/lambda.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const ServiceRole = require('./service-role');
1212
* within the CloudFormation template. This is used to construct the logical
1313
* names of the other resources, as well as the Lambda function's name.
1414
* @param {Object} options.Code - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html).
15+
* @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).
1516
* @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).
1617
* @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).
1718
* @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).
@@ -72,6 +73,7 @@ class Lambda {
7273
const {
7374
LogicalName,
7475
Code,
76+
Architectures,
7577
ImageConfig,
7678
DeadLetterConfig,
7779
Description = { 'Fn::Sub': `${LogicalName} in the \${AWS::StackName} stack` },
@@ -155,6 +157,7 @@ class Lambda {
155157
DependsOn,
156158
Properties: {
157159
Code,
160+
Architectures,
158161
ImageConfig,
159162
DeadLetterConfig,
160163
Description,

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mapbox/cloudfriend",
3-
"version": "9.3.2",
3+
"version": "9.4.0",
44
"description": "Helper functions for assembling CloudFormation templates in JavaScript",
55
"main": "index.js",
66
"engines": {

test/fixtures/shortcuts/lambda-full.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
"S3Bucket": "my-code-bucket",
4141
"S3Key": "path/to/code.zip"
4242
},
43+
"Architectures": [
44+
"arm64"
45+
],
4346
"DeadLetterConfig": {
4447
"TargetArn": "arn:aws:sqs:us-east-1:123456789012:queue/fake"
4548
},

test/shortcuts.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ describe('[shortcuts] lambda', () => {
145145
S3Bucket: 'my-code-bucket',
146146
S3Key: 'path/to/code.zip'
147147
},
148+
Architectures: ['arm64'],
148149
DeadLetterConfig: {
149150
TargetArn: 'arn:aws:sqs:us-east-1:123456789012:queue/fake'
150151
},

0 commit comments

Comments
 (0)