-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lambda): support for ARM architecture (#16719)
Add support for the `architectures` and `compatibleArchitectures` key in the `Function` and `LayerVersion` constructs. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
10 changed files
with
157 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Architectures supported by AWS Lambda | ||
*/ | ||
export class Architecture { | ||
/** | ||
* 64 bit architecture with x86 instruction set. | ||
*/ | ||
public static readonly X86_64 = new Architecture('x86_64'); | ||
|
||
/** | ||
* 64 bit architecture with the ARM instruction set. | ||
*/ | ||
public static readonly ARM_64 = new Architecture('arm64'); | ||
|
||
/** | ||
* Used to specify a custom architecture name. | ||
* Use this if the architecture name is not yet supported by the CDK. | ||
* @param name the architecture name as recognized by AWS Lambda. | ||
*/ | ||
public static custom(name: string) { | ||
return new Architecture(name); | ||
} | ||
|
||
/** | ||
* The name of the architecture as recognized by the AWS Lambda service APIs. | ||
*/ | ||
public readonly name: string; | ||
|
||
private constructor(archName: string) { | ||
this.name = archName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/@aws-cdk/cfnspec/spec-source/530_Lambda_ARM_patch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"ResourceType": { | ||
"AWS::Lambda::Function": { | ||
"patch": { | ||
"description": "AWS::Lambda::Function changes for early support of Lambda ARM launch. Remove once CFN spec is updated", | ||
"operations": [ | ||
{ | ||
"op": "add", | ||
"path": "/Properties/Architectures", | ||
"value": { | ||
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-architectures", | ||
"UpdateType": "Mutable", | ||
"Required": false, | ||
"Type": "List", | ||
"PrimitiveItemType": "String", | ||
"DuplicatesAllowed": true | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"AWS::Lambda::LayerVersion": { | ||
"patch": { | ||
"description": "AWS::Lambda::LayerVersion changes for early support of Lambda ARM launch. Remove once CFN spec is updated", | ||
"operations": [ | ||
{ | ||
"op": "add", | ||
"path": "/Properties/CompatibleArchitectures", | ||
"value": { | ||
"PrimitiveItemType": "String", | ||
"Type": "List", | ||
"Required": false, | ||
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-compatiblearchitectures", | ||
"UpdateType": "Immutable" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"version": "1.124.0" | ||
"version": "1.125.0" | ||
} |