Skip to content

Commit 504b7e6

Browse files
Merge pull request #2088 from aws/staging/5b5fad27-8c77-4090-a6ce-cf3a987a80c7
Pull request: release <- staging/5b5fad27-8c77-4090-a6ce-cf3a987a80c7
2 parents d16def5 + 39537d6 commit 504b7e6

File tree

393 files changed

+1821
-574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

393 files changed

+1821
-574
lines changed

.changes/2.17.229.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"version": "2.17.229",
3+
"date": "2022-07-11",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "AWS SDK for Java v2",
8+
"contributor": "",
9+
"description": "Share background refresh threads across async credential providers to reduce base SDK resource consumption."
10+
},
11+
{
12+
"type": "feature",
13+
"category": "AWS SDK for Java v2",
14+
"contributor": "",
15+
"description": "Log a warning when an extreme number of async credential providers are running in parallel, because it could indicate that the user is not closing their clients or credential providers when they are done using them."
16+
},
17+
{
18+
"type": "feature",
19+
"category": "AWS SDK for Java v2",
20+
"contributor": "",
21+
"description": "Jitter credential provider cache refresh times."
22+
},
23+
{
24+
"type": "feature",
25+
"category": "Amazon Elastic Compute Cloud",
26+
"contributor": "",
27+
"description": "Build, manage, and monitor a unified global network that connects resources running across your cloud and on-premises environments using the AWS Cloud WAN APIs."
28+
},
29+
{
30+
"type": "feature",
31+
"category": "Amazon Redshift",
32+
"contributor": "",
33+
"description": "This release adds a new --snapshot-arn field for describe-cluster-snapshots, describe-node-configuration-options, restore-from-cluster-snapshot, authorize-snapshot-acsess, and revoke-snapshot-acsess APIs. It allows customers to give a Redshift snapshot ARN or a Redshift Serverless ARN as input."
34+
},
35+
{
36+
"type": "feature",
37+
"category": "Redshift Serverless",
38+
"contributor": "",
39+
"description": "Removed prerelease language for GA launch."
40+
},
41+
{
42+
"type": "feature",
43+
"category": "AWS SDK for Java v2",
44+
"contributor": "",
45+
"description": "Updated service endpoint metadata."
46+
}
47+
]
48+
}

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# __2.17.229__ __2022-07-11__
2+
## __AWS SDK for Java v2__
3+
- ### Features
4+
- Jitter credential provider cache refresh times.
5+
- Log a warning when an extreme number of async credential providers are running in parallel, because it could indicate that the user is not closing their clients or credential providers when they are done using them.
6+
- Share background refresh threads across async credential providers to reduce base SDK resource consumption.
7+
- Updated service endpoint metadata.
8+
9+
## __Amazon Elastic Compute Cloud__
10+
- ### Features
11+
- Build, manage, and monitor a unified global network that connects resources running across your cloud and on-premises environments using the AWS Cloud WAN APIs.
12+
13+
## __Amazon Redshift__
14+
- ### Features
15+
- This release adds a new --snapshot-arn field for describe-cluster-snapshots, describe-node-configuration-options, restore-from-cluster-snapshot, authorize-snapshot-acsess, and revoke-snapshot-acsess APIs. It allows customers to give a Redshift snapshot ARN or a Redshift Serverless ARN as input.
16+
17+
## __Redshift Serverless__
18+
- ### Features
19+
- Removed prerelease language for GA launch.
20+
121
# __2.17.228__ __2022-07-08__
222
## __AWS Backup__
323
- ### Features

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To automatically manage module versions (currently all modules have the same ver
5252
<dependency>
5353
<groupId>software.amazon.awssdk</groupId>
5454
<artifactId>bom</artifactId>
55-
<version>2.17.228</version>
55+
<version>2.17.229</version>
5656
<type>pom</type>
5757
<scope>import</scope>
5858
</dependency>
@@ -86,12 +86,12 @@ Alternatively you can add dependencies for the specific services you use only:
8686
<dependency>
8787
<groupId>software.amazon.awssdk</groupId>
8888
<artifactId>ec2</artifactId>
89-
<version>2.17.228</version>
89+
<version>2.17.229</version>
9090
</dependency>
9191
<dependency>
9292
<groupId>software.amazon.awssdk</groupId>
9393
<artifactId>s3</artifactId>
94-
<version>2.17.228</version>
94+
<version>2.17.229</version>
9595
</dependency>
9696
```
9797

@@ -103,7 +103,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
103103
<dependency>
104104
<groupId>software.amazon.awssdk</groupId>
105105
<artifactId>aws-sdk-java</artifactId>
106-
<version>2.17.228</version>
106+
<version>2.17.229</version>
107107
</dependency>
108108
```
109109

archetypes/archetype-app-quickstart/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.17.228</version>
23+
<version>2.17.229</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

archetypes/archetype-lambda/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.17.228</version>
23+
<version>2.17.229</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetype-lambda</artifactId>

archetypes/archetype-tools/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.17.228</version>
23+
<version>2.17.229</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

archetypes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.17.228</version>
23+
<version>2.17.229</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetypes</artifactId>

aws-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.17.228</version>
20+
<version>2.17.229</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>aws-sdk-java</artifactId>

bom-internal/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.17.228</version>
23+
<version>2.17.229</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.17.228</version>
20+
<version>2.17.229</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>bom</artifactId>

bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.17.228</version>
24+
<version>2.17.229</version>
2525
</parent>
2626
<artifactId>bundle</artifactId>
2727
<packaging>jar</packaging>

codegen-lite-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.17.228</version>
25+
<version>2.17.229</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.17.228</version>
24+
<version>2.17.229</version>
2525
</parent>
2626
<artifactId>codegen-lite</artifactId>
2727
<name>AWS Java SDK :: Code Generator Lite</name>

codegen-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.17.228</version>
25+
<version>2.17.229</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-maven-plugin</artifactId>

codegen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.17.228</version>
24+
<version>2.17.229</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

core/annotations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>core</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.17.228</version>
23+
<version>2.17.229</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/arns/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>core</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.17.228</version>
23+
<version>2.17.229</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/auth-crt/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>core</artifactId>
25-
<version>2.17.228</version>
25+
<version>2.17.229</version>
2626
</parent>
2727

2828
<artifactId>auth-crt</artifactId>

core/auth/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>core</artifactId>
25-
<version>2.17.228</version>
25+
<version>2.17.229</version>
2626
</parent>
2727

2828
<artifactId>auth</artifactId>

core/auth/src/main/java/software/amazon/awssdk/auth/credentials/HttpCredentialsProvider.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828
public interface HttpCredentialsProvider extends AwsCredentialsProvider, SdkAutoCloseable {
2929
interface Builder<TypeToBuildT extends HttpCredentialsProvider, BuilderT extends Builder<?, ?>> {
3030
/**
31-
* Configure whether this provider should fetch credentials asynchronously in the background. If this is true, threads are
32-
* less likely to block when {@link #resolveCredentials()} is called, but additional resources are used to maintain the
33-
* provider.
31+
* Configure whether the provider should fetch credentials asynchronously in the background. If this is true,
32+
* threads are less likely to block when credentials are loaded, but additional resources are used to maintain
33+
* the provider.
3434
*
35-
* <p>
36-
* By default, this is disabled.
35+
* <p>By default, this is disabled.</p>
3736
*/
3837
BuilderT asyncCredentialUpdateEnabled(Boolean asyncCredentialUpdateEnabled);
3938

core/auth/src/main/java/software/amazon/awssdk/auth/credentials/InstanceProfileCredentialsProvider.java

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
package software.amazon.awssdk.auth.credentials;
1717

1818
import static java.time.temporal.ChronoUnit.MINUTES;
19-
import static java.time.temporal.ChronoUnit.SECONDS;
20-
import static software.amazon.awssdk.utils.ComparableUtils.minimum;
19+
import static software.amazon.awssdk.utils.ComparableUtils.maximum;
2120

2221
import java.io.IOException;
2322
import java.net.URI;
2423
import java.time.Clock;
24+
import java.time.Duration;
2525
import java.time.Instant;
2626
import java.util.Collections;
2727
import java.util.Map;
@@ -151,7 +151,7 @@ private RefreshResult<AwsCredentials> refreshCredentials() {
151151
// Choose whether to report this failure at the debug or warn level based on how much time is left on the
152152
// credentials before expiration.
153153
Supplier<String> errorMessage = () -> "Failure encountered when attempting to refresh credentials from IMDS.";
154-
Instant fifteenMinutesFromNow = Instant.now().plus(15, MINUTES);
154+
Instant fifteenMinutesFromNow = clock.instant().plus(15, MINUTES);
155155
if (expiration.isBefore(fifteenMinutesFromNow)) {
156156
log.warn(errorMessage, e);
157157
} else {
@@ -164,7 +164,7 @@ private RefreshResult<AwsCredentials> refreshCredentials() {
164164
}
165165

166166
return RefreshResult.builder(credentials.getAwsCredentials())
167-
.staleTime(null) // Allow use of expired credentials - they may still work
167+
.staleTime(Instant.MAX) // Allow use of expired credentials - they may still work
168168
.prefetchTime(prefetchTime(credentials.getExpiration().orElse(null)))
169169
.build();
170170
}
@@ -180,35 +180,18 @@ private boolean isLocalCredentialLoadingDisabled() {
180180
private Instant prefetchTime(Instant expiration) {
181181
Instant now = clock.instant();
182182

183-
// If expiration time doesn't exist, refresh in 60 minutes
184183
if (expiration == null) {
185184
return now.plus(60, MINUTES);
186185
}
187186

188-
// If expiration time is 60+ minutes from now, refresh in 30 minutes.
189-
Instant sixtyMinutesBeforeExpiration = expiration.minus(60, MINUTES);
190-
if (now.isBefore(sixtyMinutesBeforeExpiration)) {
191-
return now.plus(30, MINUTES);
187+
Duration timeUntilExpiration = Duration.between(now, expiration);
188+
if (timeUntilExpiration.isNegative()) {
189+
log.warn(() -> "IMDS credential expiration has been extended due to an IMDS availability outage. A refresh "
190+
+ "of these credentials will be attempted again in ~5 minutes.");
191+
return now.plus(5, MINUTES);
192192
}
193193

194-
// If expiration time is 15 minutes or more from now, refresh in 10 minutes.
195-
Instant fifteenMinutesBeforeExpiration = expiration.minus(15, MINUTES);
196-
if (now.isBefore(fifteenMinutesBeforeExpiration)) {
197-
return now.plus(10, MINUTES);
198-
}
199-
200-
// If expiration time is 0.25-15 minutes from now, refresh in 5 minutes, or 15 seconds before expiration, whichever is
201-
// sooner.
202-
Instant fifteenSecondsBeforeExpiration = expiration.minus(15, SECONDS);
203-
if (now.isBefore(fifteenSecondsBeforeExpiration)) {
204-
return minimum(now.plus(5, MINUTES), fifteenSecondsBeforeExpiration);
205-
}
206-
207-
// These credentials are expired. Try refreshing again in 5 minutes. We can't be more aggressive than that, because we
208-
// don't want to overload the IMDS endpoint.
209-
log.warn(() -> "IMDS credential expiration has been extended due to an IMDS availability outage. A refresh "
210-
+ "of these credentials will be attempted again in 5 minutes.");
211-
return now.plus(5, MINUTES);
194+
return now.plus(maximum(timeUntilExpiration.abs().dividedBy(2), Duration.ofMinutes(5)));
212195
}
213196

214197
@Override

core/auth/src/main/java/software/amazon/awssdk/auth/credentials/ProcessCredentialsProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ private Builder(ProcessCredentialsProvider provider) {
249249
}
250250

251251
/**
252-
* Configure whether the provider should fetch credentials asynchronously in the background. If this is true, threads are
253-
* less likely to block when credentials are loaded, but additional resources are used to maintain the provider.
252+
* Configure whether the provider should fetch credentials asynchronously in the background. If this is true,
253+
* threads are less likely to block when credentials are loaded, but additional resources are used to maintain
254+
* the provider.
254255
*
255256
* <p>By default, this is disabled.</p>
256257
*/

0 commit comments

Comments
 (0)