Skip to content

Commit 93702d0

Browse files
aws-sdk-java-automationdagnirjoviegas
authored
Pull request: release <- staging/31d9787e-9a7d-4544-bbf2-ffb44eac702a (#2467)
* Update to next snapshot version: 2.20.49-SNAPSHOT * Fix flaky IMDS client test (#3912) This test should be less flaky since the mock client should never trigger the retry logic in the IMDS client by sometimes returning a 500. * Add TrustAllCertificates in CRT S3 Client options (#3903) * Add TrustAllCertificates in CRT S3 Client options * Handled PR comments * Amazon Relational Database Service Update: Adds support for the ImageId parameter of CreateCustomDBEngineVersion to RDS Custom for Oracle * AWS SecurityHub Update: Update that adds SDK code examples for Security Hub * Amazon Comprehend Update: This release supports native document models for custom classification, in addition to plain-text models. You train native document models using documents (PDF, Word, images) in their native format. * Amazon Simple Storage Service Update: Provides support for "Snow" Storage class. * Amazon EC2 Container Service Update: This release supports the Account Setting "TagResourceAuthorization" that allows for enhanced Tagging security controls. * AWS Secrets Manager Update: Documentation updates for Secrets Manager * AWS S3 Control Update: Provides support for overriding endpoint when region is "snow". This will enable bucket APIs for Amazon S3 Compatible storage on Snow Family devices. * AWS Resource Access Manager Update: This release adds support for customer managed permissions. Customer managed permissions enable customers to author and manage tailored permissions for resources shared using RAM. * Updated endpoints.json and partitions.json. * Release 2.20.49. Updated CHANGELOG.md, README.md and all pom.xml. --------- Co-authored-by: AWS <> Co-authored-by: Dongie Agnir <[email protected]> Co-authored-by: John Viegas <[email protected]>
1 parent 017de2b commit 93702d0

File tree

426 files changed

+2662
-1227
lines changed

Some content is hidden

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

426 files changed

+2662
-1227
lines changed

.changes/2.20.49.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"version": "2.20.49",
3+
"date": "2023-04-19",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "AWS Resource Access Manager",
8+
"contributor": "",
9+
"description": "This release adds support for customer managed permissions. Customer managed permissions enable customers to author and manage tailored permissions for resources shared using RAM."
10+
},
11+
{
12+
"type": "feature",
13+
"category": "AWS S3 Control",
14+
"contributor": "",
15+
"description": "Provides support for overriding endpoint when region is \"snow\". This will enable bucket APIs for Amazon S3 Compatible storage on Snow Family devices."
16+
},
17+
{
18+
"type": "feature",
19+
"category": "AWS SDK for Java v2",
20+
"contributor": "",
21+
"description": "API to Add TrustAllCertificates in CRT S3 Client options for test purposes"
22+
},
23+
{
24+
"type": "feature",
25+
"category": "AWS Secrets Manager",
26+
"contributor": "",
27+
"description": "Documentation updates for Secrets Manager"
28+
},
29+
{
30+
"type": "feature",
31+
"category": "AWS SecurityHub",
32+
"contributor": "",
33+
"description": "Update that adds SDK code examples for Security Hub"
34+
},
35+
{
36+
"type": "feature",
37+
"category": "Amazon Comprehend",
38+
"contributor": "",
39+
"description": "This release supports native document models for custom classification, in addition to plain-text models. You train native document models using documents (PDF, Word, images) in their native format."
40+
},
41+
{
42+
"type": "feature",
43+
"category": "Amazon EC2 Container Service",
44+
"contributor": "",
45+
"description": "This release supports the Account Setting \"TagResourceAuthorization\" that allows for enhanced Tagging security controls."
46+
},
47+
{
48+
"type": "feature",
49+
"category": "Amazon Relational Database Service",
50+
"contributor": "",
51+
"description": "Adds support for the ImageId parameter of CreateCustomDBEngineVersion to RDS Custom for Oracle"
52+
},
53+
{
54+
"type": "feature",
55+
"category": "Amazon Simple Storage Service",
56+
"contributor": "",
57+
"description": "Provides support for \"Snow\" Storage class."
58+
},
59+
{
60+
"type": "feature",
61+
"category": "AWS SDK for Java v2",
62+
"contributor": "",
63+
"description": "Updated endpoint and partition metadata."
64+
}
65+
]
66+
}

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
# __2.20.49__ __2023-04-19__
2+
## __AWS Resource Access Manager__
3+
- ### Features
4+
- This release adds support for customer managed permissions. Customer managed permissions enable customers to author and manage tailored permissions for resources shared using RAM.
5+
6+
## __AWS S3 Control__
7+
- ### Features
8+
- Provides support for overriding endpoint when region is "snow". This will enable bucket APIs for Amazon S3 Compatible storage on Snow Family devices.
9+
10+
## __AWS SDK for Java v2__
11+
- ### Features
12+
- API to Add TrustAllCertificates in CRT S3 Client options for test purposes
13+
- Updated endpoint and partition metadata.
14+
15+
## __AWS Secrets Manager__
16+
- ### Features
17+
- Documentation updates for Secrets Manager
18+
19+
## __AWS SecurityHub__
20+
- ### Features
21+
- Update that adds SDK code examples for Security Hub
22+
23+
## __Amazon Comprehend__
24+
- ### Features
25+
- This release supports native document models for custom classification, in addition to plain-text models. You train native document models using documents (PDF, Word, images) in their native format.
26+
27+
## __Amazon EC2 Container Service__
28+
- ### Features
29+
- This release supports the Account Setting "TagResourceAuthorization" that allows for enhanced Tagging security controls.
30+
31+
## __Amazon Relational Database Service__
32+
- ### Features
33+
- Adds support for the ImageId parameter of CreateCustomDBEngineVersion to RDS Custom for Oracle
34+
35+
## __Amazon Simple Storage Service__
36+
- ### Features
37+
- Provides support for "Snow" Storage class.
38+
139
# __2.20.48__ __2023-04-17__
240
## __AWS IoT Wireless__
341
- ### 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.20.48</version>
55+
<version>2.20.49</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.20.48</version>
89+
<version>2.20.49</version>
9090
</dependency>
9191
<dependency>
9292
<groupId>software.amazon.awssdk</groupId>
9393
<artifactId>s3</artifactId>
94-
<version>2.20.48</version>
94+
<version>2.20.49</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.20.48</version>
106+
<version>2.20.49</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.20.48</version>
23+
<version>2.20.49</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.20.48</version>
23+
<version>2.20.49</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.20.48</version>
23+
<version>2.20.49</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.20.48</version>
23+
<version>2.20.49</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.20.48</version>
20+
<version>2.20.49</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.20.48</version>
23+
<version>2.20.49</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.20.48</version>
20+
<version>2.20.49</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.20.48</version>
24+
<version>2.20.49</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.20.48</version>
25+
<version>2.20.49</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.20.48</version>
24+
<version>2.20.49</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.20.48</version>
25+
<version>2.20.49</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.20.48</version>
24+
<version>2.20.49</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.20.48</version>
23+
<version>2.20.49</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.20.48</version>
23+
<version>2.20.49</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.20.48</version>
25+
<version>2.20.49</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.20.48</version>
25+
<version>2.20.49</version>
2626
</parent>
2727

