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
2 changes: 1 addition & 1 deletion API.md

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

7 changes: 3 additions & 4 deletions src/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface DotNetFunctionProps extends lambda.FunctionOptions {
/**
* The runtime environment. Only runtimes of the .NET family and provided family are supported.
*
* @default lambda.Runtime.PROVIDED_AL2
* @default lambda.Runtime.DOTNET_8
*/
readonly runtime?: lambda.Runtime;

Expand Down Expand Up @@ -63,8 +63,7 @@ export class DotNetFunction extends lambda.Function {
// Find aws-lambda-tools-defaults.json in project directory
const lambdaToolsDefaults = getLambdaToolsDefaults(projectDir);

// Resolve Lambda runtime from properties, aws-lambda-tools-defaults.json or default to PROVIDED_AL2

// Resolve Lambda runtime from properties, aws-lambda-tools-defaults.json or default to DOTNET_8
let runtime = props.runtime;
if (!runtime) {
const toolsRuntime = lambdaToolsDefaults?.['function-runtime'] as
Expand All @@ -80,7 +79,7 @@ export class DotNetFunction extends lambda.Function {
: lambda.RuntimeFamily.OTHER;
runtime = new lambda.Runtime(toolsRuntime, family);
} else {
runtime = lambda.Runtime.DOTNET_6;
runtime = lambda.Runtime.DOTNET_8;
}
}
if (
Expand Down
2 changes: 1 addition & 1 deletion test/integ.function-aot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestStack extends Stack {

const fn = new dotnet.DotNetFunction(this, 'lambda-handler', {
projectDir: 'lambda-handler-aot',
runtime: lambda.Runtime.PROVIDED_AL2,
runtime: lambda.Runtime.PROVIDED_AL2023,
bundling: {
msbuildParameters: ['/p:PublishAot=true'],
},
Expand Down
2 changes: 1 addition & 1 deletion test/integ.function-aot.ts.snapshot/cdk.out
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"31.0.0"}
{"version":"36.0.0"}
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"version": "31.0.0",
"version": "36.0.0",
"files": {
"3afcdc2564c22c22f2e8c7c164709f382276a3bb3c0e5707193d96f9eb2be352": {
"c8d221fd3a68e77e0bb5a1a3a20632d82241bd8594240ed97a0c270b29d76fe1": {
"source": {
"path": "asset.3afcdc2564c22c22f2e8c7c164709f382276a3bb3c0e5707193d96f9eb2be352",
"packaging": "zip"
"path": "asset.c8d221fd3a68e77e0bb5a1a3a20632d82241bd8594240ed97a0c270b29d76fe1.zip",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "3afcdc2564c22c22f2e8c7c164709f382276a3bb3c0e5707193d96f9eb2be352.zip",
"objectKey": "c8d221fd3a68e77e0bb5a1a3a20632d82241bd8594240ed97a0c270b29d76fe1.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"8b32c683122f98f83f1bc6a677493b2056a3ed55fb6e2ec6870cb08a464fc142": {
"3cecd6ad73d70bef6c99834469a796514b0f55ac40e537f945370fd2fc4b597d": {
"source": {
"path": "integ-lambda-dotnet-function.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "8b32c683122f98f83f1bc6a677493b2056a3ed55fb6e2ec6870cb08a464fc142.json",
"objectKey": "3cecd6ad73d70bef6c99834469a796514b0f55ac40e537f945370fd2fc4b597d.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@
"lambdahandler909F9205": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Architectures": [
"x86_64"
],
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "3afcdc2564c22c22f2e8c7c164709f382276a3bb3c0e5707193d96f9eb2be352.zip"
"S3Key": "c8d221fd3a68e77e0bb5a1a3a20632d82241bd8594240ed97a0c270b29d76fe1.zip"
},
"Handler": "LambdaHandler",
"Role": {
"Fn::GetAtt": [
"lambdahandlerServiceRoleA08D1FE8",
"Arn"
]
},
"Architectures": [
"x86_64"
],
"Handler": "LambdaHandler",
"Runtime": "provided.al2"
"Runtime": "provided.al2023"
},
"DependsOn": [
"lambdahandlerServiceRoleA08D1FE8"
Expand Down
2 changes: 1 addition & 1 deletion test/integ.function-aot.ts.snapshot/integ.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "31.0.0",
"version": "36.0.0",
"testCases": {
"lambda-dotnet-function/DefaultTest": {
"stacks": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"version": "31.0.0",
"version": "36.0.0",
"files": {
"ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3": {
"ac51674cf5325b7a0e5444d6b7c1f88607c16a031b852bd51c375ac8c5c4fce5": {
"source": {
"path": "asset.ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.bundle",
"path": "asset.ac51674cf5325b7a0e5444d6b7c1f88607c16a031b852bd51c375ac8c5c4fce5.bundle",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip",
"objectKey": "ac51674cf5325b7a0e5444d6b7c1f88607c16a031b852bd51c375ac8c5c4fce5.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"13f2f2564450a40bf43d77018823605bcbfa7fdf49245d56c5e516d8d3192e9f": {
"c7af404054ae80514e6e730ee4f0244146e414182b036979f382594c6632acbd": {
"source": {
"path": "lambdadotnetfunctionDefaultTestDeployAssert02A806B6.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "13f2f2564450a40bf43d77018823605bcbfa7fdf49245d56c5e516d8d3192e9f.json",
"objectKey": "c7af404054ae80514e6e730ee4f0244146e414182b036979f382594c6632acbd.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@
"expected": "{\"$ObjectLike\":{\"Payload\":\"\\\"Ok\\\"\"}}",
"parameters": {
"FunctionName": {
"Fn::ImportValue": "integ-lambda-dotnet-function:ExportsOutputReflambdahandler909F920591EA4974"
"Fn::Join": [
"",
[
"\"",
{
"Fn::ImportValue": "integ-lambda-dotnet-function:ExportsOutputReflambdahandler909F920591EA4974"
},
"\""
]
]
}
},
"flattenResponse": "false",
"salt": "1701536823208"
"salt": "1726517775923"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down Expand Up @@ -113,12 +122,12 @@
"SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Runtime": "nodejs14.x",
"Runtime": "nodejs18.x",
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip"
"S3Key": "ac51674cf5325b7a0e5444d6b7c1f88607c16a031b852bd51c375ac8c5c4fce5.zip"
},
"Timeout": 120,
"Handler": "index.handler",
Expand Down
8 changes: 5 additions & 3 deletions test/integ.function-aot.ts.snapshot/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "35.0.0",
"version": "36.0.24",
"artifacts": {
"integ-lambda-dotnet-function.assets": {
"type": "cdk:asset-manifest",
Expand All @@ -14,10 +14,11 @@
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "integ-lambda-dotnet-function.template.json",
"terminationProtection": false,
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8b32c683122f98f83f1bc6a677493b2056a3ed55fb6e2ec6870cb08a464fc142.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3cecd6ad73d70bef6c99834469a796514b0f55ac40e537f945370fd2fc4b597d.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down Expand Up @@ -85,10 +86,11 @@
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "lambdadotnetfunctionDefaultTestDeployAssert02A806B6.template.json",
"terminationProtection": false,
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/13f2f2564450a40bf43d77018823605bcbfa7fdf49245d56c5e516d8d3192e9f.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c7af404054ae80514e6e730ee4f0244146e414182b036979f382594c6632acbd.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Loading