@aws-sdk/client-network-firewall
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -6,2 +6,20 @@ # Change Log | ||
# [3.3.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.2.0...v3.3.0) (2021-01-14) | ||
### Bug Fixes | ||
* **clients:** export explicit dependencies on @aws-sdk/types ([#1902](https://github.com/aws/aws-sdk-js-v3/issues/1902)) ([96f1087](https://github.com/aws/aws-sdk-js-v3/commit/96f1087333ba916593d557051297983912b27caa)) | ||
* **clients:** lowercase all header names in serializer ([#1892](https://github.com/aws/aws-sdk-js-v3/issues/1892)) ([1308721](https://github.com/aws/aws-sdk-js-v3/commit/130872194bc94590f599051ee067d862210252f8)) | ||
* **url-parser:** merge browser and node url parser, add rn url parser ([#1903](https://github.com/aws/aws-sdk-js-v3/issues/1903)) ([99be092](https://github.com/aws/aws-sdk-js-v3/commit/99be092fded13bb00802549e17dbdb6d760a8679)) | ||
### Features | ||
* **clients:** update README with documentation, usage and more ([#1907](https://github.com/aws/aws-sdk-js-v3/issues/1907)) ([03be111](https://github.com/aws/aws-sdk-js-v3/commit/03be111a086360687f20b2ac1d490584fb4fbefe)) | ||
# [3.2.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.1.0...v3.2.0) (2021-01-09) | ||
@@ -8,0 +26,0 @@ |
{ | ||
"name": "@aws-sdk/client-network-firewall", | ||
"description": "AWS SDK for JavaScript Network Firewall Client for Node.js, Browser and React Native", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"scripts": { | ||
@@ -31,21 +31,22 @@ "clean": "yarn remove-definitions && yarn remove-dist && yarn remove-documentation", | ||
"@aws-crypto/sha256-js": "^1.0.0", | ||
"@aws-sdk/config-resolver": "3.2.0", | ||
"@aws-sdk/credential-provider-node": "3.1.0", | ||
"@aws-sdk/fetch-http-handler": "3.2.0", | ||
"@aws-sdk/hash-node": "3.1.0", | ||
"@aws-sdk/invalid-dependency": "3.2.0", | ||
"@aws-sdk/middleware-content-length": "3.2.0", | ||
"@aws-sdk/middleware-host-header": "3.2.0", | ||
"@aws-sdk/middleware-logger": "3.2.0", | ||
"@aws-sdk/middleware-retry": "3.2.0", | ||
"@aws-sdk/middleware-serde": "3.2.0", | ||
"@aws-sdk/middleware-signing": "3.2.0", | ||
"@aws-sdk/config-resolver": "3.3.0", | ||
"@aws-sdk/credential-provider-node": "3.3.0", | ||
"@aws-sdk/fetch-http-handler": "3.3.0", | ||
"@aws-sdk/hash-node": "3.3.0", | ||
"@aws-sdk/invalid-dependency": "3.3.0", | ||
"@aws-sdk/middleware-content-length": "3.3.0", | ||
"@aws-sdk/middleware-host-header": "3.3.0", | ||
"@aws-sdk/middleware-logger": "3.3.0", | ||
"@aws-sdk/middleware-retry": "3.3.0", | ||
"@aws-sdk/middleware-serde": "3.3.0", | ||
"@aws-sdk/middleware-signing": "3.3.0", | ||
"@aws-sdk/middleware-stack": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.2.0", | ||
"@aws-sdk/node-config-provider": "3.1.0", | ||
"@aws-sdk/node-http-handler": "3.2.0", | ||
"@aws-sdk/protocol-http": "3.2.0", | ||
"@aws-sdk/smithy-client": "3.2.0", | ||
"@aws-sdk/url-parser-browser": "3.1.0", | ||
"@aws-sdk/url-parser-node": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.3.0", | ||
"@aws-sdk/node-config-provider": "3.3.0", | ||
"@aws-sdk/node-http-handler": "3.3.0", | ||
"@aws-sdk/protocol-http": "3.3.0", | ||
"@aws-sdk/smithy-client": "3.3.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@aws-sdk/url-parser": "3.3.0", | ||
"@aws-sdk/url-parser-native": "3.3.0", | ||
"@aws-sdk/util-base64-browser": "3.1.0", | ||
@@ -55,4 +56,4 @@ "@aws-sdk/util-base64-node": "3.1.0", | ||
"@aws-sdk/util-body-length-node": "3.1.0", | ||
"@aws-sdk/util-user-agent-browser": "3.2.0", | ||
"@aws-sdk/util-user-agent-node": "3.2.0", | ||
"@aws-sdk/util-user-agent-browser": "3.3.0", | ||
"@aws-sdk/util-user-agent-node": "3.3.0", | ||
"@aws-sdk/util-utf8-browser": "3.1.0", | ||
@@ -64,3 +65,2 @@ "@aws-sdk/util-utf8-node": "3.1.0", | ||
"@aws-sdk/client-documentation-generator": "3.1.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@types/node": "^12.7.5", | ||
@@ -67,0 +67,0 @@ "jest": "^26.1.0", |
@@ -10,3 +10,2 @@ "use strict"; | ||
const middleware_retry_1 = require("@aws-sdk/middleware-retry"); | ||
const url_parser_browser_1 = require("@aws-sdk/url-parser-browser"); | ||
const util_base64_browser_1 = require("@aws-sdk/util-base64-browser"); | ||
@@ -36,3 +35,2 @@ const util_body_length_browser_1 = require("@aws-sdk/util-body-length-browser"); | ||
streamCollector: fetch_http_handler_1.streamCollector, | ||
urlParser: url_parser_browser_1.parseUrl, | ||
utf8Decoder: util_utf8_browser_1.fromUtf8, | ||
@@ -39,0 +37,0 @@ utf8Encoder: util_utf8_browser_1.toUtf8, |
@@ -12,3 +12,2 @@ "use strict"; | ||
const node_http_handler_1 = require("@aws-sdk/node-http-handler"); | ||
const url_parser_node_1 = require("@aws-sdk/url-parser-node"); | ||
const util_base64_node_1 = require("@aws-sdk/util-base64-node"); | ||
@@ -38,3 +37,2 @@ const util_body_length_node_1 = require("@aws-sdk/util-body-length-node"); | ||
streamCollector: node_http_handler_1.streamCollector, | ||
urlParser: url_parser_node_1.parseUrl, | ||
utf8Decoder: util_utf8_node_1.fromUtf8, | ||
@@ -41,0 +39,0 @@ utf8Encoder: util_utf8_node_1.toUtf8, |
@@ -5,3 +5,3 @@ "use strict"; | ||
const sha256_js_1 = require("@aws-crypto/sha256-js"); | ||
const url_parser_node_1 = require("@aws-sdk/url-parser-node"); | ||
const url_parser_native_1 = require("@aws-sdk/url-parser-native"); | ||
const runtimeConfig_browser_1 = require("./runtimeConfig.browser"); | ||
@@ -15,4 +15,4 @@ /** | ||
sha256: sha256_js_1.Sha256, | ||
urlParser: url_parser_node_1.parseUrl, | ||
urlParser: url_parser_native_1.parseUrl, | ||
}; | ||
//# sourceMappingURL=runtimeConfig.native.js.map |
@@ -5,2 +5,3 @@ "use strict"; | ||
const endpoints_1 = require("./endpoints"); | ||
const url_parser_1 = require("@aws-sdk/url-parser"); | ||
/** | ||
@@ -15,3 +16,4 @@ * @internal | ||
serviceId: "Network Firewall", | ||
urlParser: url_parser_1.parseUrl, | ||
}; | ||
//# sourceMappingURL=runtimeConfig.shared.js.map |
{ | ||
"name": "@aws-sdk/client-network-firewall", | ||
"description": "AWS SDK for JavaScript Network Firewall Client for Node.js, Browser and React Native", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"scripts": { | ||
@@ -31,21 +31,22 @@ "clean": "yarn remove-definitions && yarn remove-dist && yarn remove-documentation", | ||
"@aws-crypto/sha256-js": "^1.0.0", | ||
"@aws-sdk/config-resolver": "3.2.0", | ||
"@aws-sdk/credential-provider-node": "3.1.0", | ||
"@aws-sdk/fetch-http-handler": "3.2.0", | ||
"@aws-sdk/hash-node": "3.1.0", | ||
"@aws-sdk/invalid-dependency": "3.2.0", | ||
"@aws-sdk/middleware-content-length": "3.2.0", | ||
"@aws-sdk/middleware-host-header": "3.2.0", | ||
"@aws-sdk/middleware-logger": "3.2.0", | ||
"@aws-sdk/middleware-retry": "3.2.0", | ||
"@aws-sdk/middleware-serde": "3.2.0", | ||
"@aws-sdk/middleware-signing": "3.2.0", | ||
"@aws-sdk/config-resolver": "3.3.0", | ||
"@aws-sdk/credential-provider-node": "3.3.0", | ||
"@aws-sdk/fetch-http-handler": "3.3.0", | ||
"@aws-sdk/hash-node": "3.3.0", | ||
"@aws-sdk/invalid-dependency": "3.3.0", | ||
"@aws-sdk/middleware-content-length": "3.3.0", | ||
"@aws-sdk/middleware-host-header": "3.3.0", | ||
"@aws-sdk/middleware-logger": "3.3.0", | ||
"@aws-sdk/middleware-retry": "3.3.0", | ||
"@aws-sdk/middleware-serde": "3.3.0", | ||
"@aws-sdk/middleware-signing": "3.3.0", | ||
"@aws-sdk/middleware-stack": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.2.0", | ||
"@aws-sdk/node-config-provider": "3.1.0", | ||
"@aws-sdk/node-http-handler": "3.2.0", | ||
"@aws-sdk/protocol-http": "3.2.0", | ||
"@aws-sdk/smithy-client": "3.2.0", | ||
"@aws-sdk/url-parser-browser": "3.1.0", | ||
"@aws-sdk/url-parser-node": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.3.0", | ||
"@aws-sdk/node-config-provider": "3.3.0", | ||
"@aws-sdk/node-http-handler": "3.3.0", | ||
"@aws-sdk/protocol-http": "3.3.0", | ||
"@aws-sdk/smithy-client": "3.3.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@aws-sdk/url-parser": "3.3.0", | ||
"@aws-sdk/url-parser-native": "3.3.0", | ||
"@aws-sdk/util-base64-browser": "3.1.0", | ||
@@ -55,4 +56,4 @@ "@aws-sdk/util-base64-node": "3.1.0", | ||
"@aws-sdk/util-body-length-node": "3.1.0", | ||
"@aws-sdk/util-user-agent-browser": "3.2.0", | ||
"@aws-sdk/util-user-agent-node": "3.2.0", | ||
"@aws-sdk/util-user-agent-browser": "3.3.0", | ||
"@aws-sdk/util-user-agent-node": "3.3.0", | ||
"@aws-sdk/util-utf8-browser": "3.1.0", | ||
@@ -64,3 +65,2 @@ "@aws-sdk/util-utf8-node": "3.1.0", | ||
"@aws-sdk/client-documentation-generator": "3.1.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@types/node": "^12.7.5", | ||
@@ -67,0 +67,0 @@ "jest": "^26.1.0", |
@@ -7,3 +7,2 @@ import { __assign } from "tslib"; | ||
import { DEFAULT_MAX_ATTEMPTS } from "@aws-sdk/middleware-retry"; | ||
import { parseUrl } from "@aws-sdk/url-parser-browser"; | ||
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; | ||
@@ -20,3 +19,3 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; | ||
clientVersion: packageInfo.version, | ||
}), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidProvider("Region is missing"), requestHandler: new FetchHttpHandler(), sha256: Sha256, streamCollector: streamCollector, urlParser: parseUrl, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 }); | ||
}), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidProvider("Region is missing"), requestHandler: new FetchHttpHandler(), sha256: Sha256, streamCollector: streamCollector, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 }); | ||
//# sourceMappingURL=runtimeConfig.browser.js.map |
@@ -9,3 +9,2 @@ import { __assign } from "tslib"; | ||
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; | ||
import { parseUrl } from "@aws-sdk/url-parser-node"; | ||
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; | ||
@@ -22,3 +21,3 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; | ||
clientVersion: packageInfo.version, | ||
}), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), sha256: Hash.bind(null, "sha256"), streamCollector: streamCollector, urlParser: parseUrl, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 }); | ||
}), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), sha256: Hash.bind(null, "sha256"), streamCollector: streamCollector, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 }); | ||
//# sourceMappingURL=runtimeConfig.js.map |
import { __assign } from "tslib"; | ||
import { Sha256 } from "@aws-crypto/sha256-js"; | ||
import { parseUrl } from "@aws-sdk/url-parser-node"; | ||
import { parseUrl } from "@aws-sdk/url-parser-native"; | ||
import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser"; | ||
@@ -5,0 +5,0 @@ /** |
import { defaultRegionInfoProvider } from "./endpoints"; | ||
import { parseUrl } from "@aws-sdk/url-parser"; | ||
/** | ||
@@ -11,3 +12,4 @@ * @internal | ||
serviceId: "Network Firewall", | ||
urlParser: parseUrl, | ||
}; | ||
//# sourceMappingURL=runtimeConfig.shared.js.map |
{ | ||
"name": "@aws-sdk/client-network-firewall", | ||
"description": "AWS SDK for JavaScript Network Firewall Client for Node.js, Browser and React Native", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"scripts": { | ||
@@ -31,21 +31,22 @@ "clean": "yarn remove-definitions && yarn remove-dist && yarn remove-documentation", | ||
"@aws-crypto/sha256-js": "^1.0.0", | ||
"@aws-sdk/config-resolver": "3.2.0", | ||
"@aws-sdk/credential-provider-node": "3.1.0", | ||
"@aws-sdk/fetch-http-handler": "3.2.0", | ||
"@aws-sdk/hash-node": "3.1.0", | ||
"@aws-sdk/invalid-dependency": "3.2.0", | ||
"@aws-sdk/middleware-content-length": "3.2.0", | ||
"@aws-sdk/middleware-host-header": "3.2.0", | ||
"@aws-sdk/middleware-logger": "3.2.0", | ||
"@aws-sdk/middleware-retry": "3.2.0", | ||
"@aws-sdk/middleware-serde": "3.2.0", | ||
"@aws-sdk/middleware-signing": "3.2.0", | ||
"@aws-sdk/config-resolver": "3.3.0", | ||
"@aws-sdk/credential-provider-node": "3.3.0", | ||
"@aws-sdk/fetch-http-handler": "3.3.0", | ||
"@aws-sdk/hash-node": "3.3.0", | ||
"@aws-sdk/invalid-dependency": "3.3.0", | ||
"@aws-sdk/middleware-content-length": "3.3.0", | ||
"@aws-sdk/middleware-host-header": "3.3.0", | ||
"@aws-sdk/middleware-logger": "3.3.0", | ||
"@aws-sdk/middleware-retry": "3.3.0", | ||
"@aws-sdk/middleware-serde": "3.3.0", | ||
"@aws-sdk/middleware-signing": "3.3.0", | ||
"@aws-sdk/middleware-stack": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.2.0", | ||
"@aws-sdk/node-config-provider": "3.1.0", | ||
"@aws-sdk/node-http-handler": "3.2.0", | ||
"@aws-sdk/protocol-http": "3.2.0", | ||
"@aws-sdk/smithy-client": "3.2.0", | ||
"@aws-sdk/url-parser-browser": "3.1.0", | ||
"@aws-sdk/url-parser-node": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.3.0", | ||
"@aws-sdk/node-config-provider": "3.3.0", | ||
"@aws-sdk/node-http-handler": "3.3.0", | ||
"@aws-sdk/protocol-http": "3.3.0", | ||
"@aws-sdk/smithy-client": "3.3.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@aws-sdk/url-parser": "3.3.0", | ||
"@aws-sdk/url-parser-native": "3.3.0", | ||
"@aws-sdk/util-base64-browser": "3.1.0", | ||
@@ -55,4 +56,4 @@ "@aws-sdk/util-base64-node": "3.1.0", | ||
"@aws-sdk/util-body-length-node": "3.1.0", | ||
"@aws-sdk/util-user-agent-browser": "3.2.0", | ||
"@aws-sdk/util-user-agent-node": "3.2.0", | ||
"@aws-sdk/util-user-agent-browser": "3.3.0", | ||
"@aws-sdk/util-user-agent-node": "3.3.0", | ||
"@aws-sdk/util-utf8-browser": "3.1.0", | ||
@@ -64,3 +65,2 @@ "@aws-sdk/util-utf8-node": "3.1.0", | ||
"@aws-sdk/client-documentation-generator": "3.1.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@types/node": "^12.7.5", | ||
@@ -67,0 +67,0 @@ "jest": "^26.1.0", |
278
README.md
@@ -6,2 +6,278 @@ # @aws-sdk/client-network-firewall | ||
For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). | ||
## Description | ||
AWS SDK for JavaScript NetworkFirewall Client for Node.js, Browser and React Native. | ||
<p>This is the API Reference for AWS Network Firewall. This guide is for developers who need | ||
detailed information about the Network Firewall API actions, data types, and errors. </p> | ||
<ul> | ||
<li> | ||
<p>The REST API requires you to handle connection details, such as calculating | ||
signatures, handling request retries, and error handling. For general information | ||
about using the AWS REST APIs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-apis.html">AWS APIs</a>. </p> | ||
<p>To access Network Firewall using the REST API endpoint: | ||
<code>https://network-firewall.<region>.amazonaws.com </code> | ||
</p> | ||
</li> | ||
<li> | ||
<p>Alternatively, you can use one of the AWS SDKs to access an API that's tailored to | ||
the programming language or platform that you're using. For more information, see | ||
<a href="http://aws.amazon.com/tools/#SDKs">AWS SDKs</a>.</p> | ||
</li> | ||
<li> | ||
<p>For descriptions of Network Firewall features, including and step-by-step | ||
instructions on how to use them through the Network Firewall console, see the <a href="https://docs.aws.amazon.com/network-firewall/latest/developerguide/">Network Firewall Developer | ||
Guide</a>.</p> | ||
</li> | ||
</ul> | ||
<p>Network Firewall is a stateful, managed, network firewall and intrusion detection and | ||
prevention service for Amazon Virtual Private Cloud (Amazon VPC). With Network Firewall, you can filter traffic at the | ||
perimeter of your VPC. This includes filtering traffic going to and coming from an internet | ||
gateway, NAT gateway, or over VPN or AWS Direct Connect. Network Firewall uses rules that are compatible | ||
with Suricata, a free, open source intrusion detection system (IDS) engine. For information about Suricata, | ||
see the <a href="https://suricata-ids.org/">Suricata website</a>.</p> | ||
<p>You can use Network Firewall to monitor and protect your VPC traffic in a number of ways. | ||
The following are just a few examples: </p> | ||
<ul> | ||
<li> | ||
<p>Allow domains or IP addresses for known AWS service endpoints, such as Amazon S3, and | ||
block all other forms of traffic.</p> | ||
</li> | ||
<li> | ||
<p>Use custom lists of known bad domains to limit the types of domain names that your | ||
applications can access.</p> | ||
</li> | ||
<li> | ||
<p>Perform deep packet inspection on traffic entering or leaving your VPC.</p> | ||
</li> | ||
<li> | ||
<p>Rate limit traffic going from AWS to on-premises IP destinations.</p> | ||
</li> | ||
<li> | ||
<p>Use stateful protocol detection to filter protocols like HTTPS, regardless of the | ||
port used.</p> | ||
</li> | ||
</ul> | ||
<p>To enable Network Firewall for your VPCs, you perform steps in both Amazon VPC and in | ||
Network Firewall. For information about using Amazon VPC, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/">Amazon VPC User Guide</a>.</p> | ||
<p>To start using Network Firewall, do the following: </p> | ||
<ol> | ||
<li> | ||
<p>(Optional) If you don't already have a VPC that you want to protect, create it in | ||
Amazon VPC. </p> | ||
</li> | ||
<li> | ||
<p>In Amazon VPC, in each Availability Zone where you want to have a firewall endpoint, create a | ||
subnet for the sole use of Network Firewall. </p> | ||
</li> | ||
<li> | ||
<p>In Network Firewall, create stateless and stateful rule groups, | ||
to define the components of the network traffic filtering behavior that you want your firewall to have. </p> | ||
</li> | ||
<li> | ||
<p>In Network Firewall, create a firewall policy that uses your rule groups and | ||
specifies additional default traffic filtering behavior. </p> | ||
</li> | ||
<li> | ||
<p>In Network Firewall, create a firewall and specify your new firewall policy and | ||
VPC subnets. Network Firewall creates a firewall endpoint in each subnet that you | ||
specify, with the behavior that's defined in the firewall policy.</p> | ||
</li> | ||
<li> | ||
<p>In Amazon VPC, use ingress routing enhancements to route traffic through the new firewall | ||
endpoints.</p> | ||
</li> | ||
</ol> | ||
## Installing | ||
To install the this package, simply type add or install @aws-sdk/client-network-firewall | ||
using your favorite package manager: | ||
- `npm install @aws-sdk/client-network-firewall` | ||
- `yarn add @aws-sdk/client-network-firewall` | ||
- `pnpm add @aws-sdk/client-network-firewall` | ||
## Getting Started | ||
### Import | ||
The AWS SDK is modulized by clients and commands. | ||
To send a request, you only need to import the `NetworkFirewallClient` and | ||
the commands you need, for example `AssociateFirewallPolicyCommand`: | ||
```js | ||
// ES5 example | ||
const { NetworkFirewallClient, AssociateFirewallPolicyCommand } = require("@aws-sdk/client-network-firewall"); | ||
``` | ||
```ts | ||
// ES6+ example | ||
import { NetworkFirewallClient, AssociateFirewallPolicyCommand } from "@aws-sdk/client-network-firewall"; | ||
``` | ||
### Usage | ||
To send a request, you: | ||
- Initiate client with configuration (e.g. credentials, region). | ||
- Initiate command with input parameters. | ||
- Call `send` operation on client with command object as input. | ||
- If you are using a custom http handler, you may call `destroy()` to close open connections. | ||
```js | ||
// a client can be shared by difference commands. | ||
const client = new NetworkFirewallClient({ region: "REGION" }); | ||
const params = { | ||
/** input parameters */ | ||
}; | ||
const command = new AssociateFirewallPolicyCommand(params); | ||
``` | ||
#### Async/await | ||
We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) | ||
operator to wait for the promise returned by send operation as follows: | ||
```js | ||
// async/await. | ||
try { | ||
const data = await client.send(command); | ||
// process data. | ||
} catch (error) { | ||
// error handling. | ||
} finally { | ||
// finally. | ||
} | ||
``` | ||
Async-await is clean, concise, intuitive, easy to debug and has better error handling | ||
as compared to using Promise chains or callbacks. | ||
#### Promises | ||
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) | ||
to execute send operation. | ||
```js | ||
client.send(command).then( | ||
(data) => { | ||
// process data. | ||
}, | ||
(error) => { | ||
// error handling. | ||
} | ||
); | ||
``` | ||
Promises can also be called using `.catch()` and `.finally()` as follows: | ||
```js | ||
client | ||
.send(command) | ||
.then((data) => { | ||
// process data. | ||
}) | ||
.catch((error) => { | ||
// error handling. | ||
}) | ||
.finally(() => { | ||
// finally. | ||
}); | ||
``` | ||
#### Callbacks | ||
We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), | ||
but they are supported by the send operation. | ||
```js | ||
// callbacks. | ||
client.send(command, (err, data) => { | ||
// proccess err and data. | ||
}); | ||
``` | ||
#### v2 compatible style | ||
The client can also send requests using v2 compatible style. | ||
However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post | ||
on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) | ||
```ts | ||
import * as AWS from "@aws-sdk/client-network-firewall"; | ||
const client = new AWS.NetworkFirewall({ region: "REGION" }); | ||
// async/await. | ||
try { | ||
const data = client.associateFirewallPolicy(params); | ||
// process data. | ||
} catch (error) { | ||
// error handling. | ||
} | ||
// Promises. | ||
client | ||
.associateFirewallPolicy(params) | ||
.then((data) => { | ||
// process data. | ||
}) | ||
.catch((error) => { | ||
// error handling. | ||
}); | ||
// callbacks. | ||
client.associateFirewallPolicy(params, (err, data) => { | ||
// proccess err and data. | ||
}); | ||
``` | ||
### Troubleshooting | ||
When the service returns an exception, the error will include the exception information, | ||
as well as response metadata (e.g. request id). | ||
```js | ||
try { | ||
const data = await client.send(command); | ||
// process data. | ||
} catch (error) { | ||
const { requestId, cfId, extendedRequestId } = error.$metadata; | ||
console.log({ requestId, cfId, extendedRequestId }); | ||
/** | ||
* The keys within exceptions are also parsed. | ||
* You can access them by specifying exception names: | ||
* if (error.name === 'SomeServiceException') { | ||
* const value = error.specialKeyInException; | ||
* } | ||
*/ | ||
} | ||
``` | ||
## Getting Help | ||
Please use these community resources for getting help. | ||
We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. | ||
- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) | ||
or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). | ||
- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) | ||
on AWS Developer Blog. | ||
- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. | ||
- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). | ||
- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). | ||
To test your universal JavaScript code in Node.js, browser and react-native environments, | ||
visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). | ||
## Contributing | ||
This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-network-firewall` package is updated. | ||
To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). | ||
## License | ||
This SDK is distributed under the | ||
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), | ||
see LICENSE for more information. |
@@ -7,3 +7,2 @@ import packageInfo from "./package.json"; | ||
import { DEFAULT_MAX_ATTEMPTS } from "@aws-sdk/middleware-retry"; | ||
import { parseUrl } from "@aws-sdk/url-parser-browser"; | ||
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; | ||
@@ -35,5 +34,4 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; | ||
streamCollector, | ||
urlParser: parseUrl, | ||
utf8Decoder: fromUtf8, | ||
utf8Encoder: toUtf8, | ||
}; |
import { Sha256 } from "@aws-crypto/sha256-js"; | ||
import { parseUrl } from "@aws-sdk/url-parser-node"; | ||
import { parseUrl } from "@aws-sdk/url-parser-native"; | ||
import { ClientDefaults } from "./NetworkFirewallClient"; | ||
@@ -4,0 +4,0 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser"; |
import { defaultRegionInfoProvider } from "./endpoints"; | ||
import { Logger as __Logger } from "@aws-sdk/types"; | ||
import { parseUrl } from "@aws-sdk/url-parser"; | ||
@@ -13,2 +14,3 @@ /** | ||
serviceId: "Network Firewall", | ||
urlParser: parseUrl, | ||
}; |
@@ -9,3 +9,2 @@ import packageInfo from "./package.json"; | ||
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; | ||
import { parseUrl } from "@aws-sdk/url-parser-node"; | ||
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; | ||
@@ -37,5 +36,4 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; | ||
streamCollector, | ||
urlParser: parseUrl, | ||
utf8Decoder: fromUtf8, | ||
utf8Encoder: toUtf8, | ||
}; |
@@ -11,2 +11,3 @@ import { Logger as __Logger } from "@aws-sdk/types"; | ||
serviceId: string; | ||
urlParser: import("@aws-sdk/types").UrlParser; | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2066678
6
283
31
31874
+ Added@aws-sdk/types@3.1.0
+ Added@aws-sdk/url-parser@3.3.0
+ Added@aws-sdk/abort-controller@3.3.0(transitive)
+ Added@aws-sdk/config-resolver@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-env@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-imds@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-ini@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-node@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-process@3.3.0(transitive)
+ Added@aws-sdk/fetch-http-handler@3.3.0(transitive)
+ Added@aws-sdk/hash-node@3.3.0(transitive)
+ Added@aws-sdk/invalid-dependency@3.3.0(transitive)
+ Added@aws-sdk/middleware-content-length@3.3.0(transitive)
+ Added@aws-sdk/middleware-host-header@3.3.0(transitive)
+ Added@aws-sdk/middleware-logger@3.3.0(transitive)
+ Added@aws-sdk/middleware-retry@3.3.0(transitive)
+ Added@aws-sdk/middleware-serde@3.3.0(transitive)
+ Added@aws-sdk/middleware-signing@3.3.0(transitive)
+ Added@aws-sdk/middleware-user-agent@3.3.0(transitive)
+ Added@aws-sdk/node-config-provider@3.3.0(transitive)
+ Added@aws-sdk/node-http-handler@3.3.0(transitive)
+ Added@aws-sdk/property-provider@3.3.0(transitive)
+ Added@aws-sdk/protocol-http@3.3.0(transitive)
+ Added@aws-sdk/querystring-builder@3.3.0(transitive)
+ Added@aws-sdk/querystring-parser@3.3.0(transitive)
+ Added@aws-sdk/service-error-classification@3.3.0(transitive)
+ Added@aws-sdk/signature-v4@3.3.0(transitive)
+ Added@aws-sdk/smithy-client@3.3.0(transitive)
+ Added@aws-sdk/types@3.1.0(transitive)
+ Added@aws-sdk/url-parser@3.3.0(transitive)
+ Added@aws-sdk/url-parser-native@3.3.0(transitive)
+ Added@aws-sdk/util-user-agent-browser@3.3.0(transitive)
+ Added@aws-sdk/util-user-agent-node@3.3.0(transitive)
- Removed@aws-sdk/url-parser-browser@3.1.0
- Removed@aws-sdk/url-parser-node@3.1.0
- Removed@aws-sdk/abort-controller@3.1.0(transitive)
- Removed@aws-sdk/config-resolver@3.2.0(transitive)
- Removed@aws-sdk/credential-provider-env@3.1.0(transitive)
- Removed@aws-sdk/credential-provider-imds@3.1.0(transitive)
- Removed@aws-sdk/credential-provider-ini@3.1.0(transitive)
- Removed@aws-sdk/credential-provider-node@3.1.0(transitive)
- Removed@aws-sdk/credential-provider-process@3.1.0(transitive)
- Removed@aws-sdk/fetch-http-handler@3.2.0(transitive)
- Removed@aws-sdk/hash-node@3.1.0(transitive)
- Removed@aws-sdk/invalid-dependency@3.2.0(transitive)
- Removed@aws-sdk/middleware-content-length@3.2.0(transitive)
- Removed@aws-sdk/middleware-host-header@3.2.0(transitive)
- Removed@aws-sdk/middleware-logger@3.2.0(transitive)
- Removed@aws-sdk/middleware-retry@3.2.0(transitive)
- Removed@aws-sdk/middleware-serde@3.2.0(transitive)
- Removed@aws-sdk/middleware-signing@3.2.0(transitive)
- Removed@aws-sdk/middleware-user-agent@3.2.0(transitive)
- Removed@aws-sdk/node-config-provider@3.1.0(transitive)
- Removed@aws-sdk/node-http-handler@3.2.0(transitive)
- Removed@aws-sdk/property-provider@3.1.0(transitive)
- Removed@aws-sdk/protocol-http@3.2.0(transitive)
- Removed@aws-sdk/querystring-builder@3.1.0(transitive)
- Removed@aws-sdk/querystring-parser@3.1.0(transitive)
- Removed@aws-sdk/service-error-classification@3.2.0(transitive)
- Removed@aws-sdk/signature-v4@3.2.0(transitive)
- Removed@aws-sdk/smithy-client@3.2.0(transitive)
- Removed@aws-sdk/types@3.709.0(transitive)
- Removed@aws-sdk/url-parser-browser@3.1.0(transitive)
- Removed@aws-sdk/url-parser-node@3.1.0(transitive)
- Removed@aws-sdk/util-user-agent-browser@3.2.0(transitive)
- Removed@aws-sdk/util-user-agent-node@3.2.0(transitive)
- Removed@smithy/types@3.7.2(transitive)
Updated@aws-sdk/hash-node@3.3.0
Updated@aws-sdk/protocol-http@3.3.0
Updated@aws-sdk/smithy-client@3.3.0