Skip to content

Commit

Permalink
feat: upgrade all uses of node8.10 lambda runtime to node10.x (#5075)
Browse files Browse the repository at this point in the history
Upgrade all internal uses of node8.10 lambda runtime to node10.x.

This includes all exported constructs that contain a lambda function within them.

Update NODE_10_X runtime to allow inline code in CloudFormation, per
aws-cloudformation/cloudformation-coverage-roadmap#80.

Shout out to @nmussy who got this most of the way (#4655)

close #4653, close #4642
  • Loading branch information
nija-at committed Nov 18, 2019
1 parent f4ea264 commit 7a3a3b1
Show file tree
Hide file tree
Showing 85 changed files with 195 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"BooksHandlerServiceRole5B6A8847"
Expand Down Expand Up @@ -94,7 +94,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"BookHandlerServiceRole894768AD"
Expand Down Expand Up @@ -144,7 +144,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"HelloServiceRole1E55EA16"
Expand Down Expand Up @@ -880,4 +880,4 @@
}
}
}
}
}
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ class BookStack extends cdk.Stack {
super(scope, id);

const booksHandler = new apigw.LambdaIntegration(new lambda.Function(this, 'BooksHandler', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.fromInline(`exports.handler = ${echoHandlerCode}`)
}));

const bookHandler = new apigw.LambdaIntegration(new lambda.Function(this, 'BookHandler', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.fromInline(`exports.handler = ${echoHandlerCode}`)
}));

const hello = new apigw.LambdaIntegration(new lambda.Function(this, 'Hello', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.fromInline(`exports.handler = ${helloCode}`)
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"MyHandlerServiceRoleFFA06653"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10",
"Runtime": "nodejs10.x",
"FunctionName": "FirstLambda"
},
"DependsOn": [
Expand Down Expand Up @@ -319,4 +319,4 @@
}
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FirstStack extends cdk.Stack {
}
}`),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});
}
}
Expand All @@ -45,4 +45,4 @@ class SecondStack extends cdk.Stack {
const app = new cdk.App();
const first = new FirstStack(app, 'FirstStack');
new SecondStack(app, 'SecondStack', { lambda: first.firstLambda });
app.synth();
app.synth();
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"HelloServiceRole1E55EA16"
Expand Down Expand Up @@ -523,4 +523,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MultiStack extends cdk.Stack {
super(scope, id);

const hello = new apigw.LambdaIntegration(new lambda.Function(this, 'Hello', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${helloCode}`)
}));
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Test extends cdk.Stack {
});

const handler = new lambda.Function(this, 'MyHandler', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
code: lambda.Code.fromInline(`exports.handler = ${handlerCode}`),
handler: 'index.handler',
});
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

