Skip to content

Commit 9513fa0

Browse files
committed
only default to true if tunnel isn't set
1 parent a131d05 commit 9513fa0

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

packages/aws-serverless/src/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

packages/aws-serverless/test/init.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)