@aws-sdk/middleware-sdk-ec2 3.78.0 → 3.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist-cjs/index.js +7 -1
- package/dist-es/index.js +14 -5
- package/dist-types/index.d.ts +2 -1
- package/dist-types/ts3.4/index.d.ts +2 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.110.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.109.0...v3.110.0) (2022-06-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/middleware-sdk-ec2
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.109.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.108.1...v3.109.0) (2022-06-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/middleware-sdk-ec2
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.107.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.106.0...v3.107.0) (2022-06-08)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **middleware-sdk-ec2:** use hostname from regionInfoProvider ([#3673](https://github.com/aws/aws-sdk-js-v3/issues/3673)) ([5103554](https://github.com/aws/aws-sdk-js-v3/commit/5103554ba12de4f9c648db9ea823551769d866d5))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# [3.78.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.77.0...v3.78.0) (2022-04-26)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @aws-sdk/middleware-sdk-ec2
|
package/dist-cjs/index.js
CHANGED
|
@@ -11,7 +11,13 @@ function copySnapshotPresignedUrlMiddleware(options) {
|
|
|
11
11
|
if (!input.PresignedUrl) {
|
|
12
12
|
const region = await options.region();
|
|
13
13
|
const resolvedEndpoint = await options.endpoint();
|
|
14
|
-
|
|
14
|
+
if (typeof options.regionInfoProvider === "function") {
|
|
15
|
+
const regionInfo = await options.regionInfoProvider(input.SourceRegion);
|
|
16
|
+
resolvedEndpoint.hostname = (regionInfo === null || regionInfo === void 0 ? void 0 : regionInfo.hostname) || `ec2.${input.SourceRegion}.amazonaws.com`;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
resolvedEndpoint.hostname = `ec2.${input.SourceRegion}.amazonaws.com`;
|
|
20
|
+
}
|
|
15
21
|
const request = new protocol_http_1.HttpRequest({
|
|
16
22
|
...resolvedEndpoint,
|
|
17
23
|
protocol: "https",
|
package/dist-es/index.js
CHANGED
|
@@ -7,19 +7,28 @@ export function copySnapshotPresignedUrlMiddleware(options) {
|
|
|
7
7
|
var _this = this;
|
|
8
8
|
return function (next) {
|
|
9
9
|
return function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
10
|
-
var input, region, resolvedEndpoint, request, signer, presignedRequest;
|
|
10
|
+
var input, region, resolvedEndpoint, regionInfo, request, signer, presignedRequest;
|
|
11
11
|
return __generator(this, function (_a) {
|
|
12
12
|
switch (_a.label) {
|
|
13
13
|
case 0:
|
|
14
14
|
input = args.input;
|
|
15
|
-
if (!!input.PresignedUrl) return [3,
|
|
15
|
+
if (!!input.PresignedUrl) return [3, 7];
|
|
16
16
|
return [4, options.region()];
|
|
17
17
|
case 1:
|
|
18
18
|
region = _a.sent();
|
|
19
19
|
return [4, options.endpoint()];
|
|
20
20
|
case 2:
|
|
21
21
|
resolvedEndpoint = _a.sent();
|
|
22
|
+
if (!(typeof options.regionInfoProvider === "function")) return [3, 4];
|
|
23
|
+
return [4, options.regionInfoProvider(input.SourceRegion)];
|
|
24
|
+
case 3:
|
|
25
|
+
regionInfo = _a.sent();
|
|
26
|
+
resolvedEndpoint.hostname = (regionInfo === null || regionInfo === void 0 ? void 0 : regionInfo.hostname) || "ec2.".concat(input.SourceRegion, ".amazonaws.com");
|
|
27
|
+
return [3, 5];
|
|
28
|
+
case 4:
|
|
22
29
|
resolvedEndpoint.hostname = "ec2.".concat(input.SourceRegion, ".amazonaws.com");
|
|
30
|
+
_a.label = 5;
|
|
31
|
+
case 5:
|
|
23
32
|
request = new HttpRequest(__assign(__assign({}, resolvedEndpoint), { protocol: "https", headers: {
|
|
24
33
|
host: resolvedEndpoint.hostname,
|
|
25
34
|
}, query: {
|
|
@@ -39,11 +48,11 @@ export function copySnapshotPresignedUrlMiddleware(options) {
|
|
|
39
48
|
return [4, signer.presign(request, {
|
|
40
49
|
expiresIn: 3600,
|
|
41
50
|
})];
|
|
42
|
-
case
|
|
51
|
+
case 6:
|
|
43
52
|
presignedRequest = _a.sent();
|
|
44
53
|
args = __assign(__assign({}, args), { input: __assign(__assign({}, args.input), { DestinationRegion: region, PresignedUrl: formatUrl(presignedRequest) }) });
|
|
45
|
-
_a.label =
|
|
46
|
-
case
|
|
54
|
+
_a.label = 7;
|
|
55
|
+
case 7: return [2, next(args)];
|
|
47
56
|
}
|
|
48
57
|
});
|
|
49
58
|
}); };
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Credentials, Endpoint, HashConstructor, InitializeHandlerOptions, InitializeMiddleware, MemoizedProvider, Pluggable, Provider } from "@aws-sdk/types";
|
|
1
|
+
import { Credentials, Endpoint, HashConstructor, InitializeHandlerOptions, InitializeMiddleware, MemoizedProvider, Pluggable, Provider, RegionInfoProvider } from "@aws-sdk/types";
|
|
2
2
|
interface PreviouslyResolved {
|
|
3
3
|
credentials: MemoizedProvider<Credentials>;
|
|
4
4
|
endpoint: Provider<Endpoint>;
|
|
5
5
|
region: Provider<string>;
|
|
6
6
|
sha256: HashConstructor;
|
|
7
7
|
signingEscapePath: boolean;
|
|
8
|
+
regionInfoProvider?: RegionInfoProvider;
|
|
8
9
|
}
|
|
9
10
|
export declare function copySnapshotPresignedUrlMiddleware(options: PreviouslyResolved): InitializeMiddleware<any, any>;
|
|
10
11
|
export declare const copySnapshotPresignedUrlMiddlewareOptions: InitializeHandlerOptions;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Credentials, Endpoint, HashConstructor, InitializeHandlerOptions, InitializeMiddleware, MemoizedProvider, Pluggable, Provider } from "@aws-sdk/types";
|
|
1
|
+
import { Credentials, Endpoint, HashConstructor, InitializeHandlerOptions, InitializeMiddleware, MemoizedProvider, Pluggable, Provider, RegionInfoProvider } from "@aws-sdk/types";
|
|
2
2
|
interface PreviouslyResolved {
|
|
3
3
|
credentials: MemoizedProvider<Credentials>;
|
|
4
4
|
endpoint: Provider<Endpoint>;
|
|
5
5
|
region: Provider<string>;
|
|
6
6
|
sha256: HashConstructor;
|
|
7
7
|
signingEscapePath: boolean;
|
|
8
|
+
regionInfoProvider?: RegionInfoProvider;
|
|
8
9
|
}
|
|
9
10
|
export declare function copySnapshotPresignedUrlMiddleware(options: PreviouslyResolved): InitializeMiddleware<any, any>;
|
|
10
11
|
export declare const copySnapshotPresignedUrlMiddlewareOptions: InitializeHandlerOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-ec2",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.110.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@aws-sdk/protocol-http": "3.
|
|
23
|
-
"@aws-sdk/signature-v4": "3.
|
|
24
|
-
"@aws-sdk/types": "3.
|
|
25
|
-
"@aws-sdk/util-format-url": "3.
|
|
22
|
+
"@aws-sdk/protocol-http": "3.110.0",
|
|
23
|
+
"@aws-sdk/signature-v4": "3.110.0",
|
|
24
|
+
"@aws-sdk/types": "3.110.0",
|
|
25
|
+
"@aws-sdk/util-format-url": "3.110.0",
|
|
26
26
|
"tslib": "^2.3.1"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|