@@ -4,20 +4,11 @@ import * as lambda_nodejs from 'aws-cdk-lib/aws-lambda-nodejs';
44import * as lambda from 'aws-cdk-lib/aws-lambda' ;
55import * as log from 'aws-cdk-lib/aws-logs' ;
66import * as path from 'path' ;
7- import * as ec2 from 'aws-cdk-lib/aws-ec2' ;
87
98export class CdkbasicStack extends cdk . Stack {
109 constructor ( scope : Construct , id : string , props ?: cdk . StackProps ) {
1110 super ( scope , id , props ) ;
1211
13- // to test internal CDK internal handler restrict-default-security-group-handler/index.js
14- new ec2 . Vpc ( this , 'vpc' , {
15- ipAddresses : ec2 . IpAddresses . cidr ( '10.0.0.0/24' ) ,
16- ipProtocol : ec2 . IpProtocol . DUAL_STACK ,
17- restrictDefaultSecurityGroup : true ,
18- natGateways : 0 ,
19- } ) ;
20-
2112 const functionTestTsCommonJs = new lambda_nodejs . NodejsFunction (
2213 this ,
2314 'TestTsCommonJs' ,
@@ -55,43 +46,6 @@ export class CdkbasicStack extends cdk.Stack {
5546 } ,
5647 ) ;
5748
58- //testJsEsModule
59- const functionTestJsEsModule = new lambda_nodejs . NodejsFunction (
60- this ,
61- 'TestJsEsModule' ,
62- {
63- entry : 'services/testJsEsModule/lambda.js' ,
64- handler : 'lambdaHandler' ,
65- runtime : lambda . Runtime . NODEJS_20_X ,
66- bundling : {
67- format : lambda_nodejs . OutputFormat . ESM ,
68- } ,
69- logRetention : log . RetentionDays . ONE_DAY ,
70- } ,
71- ) ;
72-
73- const functionTestJsCommonJsBase = new lambda . Function (
74- this ,
75- 'TestJsCommonJsBase' ,
76- {
77- runtime : lambda . Runtime . NODEJS_20_X ,
78- handler : 'lambda.lambdaHandler' ,
79- code : lambda . Code . fromAsset ( 'services/testJsCommonJs' ) ,
80- logRetention : log . RetentionDays . ONE_DAY ,
81- } ,
82- ) ;
83-
84- const functionTestJsEsModuleBase = new lambda . Function (
85- this ,
86- 'TestJsEsModuleBase' ,
87- {
88- runtime : lambda . Runtime . NODEJS_20_X ,
89- handler : 'lambda.lambdaHandler' ,
90- code : lambda . Code . fromAsset ( 'services/testJsEsModule' ) ,
91- logRetention : log . RetentionDays . ONE_DAY ,
92- } ,
93- ) ;
94-
9549 new cdk . CfnOutput ( this , 'FunctionNameTestTsCommonJs' , {
9650 value : functionTestTsCommonJs . functionName ,
9751 } ) ;
@@ -103,17 +57,5 @@ export class CdkbasicStack extends cdk.Stack {
10357 new cdk . CfnOutput ( this , 'FunctionNameTestJsCommonJs' , {
10458 value : functionTestJsCommonJs . functionName ,
10559 } ) ;
106-
107- new cdk . CfnOutput ( this , 'FunctionNameTestJsEsModule' , {
108- value : functionTestJsEsModule . functionName ,
109- } ) ;
110-
111- new cdk . CfnOutput ( this , 'FunctionNameTestJsCommonJsBase' , {
112- value : functionTestJsCommonJsBase . functionName ,
113- } ) ;
114-
115- new cdk . CfnOutput ( this , 'FunctionNameTestJsEsModuleBase' , {
116- value : functionTestJsEsModuleBase . functionName ,
117- } ) ;
11860 }
11961}
0 commit comments