@zio.dev/zio-aws 2022.12.6-1bdf5afb00a4 → 2025.2.9-b21c83b3708b
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/aspects.md +2 -2
- package/changelog.md +6 -0
- package/configuration.md +20 -36
- package/http.md +335 -82
- package/index.md +158 -3
- package/package.json +1 -1
- package/sidebars.js +16 -9
package/aspects.md
CHANGED
|
@@ -37,9 +37,9 @@ val callLogging: AwsCallAspect[Any] =
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
// callLogging: AwsCallAspect[Any] = repl.MdocSession$MdocApp$$anon$1@
|
|
40
|
+
// callLogging: AwsCallAspect[Any] = repl.MdocSession$MdocApp$$anon$1@32bd44bb
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
This aspect can attached to a _client layer_ with the
|
|
43
|
+
This aspect can attached to a _client layer_ with the `@@@` operator. Multiple aspects can be composed with `>>>`.
|
|
44
44
|
|
|
45
45
|
To see a full example, check [example #2](https://github.com/vigoo/zio-aws/blob/master/examples/example2/src/main/scala/Main.scala).
|
package/changelog.md
CHANGED
|
@@ -8,6 +8,12 @@ title: Changelog
|
|
|
8
8
|
Note: this is a manually maintained list of important changes. Because of having auto-release from CI, this
|
|
9
9
|
list may not reflect _all_ changes immediately. Dependencies are continuously updated and are not documented here.
|
|
10
10
|
|
|
11
|
+
#### 7.x.x.x
|
|
12
|
+
- ZIO 2.0.18 introduced a `ZLayerAspect` which uses the same operator (`@@`) that ZIO AWS was using on layers, but it is not powerful enough to express this library's aspects. The new operator conflicts with the existing extension method, so starting from this version it has been renamed from `@@` to `@@@` to avoid the conflict.
|
|
13
|
+
|
|
14
|
+
#### 6.x.x.x
|
|
15
|
+
- Using the new ZIO config providers, compatible with ZIO Config 4.x.x
|
|
16
|
+
|
|
11
17
|
#### 5.x.x.x
|
|
12
18
|
- Migrated to `ZIO 2.0.0`
|
|
13
19
|
- Moved to the ZIO organisation
|
package/configuration.md
CHANGED
|
@@ -37,51 +37,35 @@ specific configuration which is described [on the page about the HTTP engines](h
|
|
|
37
37
|
|
|
38
38
|
### Field Descriptions
|
|
39
39
|
|
|
40
|
-
|FieldName
|
|
41
|
-
|---
|
|
42
|
-
|region
|
|
43
|
-
|
|
|
44
|
-
|endpointOverride
|
|
45
|
-
|[client](client)
|
|
46
|
-
|
|
47
|
-
### credentials
|
|
48
|
-
|
|
49
|
-
|FieldName|Format |Description |Sources|
|
|
50
|
-
|--- |--- |--- |--- |
|
|
51
|
-
| |primitive |value of type string| |
|
|
52
|
-
| |primitive |value of type string| |
|
|
53
|
-
| |primitive |value of type string| |
|
|
54
|
-
| |[all-of](fielddescriptions-1)| | |
|
|
40
|
+
|FieldName |Format |Description |Sources|
|
|
41
|
+
|--- |--- |--- |--- |
|
|
42
|
+
|region |primitive |a text property, AWS region to connect to | |
|
|
43
|
+
| |[any-one-of](fielddescriptions-1)| | |
|
|
44
|
+
|endpointOverride|primitive |a text property, Overrides the AWS service endpoint| |
|
|
45
|
+
|[client](client)|[all-of](client) |Common settings for AWS service clients | |
|
|
55
46
|
|
|
56
47
|
### Field Descriptions
|
|
57
48
|
|
|
58
|
-
|FieldName
|
|
59
|
-
|---
|
|
60
|
-
|
|
|
61
|
-
|
|
|
49
|
+
|FieldName|Format |Description |Sources|
|
|
50
|
+
|--- |--- |--- |--- |
|
|
51
|
+
|type |map |a text property, AWS credentials provider | |
|
|
52
|
+
| |primitive|a constant property, AWS credentials provider| |
|
|
62
53
|
|
|
63
54
|
### client
|
|
64
55
|
|
|
65
|
-
|FieldName |Format |Description
|
|
66
|
-
|--- |--- |---
|
|
67
|
-
|[extraHeaders](extraheaders)|[list](extraheaders)|Extra headers to be sent with each request
|
|
68
|
-
|apiCallTimeout |primitive |
|
|
69
|
-
|apiCallAttemptTimeout |primitive |
|
|
70
|
-
|defaultProfileName |primitive |
|
|
56
|
+
|FieldName |Format |Description |Sources|
|
|
57
|
+
|--- |--- |--- |--- |
|
|
58
|
+
|[extraHeaders](extraheaders)|[list](extraheaders)|Extra headers to be sent with each request | |
|
|
59
|
+
|apiCallTimeout |primitive |a duration property, Amount of time to allow the client to complete the execution of an API call| |
|
|
60
|
+
|apiCallAttemptTimeout |primitive |a duration property, Amount of time to wait for the HTTP request to complete before giving up | |
|
|
61
|
+
|defaultProfileName |primitive |a text property, Default profile name | |
|
|
71
62
|
|
|
72
63
|
### extraHeaders
|
|
73
64
|
|
|
74
|
-
|FieldName|Format
|
|
75
|
-
|--- |---
|
|
76
|
-
|name |primitive
|
|
77
|
-
|
|
|
78
|
-
|
|
79
|
-
### Field Descriptions
|
|
80
|
-
|
|
81
|
-
|FieldName|Format |Description |Sources|
|
|
82
|
-
|--- |--- |--- |--- |
|
|
83
|
-
|value |list |value of type string, Header value| |
|
|
84
|
-
|value |primitive|value of type string, Header value| |
|
|
65
|
+
|FieldName|Format |Description |Sources|
|
|
66
|
+
|--- |--- |--- |--- |
|
|
67
|
+
|name |primitive|a text property, Header name | |
|
|
68
|
+
|value |list |a text property, Header value| |
|
|
85
69
|
|
|
86
70
|
|
|
87
71
|
## Service layer
|
package/http.md
CHANGED
|
@@ -6,17 +6,18 @@ title: HTTP
|
|
|
6
6
|
# HTTP implementations
|
|
7
7
|
|
|
8
8
|
By default the AWS Java SDK uses _netty_ under the hood to make the HTTP client calls. `zio-aws` defines the http client
|
|
9
|
-
as a _layer_ (`HttpClient`) that has to be provided to the _AWS configuration layer_.
|
|
10
|
-
|
|
9
|
+
as a _layer_ (`HttpClient`) that has to be provided to the _AWS configuration layer_.
|
|
10
|
+
|
|
11
11
|
Currently the following implementations can be used:
|
|
12
|
-
- `zio-aws-netty` contains the default netty implementation packed as a layer
|
|
12
|
+
- `zio-aws-netty` contains the default netty implementation packed as a layer
|
|
13
13
|
- `zio-aws-akka-http` is based on Matthias Lüneberg's [aws-spi-akka-http library](https://github.com/matsluni/aws-spi-akka-http)
|
|
14
14
|
- `zio-aws-http4s` is an implementation on top of _http4s_
|
|
15
|
+
- `zio-aws-crt-http` is an implementation on top of the _AWS Common Runtime_ (CRT) HTTP client
|
|
15
16
|
|
|
16
17
|
## Netty
|
|
17
18
|
The default HTTP implementation in the AWS Java SDK is _Netty_. To use it with the default settings, use the `netty.default`
|
|
18
|
-
layer to provide the `HttpClient` for the `AwsConfig` layer. It is also possible to customize the `NettyNioAsyncHttpClient`
|
|
19
|
-
directly by manipulation it's `Builder`, by using the `netty.customized(customization)` layer.
|
|
19
|
+
layer to provide the `HttpClient` for the `AwsConfig` layer. It is also possible to customize the `NettyNioAsyncHttpClient`
|
|
20
|
+
directly by manipulation it's `Builder`, by using the `netty.customized(customization)` layer.
|
|
20
21
|
|
|
21
22
|
The recommended way for configuration is to use the zio-config support:
|
|
22
23
|
|
|
@@ -40,67 +41,165 @@ See the following table for all the options:
|
|
|
40
41
|
|
|
41
42
|
### Field Descriptions
|
|
42
43
|
|
|
43
|
-
|FieldName
|
|
44
|
-
|---
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|sslProvider
|
|
57
|
-
|[proxy](proxy)
|
|
58
|
-
|[http2](http2)
|
|
44
|
+
|FieldName |Format |Description |Sources|
|
|
45
|
+
|--- |--- |--- |--- |
|
|
46
|
+
| |[any-one-of](fielddescriptions-11)| | |
|
|
47
|
+
| |[any-one-of](fielddescriptions-10)| | |
|
|
48
|
+
| |[any-one-of](fielddescriptions-9) | | |
|
|
49
|
+
| |[any-one-of](fielddescriptions-8) | | |
|
|
50
|
+
| |[any-one-of](fielddescriptions-7) | | |
|
|
51
|
+
| |[any-one-of](fielddescriptions-6) | | |
|
|
52
|
+
| |[any-one-of](fielddescriptions-5) | | |
|
|
53
|
+
| |[any-one-of](fielddescriptions-4) | | |
|
|
54
|
+
| |[any-one-of](fielddescriptions-3) | | |
|
|
55
|
+
| |[any-one-of](fielddescriptions-2) | | |
|
|
56
|
+
| |[any-one-of](fielddescriptions-1) | | |
|
|
57
|
+
|sslProvider |primitive |a text property, The SSL provider to be used| |
|
|
58
|
+
|[proxy](proxy)|[all-of](proxy) |Proxy configuration | |
|
|
59
|
+
|[http2](http2)|[all-of](http2) |HTTP/2 specific options | |
|
|
60
|
+
|
|
61
|
+
### Field Descriptions
|
|
62
|
+
|
|
63
|
+
|FieldName |Format |Description |Sources|
|
|
64
|
+
|--- |--- |--- |--- |
|
|
65
|
+
|maxConcurrency|primitive|an integer property, Maximum number of allowed concurrent requests| |
|
|
66
|
+
| |primitive|a constant property, Maximum number of allowed concurrent requests| |
|
|
67
|
+
|
|
68
|
+
### Field Descriptions
|
|
69
|
+
|
|
70
|
+
|FieldName |Format |Description |Sources|
|
|
71
|
+
|--- |--- |--- |--- |
|
|
72
|
+
|maxPendingConnectionAcquires|primitive|an integer property, The maximum number of pending acquires allowed| |
|
|
73
|
+
| |primitive|a constant property, The maximum number of pending acquires allowed| |
|
|
74
|
+
|
|
75
|
+
### Field Descriptions
|
|
76
|
+
|
|
77
|
+
|FieldName |Format |Description |Sources|
|
|
78
|
+
|--- |--- |--- |--- |
|
|
79
|
+
|readTimeout|primitive|a duration property, The amount of time to wait for a read on a socket| |
|
|
80
|
+
| |primitive|a constant property, The amount of time to wait for a read on a socket| |
|
|
81
|
+
|
|
82
|
+
### Field Descriptions
|
|
83
|
+
|
|
84
|
+
|FieldName |Format |Description |Sources|
|
|
85
|
+
|--- |--- |--- |--- |
|
|
86
|
+
|writeTimeout|primitive|a duration property, The amount of time to wait for a write on a socket| |
|
|
87
|
+
| |primitive|a constant property, The amount of time to wait for a write on a socket| |
|
|
88
|
+
|
|
89
|
+
### Field Descriptions
|
|
90
|
+
|
|
91
|
+
|FieldName |Format |Description |Sources|
|
|
92
|
+
|--- |--- |--- |--- |
|
|
93
|
+
|connectionTimeout|primitive|a duration property, The amount of time to wait when initially establishing a connection before giving up| |
|
|
94
|
+
| |primitive|a constant property, The amount of time to wait when initially establishing a connection before giving up| |
|
|
95
|
+
|
|
96
|
+
### Field Descriptions
|
|
97
|
+
|
|
98
|
+
|FieldName |Format |Description |Sources|
|
|
99
|
+
|--- |--- |--- |--- |
|
|
100
|
+
|connectionAcquisitionTimeout|primitive|a duration property, The amount of time to wait when acquiring a connection from the pool before giving up| |
|
|
101
|
+
| |primitive|a constant property, The amount of time to wait when acquiring a connection from the pool before giving up| |
|
|
102
|
+
|
|
103
|
+
### Field Descriptions
|
|
104
|
+
|
|
105
|
+
|FieldName |Format |Description |Sources|
|
|
106
|
+
|--- |--- |--- |--- |
|
|
107
|
+
|connectionTimeToLive|primitive|a duration property, The maximum amount of time that a connection should be allowed to remain open, regardless of usage frequency| |
|
|
108
|
+
| |primitive|a constant property, The maximum amount of time that a connection should be allowed to remain open, regardless of usage frequency| |
|
|
109
|
+
|
|
110
|
+
### Field Descriptions
|
|
111
|
+
|
|
112
|
+
|FieldName |Format |Description |Sources|
|
|
113
|
+
|--- |--- |--- |--- |
|
|
114
|
+
|connectionMaxIdleTime|primitive|a duration property, Maximum amount of time that a connection should be allowed to remain open while idle| |
|
|
115
|
+
| |primitive|a constant property, Maximum amount of time that a connection should be allowed to remain open while idle| |
|
|
116
|
+
|
|
117
|
+
### Field Descriptions
|
|
118
|
+
|
|
119
|
+
|FieldName |Format |Description |Sources|
|
|
120
|
+
|--- |--- |--- |--- |
|
|
121
|
+
|useIdleConnectionReaper|primitive|a boolean property, If true, the idle connections in the pool should be closed | |
|
|
122
|
+
| |primitive|a constant property, If true, the idle connections in the pool should be closed| |
|
|
123
|
+
|
|
124
|
+
### Field Descriptions
|
|
125
|
+
|
|
126
|
+
|FieldName|Format |Description |Sources|
|
|
127
|
+
|--- |--- |--- |--- |
|
|
128
|
+
|protocol |primitive|a text property, HTTP/1.1 or HTTP/2 or Dual | |
|
|
129
|
+
| |primitive|a constant property, HTTP/1.1 or HTTP/2 or Dual| |
|
|
130
|
+
|
|
131
|
+
### Field Descriptions
|
|
132
|
+
|
|
133
|
+
|FieldName |Format |Description |Sources|
|
|
134
|
+
|--- |--- |--- |--- |
|
|
135
|
+
|[channelOptions](channeloptions)|[all-of](channeloptions)|Custom Netty channel options | |
|
|
136
|
+
| |primitive |a constant property, Custom Netty channel options| |
|
|
59
137
|
|
|
60
138
|
### channelOptions
|
|
61
139
|
|
|
62
|
-
|FieldName |Format |Description
|
|
63
|
-
|--- |--- |---
|
|
64
|
-
|SO_BROADCAST |primitive|
|
|
65
|
-
|SO_KEEPALIVE |primitive|
|
|
66
|
-
|SO_SNDBUF |primitive|
|
|
67
|
-
|SO_RCVBUF |primitive|
|
|
68
|
-
|SO_REUSEADDR |primitive|
|
|
69
|
-
|SO_LINGER |primitive|
|
|
70
|
-
|IP_TOS |primitive|
|
|
71
|
-
|IP_MULTICAST_IF |primitive|
|
|
72
|
-
|IP_MULTICAST_TTL |primitive|
|
|
73
|
-
|IP_MULTICAST_LOOP |primitive|
|
|
74
|
-
|TCP_NODELAY |primitive|
|
|
75
|
-
|CONNECT_TIMEOUT_MILLIS |primitive|
|
|
76
|
-
|WRITE_SPIN_COUNT |primitive|
|
|
77
|
-
|ALLOW_HALF_CLOSURE |primitive|
|
|
78
|
-
|AUTO_READ |primitive|
|
|
79
|
-
|AUTO_CLOSE |primitive|
|
|
80
|
-
|SINGLE_EVENTEXECUTOR_PER_GROUP|primitive|
|
|
140
|
+
|FieldName |Format |Description |Sources|
|
|
141
|
+
|--- |--- |--- |--- |
|
|
142
|
+
|SO_BROADCAST |primitive|a boolean property, Allow transmission of broadcast datagrams | |
|
|
143
|
+
|SO_KEEPALIVE |primitive|a boolean property, Keep connection alive | |
|
|
144
|
+
|SO_SNDBUF |primitive|an integer property, The size of the socket send buffer | |
|
|
145
|
+
|SO_RCVBUF |primitive|an integer property, The size of the socket receive buffer | |
|
|
146
|
+
|SO_REUSEADDR |primitive|a boolean property, Re-use address | |
|
|
147
|
+
|SO_LINGER |primitive|an integer property, Linger on close if data is present | |
|
|
148
|
+
|IP_TOS |primitive|an integer property, The ToS octet in the IP header | |
|
|
149
|
+
|IP_MULTICAST_IF |primitive|a text property, The network interface's name for IP multicast datagrams| |
|
|
150
|
+
|IP_MULTICAST_TTL |primitive|an integer property, The time-to-live for IP multicast datagrams | |
|
|
151
|
+
|IP_MULTICAST_LOOP |primitive|a boolean property, Loopback for IP multicast datagrams | |
|
|
152
|
+
|TCP_NODELAY |primitive|a boolean property, Disable the Nagle algorithm | |
|
|
153
|
+
|CONNECT_TIMEOUT_MILLIS |primitive|a duration property, Connect timeout | |
|
|
154
|
+
|WRITE_SPIN_COUNT |primitive|an integer property, Write spin count | |
|
|
155
|
+
|ALLOW_HALF_CLOSURE |primitive|a boolean property, Allow half closure | |
|
|
156
|
+
|AUTO_READ |primitive|a boolean property, Auto read | |
|
|
157
|
+
|AUTO_CLOSE |primitive|a boolean property, Auto close | |
|
|
158
|
+
|SINGLE_EVENTEXECUTOR_PER_GROUP|primitive|a boolean property, Single event executor per group | |
|
|
81
159
|
|
|
82
160
|
### proxy
|
|
83
161
|
|
|
84
|
-
|FieldName
|
|
85
|
-
|---
|
|
86
|
-
|
|
|
87
|
-
|host
|
|
88
|
-
|port
|
|
89
|
-
|
|
|
162
|
+
|FieldName|Format |Description |Sources|
|
|
163
|
+
|--- |--- |--- |--- |
|
|
164
|
+
| |[any-one-of](fielddescriptions-13)| | |
|
|
165
|
+
|host |primitive |a text property, Hostname of the proxy| |
|
|
166
|
+
|port |primitive |an integer property, Port of the proxy| |
|
|
167
|
+
| |[any-one-of](fielddescriptions-12)| | |
|
|
168
|
+
|
|
169
|
+
### Field Descriptions
|
|
170
|
+
|
|
171
|
+
|FieldName|Format |Description |Sources|
|
|
172
|
+
|--- |--- |--- |--- |
|
|
173
|
+
|scheme |primitive|a text property, The proxy scheme | |
|
|
174
|
+
| |primitive|a constant property, The proxy scheme| |
|
|
175
|
+
|
|
176
|
+
### Field Descriptions
|
|
177
|
+
|
|
178
|
+
|FieldName |Format |Description |Sources|
|
|
179
|
+
|--- |--- |--- |--- |
|
|
180
|
+
|nonProxyHosts|list |a text property, Hosts that should not be proxied | |
|
|
181
|
+
| |primitive|a constant property, Hosts that should not be proxied| |
|
|
90
182
|
|
|
91
183
|
### http2
|
|
92
184
|
|
|
93
|
-
|FieldName
|
|
94
|
-
|---
|
|
95
|
-
|maxStreams
|
|
96
|
-
|initialWindowSize
|
|
97
|
-
|
|
|
185
|
+
|FieldName |Format |Description |Sources|
|
|
186
|
+
|--- |--- |--- |--- |
|
|
187
|
+
|maxStreams |primitive |an integer property, Max number of concurrent streams per connection| |
|
|
188
|
+
|initialWindowSize|primitive |an integer property, Initial window size of a stream | |
|
|
189
|
+
| |[any-one-of](fielddescriptions-12)| | |
|
|
190
|
+
|
|
191
|
+
### Field Descriptions
|
|
192
|
+
|
|
193
|
+
|FieldName |Format |Description |Sources|
|
|
194
|
+
|--- |--- |--- |--- |
|
|
195
|
+
|healthCheckPingPeriod|primitive|a duration property, The period that the Netty client will send PING frames to the remote endpoint| |
|
|
196
|
+
| |primitive|a constant property, The period that the Netty client will send PING frames to the remote endpoint| |
|
|
98
197
|
|
|
99
198
|
|
|
100
199
|
## Akka HTTP
|
|
101
200
|
The _Akka HTTP implementation_ can be chosen by using the `akkahttp.client()` layer for providing `HttpClient` to `AwsConfig`.
|
|
102
201
|
This implementation uses the [standard akka-http settings](https://doc.akka.io/docs/akka-http/current/configuration.html) from the application's _Lightbend config_,
|
|
103
|
-
it is not described with zio-config descriptors.
|
|
202
|
+
it is not described with zio-config descriptors.
|
|
104
203
|
|
|
105
204
|
## http4s
|
|
106
205
|
Another alternative is the _http4s client_. To use the default settings, provide the `http4s.default` layer to `AwsConfig`. Customization by manipulating the builder
|
|
@@ -116,37 +215,191 @@ is also possible by `http4s.customized(customization)`. And similarly to the _Ne
|
|
|
116
215
|
|
|
117
216
|
### Field Descriptions
|
|
118
217
|
|
|
119
|
-
|FieldName
|
|
120
|
-
|---
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
218
|
+
|FieldName|Format |Description|Sources|
|
|
219
|
+
|--- |--- |--- |--- |
|
|
220
|
+
| |[any-one-of](fielddescriptions-15)| | |
|
|
221
|
+
| |[any-one-of](fielddescriptions-14)| | |
|
|
222
|
+
| |[any-one-of](fielddescriptions-13)| | |
|
|
223
|
+
| |[any-one-of](fielddescriptions-12)| | |
|
|
224
|
+
| |[any-one-of](fielddescriptions-11)| | |
|
|
225
|
+
| |[any-one-of](fielddescriptions-10)| | |
|
|
226
|
+
| |[any-one-of](fielddescriptions-9) | | |
|
|
227
|
+
| |[any-one-of](fielddescriptions-8) | | |
|
|
228
|
+
| |[any-one-of](fielddescriptions-7) | | |
|
|
229
|
+
| |[any-one-of](fielddescriptions-6) | | |
|
|
230
|
+
| |[any-one-of](fielddescriptions-5) | | |
|
|
231
|
+
| |[any-one-of](fielddescriptions-4) | | |
|
|
232
|
+
| |[any-one-of](fielddescriptions-3) | | |
|
|
233
|
+
| |[any-one-of](fielddescriptions-2) | | |
|
|
234
|
+
| |[any-one-of](fielddescriptions-1) | | |
|
|
235
|
+
|
|
236
|
+
### Field Descriptions
|
|
237
|
+
|
|
238
|
+
|FieldName |Format |Description |Sources|
|
|
239
|
+
|--- |--- |--- |--- |
|
|
240
|
+
|responseHeaderTimeout|primitive|a duration property, Timeout for receiving the header part of the response| |
|
|
241
|
+
| |primitive|a constant property, Timeout for receiving the header part of the response| |
|
|
242
|
+
|
|
243
|
+
### Field Descriptions
|
|
244
|
+
|
|
245
|
+
|FieldName |Format |Description |Sources|
|
|
246
|
+
|--- |--- |--- |--- |
|
|
247
|
+
|idleTimeout|primitive|a duration property, Timeout for client connection staying idle| |
|
|
248
|
+
| |primitive|a constant property, Timeout for client connection staying idle| |
|
|
249
|
+
|
|
250
|
+
### Field Descriptions
|
|
251
|
+
|
|
252
|
+
|FieldName |Format |Description |Sources|
|
|
253
|
+
|--- |--- |--- |--- |
|
|
254
|
+
|requestTimeout|primitive|a duration property, Timeout for the whole request| |
|
|
255
|
+
| |primitive|a constant property, Timeout for the whole request| |
|
|
256
|
+
|
|
257
|
+
### Field Descriptions
|
|
258
|
+
|
|
259
|
+
|FieldName |Format |Description |Sources|
|
|
260
|
+
|--- |--- |--- |--- |
|
|
261
|
+
|connectTimeout|primitive|a duration property, Timeout for connecting to the server| |
|
|
262
|
+
| |primitive|a constant property, Timeout for connecting to the server| |
|
|
263
|
+
|
|
264
|
+
### Field Descriptions
|
|
265
|
+
|
|
266
|
+
|FieldName|Format |Description |Sources|
|
|
267
|
+
|--- |--- |--- |--- |
|
|
268
|
+
|userAgent|primitive|a text property, User-Agent header sent by the client | |
|
|
269
|
+
| |primitive|a constant property, User-Agent header sent by the client| |
|
|
270
|
+
|
|
271
|
+
### Field Descriptions
|
|
272
|
+
|
|
273
|
+
|FieldName |Format |Description |Sources|
|
|
274
|
+
|--- |--- |--- |--- |
|
|
275
|
+
|maxTotalConnections|primitive|an integer property, Maximum number of parallel connections| |
|
|
276
|
+
| |primitive|a constant property, Maximum number of parallel connections| |
|
|
277
|
+
|
|
278
|
+
### Field Descriptions
|
|
279
|
+
|
|
280
|
+
|FieldName |Format |Description |Sources|
|
|
281
|
+
|--- |--- |--- |--- |
|
|
282
|
+
|maxWaitQueueLimit|primitive|an integer property, Maximum number of requests in queue| |
|
|
283
|
+
| |primitive|a constant property, Maximum number of requests in queue| |
|
|
284
|
+
|
|
285
|
+
### Field Descriptions
|
|
286
|
+
|
|
287
|
+
|FieldName |Format |Description |Sources|
|
|
288
|
+
|--- |--- |--- |--- |
|
|
289
|
+
|checkEndpointIdentification|primitive|a boolean property, Check https identity | |
|
|
290
|
+
| |primitive|a constant property, Check https identity| |
|
|
291
|
+
|
|
292
|
+
### Field Descriptions
|
|
293
|
+
|
|
294
|
+
|FieldName |Format |Description |Sources|
|
|
295
|
+
|--- |--- |--- |--- |
|
|
296
|
+
|maxResponseLineSize|primitive|an integer property, Maximum line length of headers in response| |
|
|
297
|
+
| |primitive|a constant property, Maximum line length of headers in response| |
|
|
298
|
+
|
|
299
|
+
### Field Descriptions
|
|
300
|
+
|
|
301
|
+
|FieldName |Format |Description |Sources|
|
|
302
|
+
|--- |--- |--- |--- |
|
|
303
|
+
|maxHeaderLength|primitive|an integer property, Maximum total length of the response headers| |
|
|
304
|
+
| |primitive|a constant property, Maximum total length of the response headers| |
|
|
305
|
+
|
|
306
|
+
### Field Descriptions
|
|
307
|
+
|
|
308
|
+
|FieldName |Format |Description |Sources|
|
|
309
|
+
|--- |--- |--- |--- |
|
|
310
|
+
|maxChunkSize|primitive|an integer property, Maximum chunk size| |
|
|
311
|
+
| |primitive|a constant property, Maximum chunk size| |
|
|
312
|
+
|
|
313
|
+
### Field Descriptions
|
|
314
|
+
|
|
315
|
+
|FieldName |Format |Description |Sources|
|
|
316
|
+
|--- |--- |--- |--- |
|
|
317
|
+
|chunkBufferMaxSize|primitive|an integer property, Maximum size of the chunk buffer| |
|
|
318
|
+
| |primitive|a constant property, Maximum size of the chunk buffer| |
|
|
319
|
+
|
|
320
|
+
### Field Descriptions
|
|
321
|
+
|
|
322
|
+
|FieldName |Format |Description |Sources|
|
|
323
|
+
|--- |--- |--- |--- |
|
|
324
|
+
|parserMode|primitive|a text property, Parser mode, strict or lenient | |
|
|
325
|
+
| |primitive|a constant property, Parser mode, strict or lenient| |
|
|
326
|
+
|
|
327
|
+
### Field Descriptions
|
|
328
|
+
|
|
329
|
+
|FieldName |Format |Description |Sources|
|
|
330
|
+
|--- |--- |--- |--- |
|
|
331
|
+
|bufferSize|primitive|an integer property, Buffer size| |
|
|
332
|
+
| |primitive|a constant property, Buffer size| |
|
|
333
|
+
|
|
334
|
+
### Field Descriptions
|
|
335
|
+
|
|
336
|
+
|FieldName |Format |Description |Sources|
|
|
337
|
+
|--- |--- |--- |--- |
|
|
338
|
+
|[channelOptions](channeloptions)|[all-of](channeloptions)|Collection of socket options | |
|
|
339
|
+
| |primitive |a constant property, Collection of socket options| |
|
|
136
340
|
|
|
137
341
|
### channelOptions
|
|
138
342
|
|
|
139
|
-
|FieldName |Format |Description
|
|
140
|
-
|--- |--- |---
|
|
141
|
-
|SO_BROADCAST |primitive|
|
|
142
|
-
|SO_KEEPALIVE |primitive|
|
|
143
|
-
|SO_SNDBUF |primitive|
|
|
144
|
-
|SO_RCVBUF |primitive|
|
|
145
|
-
|SO_REUSEADDR |primitive|
|
|
146
|
-
|SO_LINGER |primitive|
|
|
147
|
-
|IP_TOS |primitive|
|
|
148
|
-
|IP_MULTICAST_IF |primitive|
|
|
149
|
-
|IP_MULTICAST_TTL |primitive|
|
|
150
|
-
|IP_MULTICAST_LOOP|primitive|
|
|
151
|
-
|TCP_NODELAY |primitive|
|
|
343
|
+
|FieldName |Format |Description |Sources|
|
|
344
|
+
|--- |--- |--- |--- |
|
|
345
|
+
|SO_BROADCAST |primitive|a boolean property, Allow transmission of broadcast datagrams | |
|
|
346
|
+
|SO_KEEPALIVE |primitive|a boolean property, Keep connection alive | |
|
|
347
|
+
|SO_SNDBUF |primitive|an integer property, The size of the socket send buffer | |
|
|
348
|
+
|SO_RCVBUF |primitive|an integer property, The size of the socket receive buffer | |
|
|
349
|
+
|SO_REUSEADDR |primitive|a boolean property, Re-use address | |
|
|
350
|
+
|SO_LINGER |primitive|an integer property, Linger on close if data is present | |
|
|
351
|
+
|IP_TOS |primitive|an integer property, The ToS octet in the IP header | |
|
|
352
|
+
|IP_MULTICAST_IF |primitive|a text property, The network interface's name for IP multicast datagrams| |
|
|
353
|
+
|IP_MULTICAST_TTL |primitive|an integer property, The time-to-live for IP multicast datagrams | |
|
|
354
|
+
|IP_MULTICAST_LOOP|primitive|a boolean property, Loopback for IP multicast datagrams | |
|
|
355
|
+
|TCP_NODELAY |primitive|a boolean property, Disable the Nagle algorithm | |
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
## AWS CRT HTTP
|
|
359
|
+
The new _AWS Common Runtime_ (CRT) HTTP client can be used by providing the `crt.default` layer for providing `HttpClient` to `AwsConfig`.
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
## Configuration Details
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|FieldName|Format |Description|Sources|
|
|
366
|
+
|--- |--- |--- |--- |
|
|
367
|
+
| |[all-of](fielddescriptions)| | |
|
|
368
|
+
|
|
369
|
+
### Field Descriptions
|
|
370
|
+
|
|
371
|
+
|FieldName |Format |Description |Sources|
|
|
372
|
+
|--- |--- |--- |--- |
|
|
373
|
+
|maxConcurrency |primitive |an integer property, The Maximum number of allowed concurrent requests. For HTTP/1.1 this is the same as max connections. | |
|
|
374
|
+
|readBufferSizeInBytes |primitive |an integer property, Configures the number of unread bytes that can be buffered in the client before we stop reading from the underlying TCP socket and wait for the Subscriber to read more data. | |
|
|
375
|
+
|[proxy](proxy) |[all-of](proxy) |Sets the http proxy configuration to use for this client. | |
|
|
376
|
+
|[connectionHealth](connectionhealth)|[all-of](connectionhealth)|Configure the health checks for all connections established by this client. | |
|
|
377
|
+
|connectionMaxIdleTime |primitive |a duration property, Configure the maximum amount of time that a connection should be allowed to remain open while idle. | |
|
|
378
|
+
|connectionTimeout |primitive |a duration property, The amount of time to wait when initially establishing a connection before giving up and timing out. | |
|
|
379
|
+
|[tcpKeepAlive](tcpkeepalive) |[all-of](tcpkeepalive) |Configure whether to enable tcpKeepAlive and relevant configuration for all connections established by this client. | |
|
|
380
|
+
|postQuantumTlsEnabled |primitive |a boolean property, Configure whether to enable a hybrid post-quantum key exchange option for the Transport Layer Security (TLS) network encryption protocol when communicating with services that support Post Quantum TLS. If Post Quantum cipher suites are not supported on the platform, the SDK will use the default TLS cipher suites.| |
|
|
381
|
+
|
|
382
|
+
### proxy
|
|
383
|
+
|
|
384
|
+
|FieldName|Format |Description |Sources|
|
|
385
|
+
|--- |--- |--- |--- |
|
|
386
|
+
|scheme |primitive|a text property, The scheme of the proxy | |
|
|
387
|
+
|host |primitive|a text property, The host of the proxy | |
|
|
388
|
+
|port |primitive|an integer property, The port of the proxy | |
|
|
389
|
+
|username |primitive|a text property, The username for the proxy| |
|
|
390
|
+
|password |primitive|a text property, The password for the proxy| |
|
|
391
|
+
|
|
392
|
+
### connectionHealth
|
|
393
|
+
|
|
394
|
+
|FieldName |Format |Description |Sources|
|
|
395
|
+
|--- |--- |--- |--- |
|
|
396
|
+
|minimumThroughputInBps |primitive|an integer property, Sets a throughput threshold for connections. Throughput below this value will be considered unhealthy| |
|
|
397
|
+
|minimumThroughputTimeout|primitive|a duration property, Sets how long a connection is allowed to be unhealthy before getting shut down | |
|
|
398
|
+
|
|
399
|
+
### tcpKeepAlive
|
|
400
|
+
|
|
401
|
+
|FieldName |Format |Description |Sources|
|
|
402
|
+
|--- |--- |--- |--- |
|
|
403
|
+
|keepAliveInterval|primitive|a duration property, The number of seconds between TCP keepalive packets being sent to the peer | |
|
|
404
|
+
|keepAliveTimeout |primitive|a duration property, The number of seconds to wait for a keepalive response before considering the connection timed out| |
|
|
152
405
|
|
package/index.md
CHANGED
|
@@ -3,7 +3,162 @@ id: index
|
|
|
3
3
|
title: "Overview"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
[ZIO AWS](https://zio.dev/zio-aws) is AWS wrapper for [ZIO](https://zio.dev) for _all_ AWS services using the AWS Java SDK v2.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
[](https://github.com/zio/zio/wiki/Project-Stages)  [](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-aws-core_2.13/) [](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-aws-core_2.13/) [](https://javadoc.io/doc/dev.zio/zio-aws-docs_2.13) [](https://github.com/zio/zio-aws)
|
|
9
|
+
|
|
10
|
+
## Introduction
|
|
11
|
+
|
|
12
|
+
The goal is to have access to all AWS functionality for cases when only a simple, direct access is needed from a ZIO application, or to be used as a building block for higher level wrappers around specific services.
|
|
13
|
+
|
|
14
|
+
Key features of ZIO AWS:
|
|
15
|
+
|
|
16
|
+
- Common configuration layer
|
|
17
|
+
- ZIO module layer per AWS service
|
|
18
|
+
- Wrapper for all operations on all services
|
|
19
|
+
- HTTP service implementations for functional Scala HTTP libraries, injected through ZIO’s module system
|
|
20
|
+
- ZStream wrapper around paginated operations
|
|
21
|
+
- Service-specific extra configuration
|
|
22
|
+
- More idiomatic Scala request and response types wrapping the Java classes
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
There are tones of artifacts [published](artifacts.md) for each AWS service. We can pick whichever services we need.
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
The following example uses the _ElasticBeanstalk_ and _EC2_ APIs:
|
|
31
|
+
|
|
32
|
+
> **Note**
|
|
33
|
+
>
|
|
34
|
+
> See the [artifacts](artifacts.md) page for the latest release.
|
|
35
|
+
|
|
36
|
+
```scala
|
|
37
|
+
libraryDependencies += "dev.zio" %% "zio-aws-core" % "<version>"
|
|
38
|
+
libraryDependencies += "dev.zio" %% "zio-aws-ec2" % "<version>"
|
|
39
|
+
libraryDependencies += "dev.zio" %% "zio-aws-elasticbeanstalk" % "<version>"
|
|
40
|
+
libraryDependencies += "dev.zio" %% "zio-aws-netty" % "<version>"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
And here is the example code:
|
|
44
|
+
|
|
45
|
+
```scala
|
|
46
|
+
import zio.aws.core.AwsError
|
|
47
|
+
import zio.aws.core.config.AwsConfig
|
|
48
|
+
import zio.aws.ec2.Ec2
|
|
49
|
+
import zio.aws.ec2.model._
|
|
50
|
+
import zio.aws.ec2.model.primitives._
|
|
51
|
+
import zio.aws.elasticbeanstalk.ElasticBeanstalk
|
|
52
|
+
import zio.aws.elasticbeanstalk.model._
|
|
53
|
+
import zio.aws.elasticbeanstalk.model.primitives._
|
|
54
|
+
import zio.aws.netty.NettyHttpClient
|
|
55
|
+
import zio._
|
|
56
|
+
import zio.stream._
|
|
57
|
+
|
|
58
|
+
object ZIOAWSExample extends ZIOAppDefault {
|
|
59
|
+
val program: ZIO[Ec2 & ElasticBeanstalk, AwsError, Unit] =
|
|
60
|
+
for {
|
|
61
|
+
appsResult <- ElasticBeanstalk.describeApplications(
|
|
62
|
+
DescribeApplicationsRequest(applicationNames = Some(List(ApplicationName("my-service"))))
|
|
63
|
+
)
|
|
64
|
+
app <- appsResult.getApplications.map(_.headOption)
|
|
65
|
+
_ <- app match {
|
|
66
|
+
case Some(appDescription) =>
|
|
67
|
+
for {
|
|
68
|
+
applicationName <- appDescription.getApplicationName
|
|
69
|
+
_ <- Console
|
|
70
|
+
.printLine(
|
|
71
|
+
s"Got application description for $applicationName"
|
|
72
|
+
)
|
|
73
|
+
.ignore
|
|
74
|
+
|
|
75
|
+
envStream = ElasticBeanstalk.describeEnvironments(
|
|
76
|
+
DescribeEnvironmentsRequest(applicationName =
|
|
77
|
+
Some(applicationName)
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
_ <- envStream.run(ZSink.foreach { env =>
|
|
82
|
+
env.getEnvironmentName.flatMap { environmentName =>
|
|
83
|
+
(for {
|
|
84
|
+
environmentId <- env.getEnvironmentId
|
|
85
|
+
_ <- Console
|
|
86
|
+
.printLine(
|
|
87
|
+
s"Getting the EB resources of $environmentName"
|
|
88
|
+
)
|
|
89
|
+
.ignore
|
|
90
|
+
|
|
91
|
+
resourcesResult <-
|
|
92
|
+
ElasticBeanstalk.describeEnvironmentResources(
|
|
93
|
+
DescribeEnvironmentResourcesRequest(environmentId =
|
|
94
|
+
Some(environmentId)
|
|
95
|
+
)
|
|
96
|
+
)
|
|
97
|
+
resources <- resourcesResult.getEnvironmentResources
|
|
98
|
+
_ <- Console
|
|
99
|
+
.printLine(
|
|
100
|
+
s"Getting the EC2 instances in $environmentName"
|
|
101
|
+
)
|
|
102
|
+
.ignore
|
|
103
|
+
instances <- resources.getInstances
|
|
104
|
+
instanceIds <- ZIO.foreach(instances)(_.getId)
|
|
105
|
+
_ <- Console
|
|
106
|
+
.printLine(
|
|
107
|
+
s"Instance IDs are ${instanceIds.mkString(", ")}"
|
|
108
|
+
)
|
|
109
|
+
.ignore
|
|
110
|
+
|
|
111
|
+
reservationsStream = Ec2.describeInstances(
|
|
112
|
+
DescribeInstancesRequest(instanceIds = Some(instanceIds.map(id => zio.aws.ec2.model.primitives.InstanceId(ResourceId.unwrap(id)))))
|
|
113
|
+
)
|
|
114
|
+
_ <- reservationsStream.run(ZSink.foreach { reservation =>
|
|
115
|
+
reservation.getInstances
|
|
116
|
+
.flatMap { instances =>
|
|
117
|
+
ZIO.foreach(instances) { instance =>
|
|
118
|
+
for {
|
|
119
|
+
id <- instance.getInstanceId
|
|
120
|
+
typ <- instance.getInstanceType
|
|
121
|
+
launchTime <- instance.getLaunchTime
|
|
122
|
+
_ <- Console.printLine(s" instance $id:").ignore
|
|
123
|
+
_ <- Console.printLine(s" type: $typ").ignore
|
|
124
|
+
_ <- Console
|
|
125
|
+
.printLine(
|
|
126
|
+
s" launched at: $launchTime"
|
|
127
|
+
)
|
|
128
|
+
.ignore
|
|
129
|
+
} yield ()
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
} yield ()).catchAll { error =>
|
|
134
|
+
Console
|
|
135
|
+
.printLineError(
|
|
136
|
+
s"Failed to get info for $environmentName: $error"
|
|
137
|
+
)
|
|
138
|
+
.ignore
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
} yield ()
|
|
143
|
+
case None =>
|
|
144
|
+
ZIO.unit
|
|
145
|
+
}
|
|
146
|
+
} yield ()
|
|
147
|
+
|
|
148
|
+
override def run: URIO[ZIOAppArgs, ExitCode] = {
|
|
149
|
+
val httpClient = NettyHttpClient.default
|
|
150
|
+
val awsConfig = httpClient >>> AwsConfig.default
|
|
151
|
+
val aws = awsConfig >>> (Ec2.live ++ ElasticBeanstalk.live)
|
|
152
|
+
|
|
153
|
+
program
|
|
154
|
+
.provideLayer(aws)
|
|
155
|
+
.either
|
|
156
|
+
.flatMap {
|
|
157
|
+
case Left(error) =>
|
|
158
|
+
Console.printLineError(s"AWS error: $error").ignore.as(ExitCode.failure)
|
|
159
|
+
case Right(_) =>
|
|
160
|
+
ZIO.unit.as(ExitCode.success)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
package/package.json
CHANGED
package/sidebars.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
const sidebars = {
|
|
2
2
|
sidebar: [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
{
|
|
4
|
+
type: "category",
|
|
5
|
+
label: "ZIO AWS",
|
|
6
|
+
collapsed: false,
|
|
7
|
+
link: { type: "doc", id: "index" },
|
|
8
|
+
items: [
|
|
9
|
+
"artifacts",
|
|
10
|
+
"wrappers",
|
|
11
|
+
"configuration",
|
|
12
|
+
"http",
|
|
13
|
+
"aspects",
|
|
14
|
+
"examples",
|
|
15
|
+
"changelog",
|
|
16
|
+
"migration-guide",
|
|
17
|
+
]
|
|
18
|
+
}
|
|
12
19
|
]
|
|
13
20
|
};
|
|
14
21
|
|