@aws-sdk/ec2-metadata-service 3.572.0 → 3.574.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/dist-cjs/index.js CHANGED
@@ -74,8 +74,11 @@ var _MetadataService = class _MetadataService {
74
74
  this.disableFetchToken = (options == null ? void 0 : options.disableFetchToken) || false;
75
75
  }
76
76
  async request(path, options) {
77
- const { endpoint, ec2MetadataV1Disabled } = await this.config;
78
- const handler = new import_node_http_handler.NodeHttpHandler();
77
+ const { endpoint, ec2MetadataV1Disabled, httpOptions } = await this.config;
78
+ const handler = new import_node_http_handler.NodeHttpHandler({
79
+ requestTimeout: httpOptions == null ? void 0 : httpOptions.timeout,
80
+ connectionTimeout: httpOptions == null ? void 0 : httpOptions.timeout
81
+ });
79
82
  const endpointUrl = new URL(endpoint);
80
83
  const headers = options.headers || {};
81
84
  if (this.disableFetchToken && ec2MetadataV1Disabled) {
@@ -110,8 +113,11 @@ var _MetadataService = class _MetadataService {
110
113
  }
111
114
  }
112
115
  async fetchMetadataToken() {
113
- const { endpoint } = await this.config;
114
- const handler = new import_node_http_handler.NodeHttpHandler();
116
+ const { endpoint, httpOptions } = await this.config;
117
+ const handler = new import_node_http_handler.NodeHttpHandler({
118
+ requestTimeout: httpOptions == null ? void 0 : httpOptions.timeout,
119
+ connectionTimeout: httpOptions == null ? void 0 : httpOptions.timeout
120
+ });
115
121
  const endpointUrl = new URL(endpoint);
116
122
  const tokenRequest = new import_protocol_http.HttpRequest({
117
123
  method: "PUT",
@@ -18,8 +18,11 @@ export class MetadataService {
18
18
  this.disableFetchToken = options?.disableFetchToken || false;
19
19
  }
20
20
  async request(path, options) {
21
- const { endpoint, ec2MetadataV1Disabled } = await this.config;
22
- const handler = new NodeHttpHandler();
21
+ const { endpoint, ec2MetadataV1Disabled, httpOptions } = await this.config;
22
+ const handler = new NodeHttpHandler({
23
+ requestTimeout: httpOptions?.timeout,
24
+ connectionTimeout: httpOptions?.timeout,
25
+ });
23
26
  const endpointUrl = new URL(endpoint);
24
27
  const headers = options.headers || {};
25
28
  if (this.disableFetchToken && ec2MetadataV1Disabled) {
@@ -56,8 +59,11 @@ export class MetadataService {
56
59
  }
57
60
  }
58
61
  async fetchMetadataToken() {
59
- const { endpoint } = await this.config;
60
- const handler = new NodeHttpHandler();
62
+ const { endpoint, httpOptions } = await this.config;
63
+ const handler = new NodeHttpHandler({
64
+ requestTimeout: httpOptions?.timeout,
65
+ connectionTimeout: httpOptions?.timeout,
66
+ });
61
67
  const endpointUrl = new URL(endpoint);
62
68
  const tokenRequest = new HttpRequest({
63
69
  method: "PUT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/ec2-metadata-service",
3
- "version": "3.572.0",
3
+ "version": "3.574.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline ec2-metadata-service",
@@ -30,7 +30,7 @@
30
30
  "tslib": "^2.6.2"
31
31
  },
32
32
  "devDependencies": {
33
- "@aws-sdk/credential-providers": "3.572.0",
33
+ "@aws-sdk/credential-providers": "3.574.0",
34
34
  "@tsconfig/recommended": "1.0.1",
35
35
  "@types/node": "^16.18.96",
36
36
  "concurrently": "7.0.0",