// WHEN
Expand Down Expand Up @@ -78,7 +78,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});
const alias = new lambda.Alias(stack, 'alias', {
aliasName: 'my-alias',
Expand Down Expand Up @@ -145,7 +145,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

// WHEN
Expand Down Expand Up @@ -184,7 +184,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

test.throws(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/test/test.lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export = {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
code: lambda.Code.fromInline('foo'),
handler: 'index.handler'
});
Expand Down Expand Up @@ -106,7 +106,7 @@ export = {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
code: lambda.Code.fromInline('foo'),
handler: 'index.handler'
});
Expand All @@ -132,7 +132,7 @@ export = {
const api = new apigateway.RestApi(stack, 'test-api');

const handler = new lambda.Function(stack, 'MyFunc', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.fromInline(`loo`)
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('given an AutoScalingGroup', () => {
// GIVEN
const fn = new lambda.Function(stack, 'Fn', {
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.index',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
},
"/",
{
"Ref": "AssetParameters3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902S3Bucket92C29C04"
"Ref": "AssetParametersdddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccafS3BucketE3660F43"
},
"/",
{
Expand All @@ -168,7 +168,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902S3VersionKeyB63C774A"
"Ref": "AssetParametersdddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccafS3VersionKeyFD0B0470"
}
]
}
Expand All @@ -181,7 +181,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902S3VersionKeyB63C774A"
"Ref": "AssetParametersdddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccafS3VersionKeyFD0B0470"
}
]
}
Expand Down Expand Up @@ -266,17 +266,17 @@
"Type": "String",
"Description": "Artifact hash for asset \"0d0404717d8867c09534f2cf382e8e24531ff64a968afa2efd7f071ad65a22df\""
},
"AssetParameters3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902S3Bucket92C29C04": {
"AssetParametersdddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccafS3BucketE3660F43": {
"Type": "String",
"Description": "S3 bucket for asset \"3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902\""
"Description": "S3 bucket for asset \"dddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccaf\""
},
"AssetParameters3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902S3VersionKeyB63C774A": {
"AssetParametersdddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccafS3VersionKeyFD0B0470": {
"Type": "String",
"Description": "S3 key for asset version \"3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902\""
"Description": "S3 key for asset version \"dddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccaf\""
},
"AssetParameters3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902ArtifactHashF5652BAD": {
"AssetParametersdddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccafArtifactHashEECD8E35": {
"Type": "String",
"Description": "Artifact hash for asset \"3d1024a4bdf2d2a5447520356aafce4068b52bbc6f71c3d0a5230c032f632902\""
"Description": "Artifact hash for asset \"dddca70fcceefd0a4532c8eb5ad3d5da6f51d64fda9343f0b57dd664736dccaf\""
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MyNestedStack extends cfn.NestedStack {

if (props.subscriber) {
new lambda.Function(this, 'fn', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
code: lambda.Code.inline('console.error("hi")'),
handler: 'index.handler',
environment: {
Expand All @@ -61,4 +61,4 @@ class MyTestStack extends Stack {

const app = new App();
new MyTestStack(app, 'nested-stacks-test');
app.synth();
app.synth();
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"LambdaServiceRoleA8ED4D3B"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const sourceBucket = new s3.Bucket(stack, 'Bucket', {
const lambdaFunction = new lambda.Function(stack, 'Lambda', {
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_8_10
runtime: lambda.Runtime.NODEJS_10_X
});

const lambdaVersion = new lambda.Version(stack, 'LambdaVersion', {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/test/test.basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export = {
uuid: 'xxxx-xxxx-xxxx-xxxx',
code: lambda.Code.inline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_8_10
runtime: lambda.Runtime.NODEJS_10_X
});

new CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10",
"Runtime": "nodejs10.x",
"Timeout": 300
},
"DependsOn": [
Expand Down Expand Up @@ -416,4 +416,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10",
"Runtime": "nodejs10.x",
"Timeout": 300
},
"DependsOn": [
Expand Down Expand Up @@ -394,4 +394,4 @@
"Description": "Artifact hash for asset \"ea7034d81c091be1158bcd85b4958dc86ec6672c345be27607d68fdfcf26b1c1\""
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"HandlerServiceRoleFCDC14AE"
Expand Down Expand Up @@ -250,7 +250,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"PreHookServiceRoleDefaultPolicy65358F76",
Expand Down Expand Up @@ -383,7 +383,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"PostHookServiceRoleDefaultPolicy82AEE758",
Expand Down Expand Up @@ -586,4 +586,4 @@
"Description": "Artifact hash for asset \"93dbd8c02dbfca9077c9d83cb6d3a94659988c7d143988da4a554033a58f963c\""
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codedeploy-lambda');
const handler = new lambda.Function(stack, `Handler`, {
code: lambda.Code.fromAsset(path.join(__dirname, 'handler')),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});
const version = handler.addVersion('1');
const blueGreenAlias = new lambda.Alias(stack, `Alias`, {
Expand All @@ -22,12 +22,12 @@ const blueGreenAlias = new lambda.Alias(stack, `Alias`, {
const preHook = new lambda.Function(stack, `PreHook`, {
code: lambda.Code.fromAsset(path.join(__dirname, 'preHook')),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_8_10
runtime: lambda.Runtime.NODEJS_10_X
});
const postHook = new lambda.Function(stack, `PostHook`, {
code: lambda.Code.fromAsset(path.join(__dirname, 'postHook')),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_8_10
runtime: lambda.Runtime.NODEJS_10_X
});

new codedeploy.LambdaDeploymentGroup(stack, 'BlueGreenDeployment', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function mockFunction(stack: cdk.Stack, id: string) {
return new lambda.Function(stack, id, {
code: lambda.Code.fromInline('mock'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_8_10
runtime: lambda.Runtime.NODEJS_10_X
});
}
function mockAlias(stack: cdk.Stack) {
Expand Down

0 comments on commit 7a3a3b1

Please sign in to comment.