2828
<artifactId>auth</artifactId>

core/aws-core/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.20.48</version>
25+
<version>2.20.49</version>
2626
</parent>
2727

2828
<artifactId>aws-core</artifactId>

core/crt-core/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>core</artifactId>
24-
<version>2.20.48</version>
24+
<version>2.20.49</version>
2525
</parent>
2626

2727
<artifactId>crt-core</artifactId>

core/endpoints-spi/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.20.48</version>
23+
<version>2.20.49</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/imds/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.20.48</version>
23+
<version>2.20.49</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>imds</artifactId>

core/imds/src/test/java/software/amazon/awssdk/imds/internal/CachedTokenClientTest.java

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,32 @@
2828
import static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;
2929
import static org.assertj.core.api.Assertions.assertThat;
3030
import static org.assertj.core.api.Assertions.assertThatThrownBy;
31+
import static org.mockito.ArgumentMatchers.any;
32+
import static org.mockito.Mockito.mock;
33+
import static org.mockito.Mockito.when;
3134
import static software.amazon.awssdk.imds.TestConstants.EC2_METADATA_TOKEN_TTL_HEADER;
3235

3336
import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
3437
import com.github.tomakehurst.wiremock.junit5.WireMockTest;
38+
import java.io.ByteArrayInputStream;
39+
import java.io.IOException;
3540
import java.net.URI;
41+
import java.nio.charset.StandardCharsets;
3642
import java.time.Duration;
3743
import org.junit.jupiter.api.AfterEach;
3844
import org.junit.jupiter.api.BeforeEach;
3945
import org.junit.jupiter.api.Test;
46+
import org.mockito.ArgumentCaptor;
47+
import org.mockito.Mockito;
4048
import software.amazon.awssdk.core.exception.SdkClientException;
49+
import software.amazon.awssdk.http.AbortableInputStream;
50+
import software.amazon.awssdk.http.ExecutableHttpRequest;
51+
import software.amazon.awssdk.http.HttpExecuteRequest;
52+
import software.amazon.awssdk.http.HttpExecuteResponse;
53+
import software.amazon.awssdk.http.SdkHttpClient;
54+
import software.amazon.awssdk.http.SdkHttpFullResponse;
55+
import software.amazon.awssdk.http.SdkHttpRequest;
56+
import software.amazon.awssdk.http.SdkHttpResponse;
4157
import software.amazon.awssdk.imds.Ec2MetadataClient;
4258
import software.amazon.awssdk.imds.Ec2MetadataResponse;
4359

