File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export function init(options: AwsServerlessOptions = {}): NodeClient | undefined
3030 const sdkSource = getSDKSource ( ) ;
3131 const opts = {
3232 defaultIntegrations : getDefaultIntegrations ( options ) ,
33- useLayerExtension : sdkSource === 'aws-lambda-layer' ,
33+ useLayerExtension : sdkSource === 'aws-lambda-layer' && ! options . tunnel ,
3434 ...options ,
3535 } ;
3636
Original file line number Diff line number Diff line change @@ -111,5 +111,21 @@ describe('init', () => {
111111 } ) ,
112112 ) ;
113113 } ) ;
114+
115+ test ( 'should default useLayerExtension to false when tunnel is provided even when SDK source is aws-lambda-layer' , ( ) => {
116+ mockGetSDKSource . mockReturnValue ( 'aws-lambda-layer' ) ;
117+ const options : AwsServerlessOptions = {
118+ tunnel : 'https://custom-tunnel.example.com' ,
119+ } ;
120+
121+ init ( options ) ;
122+
123+ expect ( mockInitWithoutDefaultIntegrations ) . toHaveBeenCalledWith (
124+ expect . objectContaining ( {
125+ useLayerExtension : false ,
126+ tunnel : 'https://custom-tunnel.example.com' ,
127+ } ) ,
128+ ) ;
129+ } ) ;
114130 } ) ;
115131} ) ;
You can’t perform that action at this time.
0 commit comments