@@ -58,13 +74,31 @@ void tearDown(WireMockRuntimeInfo wmRuntimeInfo) {
5874
}
5975

6076
@Test
61-
void get_tokenFailsError4xx_shouldNotRetry() {
62-
stubFor(put(urlPathEqualTo("/latest/api/token")).willReturn(aResponse().withStatus(400).withBody("ERROR 400")));
63-
stubFor(get(urlPathEqualTo("/latest/meta-data/ami-id")).willReturn(aResponse().withBody("{}")));
64-
65-
assertThatThrownBy(() -> clientBuilder.build().get("/latest/meta-data/ami-id")).isInstanceOf(SdkClientException.class);
66-
verify(exactly(1), putRequestedFor(urlPathEqualTo("/latest/api/token"))
67-
.withHeader("x-aws-ec2-metadata-token-ttl-seconds", equalTo("21600")));
77+
void get_tokenFailsError4xx_shouldNotRetry() throws IOException {
78+
SdkHttpClient mockClient = mock(SdkHttpClient.class);
79+
ExecutableHttpRequest mockRequest = mock(ExecutableHttpRequest.class);
80+
when(mockClient.prepareRequest(any(HttpExecuteRequest.class))).thenReturn(mockRequest);
81+
82+
AbortableInputStream content =
83+
AbortableInputStream.create(new ByteArrayInputStream("ERROR 400".getBytes(StandardCharsets.UTF_8)));
84+
SdkHttpResponse httpResponse = SdkHttpFullResponse.builder()
85+
.statusCode(400)
86+
.build();
87+
HttpExecuteResponse executeResponse = HttpExecuteResponse.builder()
88+
.response(httpResponse)
89+
.responseBody(content)
90+
.build();
91+
when(mockRequest.call()).thenReturn(executeResponse);
92+
93+
Ec2MetadataClient imdsClient = Ec2MetadataClient.builder().httpClient(mockClient).build();
94+
95+
assertThatThrownBy(() ->imdsClient.get("/latest/meta-data/ami-id")).isInstanceOf(SdkClientException.class);
96+
97+
ArgumentCaptor<HttpExecuteRequest> requestCaptor = ArgumentCaptor.forClass(HttpExecuteRequest.class);
98+
Mockito.verify(mockClient).prepareRequest(requestCaptor.capture());
99+
SdkHttpRequest httpRequest = requestCaptor.getValue().httpRequest();
100+
assertThat(httpRequest.encodedPath()).isEqualTo("/latest/api/token");
101+
assertThat(httpRequest.firstMatchingHeader("x-aws-ec2-metadata-token-ttl-seconds").get()).isEqualTo("21600");
68102
}
69103

70104
@Test

0 commit comments

Comments
 (0)