Skip to content

Commit 7ce6281

Browse files
Merge pull request #940 from aws/staging/51dc7e8b-a401-45ca-8f22-19957724b650
Pull request: release <- staging/51dc7e8b-a401-45ca-8f22-19957724b650
2 parents b8c61b4 + 212a922 commit 7ce6281

File tree

298 files changed

+1502
-309
lines changed

Some content is hidden

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

298 files changed

+1502
-309
lines changed

.changes/2.14.7.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"version": "2.14.7",
3+
"date": "2020-08-28",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "AWS Cost and Usage Report Service",
8+
"description": "This release add MONTHLY as the new supported TimeUnit for ReportDefinition."
9+
},
10+
{
11+
"type": "feature",
12+
"category": "Amazon CloudFront",
13+
"description": "You can now manage CloudFront's additional, real-time metrics with the CloudFront API."
14+
},
15+
{
16+
"type": "feature",
17+
"category": "Amazon Route 53",
18+
"description": "Documentation updates for Route 53"
19+
},
20+
{
21+
"type": "feature",
22+
"category": "Amazon Elastic MapReduce",
23+
"description": "Amazon EMR adds support for ICMP, port -1, in Block Public Access Exceptions and API access for EMR Notebooks execution. You can now non-interactively execute EMR Notebooks and pass input parameters."
24+
},
25+
{
26+
"type": "feature",
27+
"category": "AWS SDK for Java v2",
28+
"description": "Updated service endpoint metadata."
29+
}
30+
]
31+
}

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# __2.14.7__ __2020-08-28__
2+
## __AWS Cost and Usage Report Service__
3+
- ### Features
4+
- This release add MONTHLY as the new supported TimeUnit for ReportDefinition.
5+
6+
## __AWS SDK for Java v2__
7+
- ### Features
8+
- Updated service endpoint metadata.
9+
10+
## __Amazon CloudFront__
11+
- ### Features
12+
- You can now manage CloudFront's additional, real-time metrics with the CloudFront API.
13+
14+
## __Amazon Elastic MapReduce__
15+
- ### Features
16+
- Amazon EMR adds support for ICMP, port -1, in Block Public Access Exceptions and API access for EMR Notebooks execution. You can now non-interactively execute EMR Notebooks and pass input parameters.
17+
18+
## __Amazon Route 53__
19+
- ### Features
20+
- Documentation updates for Route 53
21+
122
# __2.14.6__ __2020-08-27__
223
## __AWS Elemental MediaConvert__
324
- ### Features

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To automatically manage module versions (currently all modules have the same ver
4949
<dependency>
5050
<groupId>software.amazon.awssdk</groupId>
5151
<artifactId>bom</artifactId>
52-
<version>2.14.6</version>
52+
<version>2.14.7</version>
5353
<type>pom</type>
5454
<scope>import</scope>
5555
</dependency>
@@ -83,12 +83,12 @@ Alternatively you can add dependencies for the specific services you use only:
8383
<dependency>
8484
<groupId>software.amazon.awssdk</groupId>
8585
<artifactId>ec2</artifactId>
86-
<version>2.14.6</version>
86+
<version>2.14.7</version>
8787
</dependency>
8888
<dependency>
8989
<groupId>software.amazon.awssdk</groupId>
9090
<artifactId>s3</artifactId>
91-
<version>2.14.6</version>
91+
<version>2.14.7</version>
9292
</dependency>
9393
```
9494

@@ -100,7 +100,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
100100
<dependency>
101101
<groupId>software.amazon.awssdk</groupId>
102102
<artifactId>aws-sdk-java</artifactId>
103-
<version>2.14.6</version>
103+
<version>2.14.7</version>
104104
</dependency>
105105
```
106106

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.14.6</version>
23+
<version>2.14.7</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetype-lambda</artifactId>

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.14.6</version>
23+
<version>2.14.7</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.14.6</version>
20+
<version>2.14.7</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.14.6</version>
23+
<version>2.14.7</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.14.6</version>
20+
<version>2.14.7</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.14.6</version>
24+
<version>2.14.7</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.14.6</version>
25+
<version>2.14.7</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.14.6</version>
24+
<version>2.14.7</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.14.6</version>
25+
<version>2.14.7</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.14.6</version>
24+
<version>2.14.7</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ public class CustomizationConfig {
165165
*/
166166
private boolean enableEndpointDiscoveryMethodRequired = false;
167167

168+
/**
169+
* Allow a customer to set an endpoint override AND bypass endpoint discovery on their client even when endpoint discovery
170+
* enabled is true and endpoint discovery is required for an operation. This customization should almost never be "true"
171+
* because it creates a confusing customer experience.
172+
*/
173+
private boolean allowEndpointOverrideForEndpointDiscoveryRequiredOperations = false;
174+
168175
private CustomizationConfig() {
169176
}
170177

@@ -420,4 +427,14 @@ public boolean isEnableEndpointDiscoveryMethodRequired() {
420427
public void setEnableEndpointDiscoveryMethodRequired(boolean enableEndpointDiscoveryMethodRequired) {
421428
this.enableEndpointDiscoveryMethodRequired = enableEndpointDiscoveryMethodRequired;
422429
}
430+
431+
public boolean allowEndpointOverrideForEndpointDiscoveryRequiredOperations() {
432+
return allowEndpointOverrideForEndpointDiscoveryRequiredOperations;
433+
}
434+
435+
public void setAllowEndpointOverrideForEndpointDiscoveryRequiredOperations(
436+
boolean allowEndpointOverrideForEndpointDiscoveryRequiredOperations) {
437+
this.allowEndpointOverrideForEndpointDiscoveryRequiredOperations =
438+
allowEndpointOverrideForEndpointDiscoveryRequiredOperations;
439+
}
423440
}

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/AsyncClientClass.java

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ private MethodSpec constructor(Builder classBuilder) {
166166
EndpointDiscoveryRefreshCache.class,
167167
poetExtensions.getClientClass(model.getNamingStrategy().getServiceName() +
168168
"AsyncEndpointDiscoveryCacheLoader"));
169+
170+
if (model.getCustomizationConfig().allowEndpointOverrideForEndpointDiscoveryRequiredOperations()) {
171+
builder.beginControlFlow("if (clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == "
172+
+ "Boolean.TRUE)");
173+
builder.addStatement("log.warn($S)",
174+
"Endpoint discovery is enabled for this client, and an endpoint override was also "
175+
+ "specified. This will disable endpoint discovery for methods that require it, instead "
176+
+ "using the specified endpoint override. This may or may not be what you intended.");
177+
builder.endControlFlow();
178+
}
179+
169180
builder.endControlFlow();
170181
}
171182

@@ -220,8 +231,37 @@ protected MethodSpec.Builder operationBody(MethodSpec.Builder builder, Operation
220231
builder.addCode(eventToByteBufferPublisher(opModel));
221232

222233
if (opModel.getEndpointDiscovery() != null) {
234+
builder.addStatement("boolean endpointDiscoveryEnabled = "
235+
+ "clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED)");
236+
builder.addStatement("boolean endpointOverridden = "
237+
+ "clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == Boolean.TRUE");
238+
239+
if (opModel.getEndpointDiscovery().isRequired()) {
240+
if (!model.getCustomizationConfig().allowEndpointOverrideForEndpointDiscoveryRequiredOperations()) {
241+
builder.beginControlFlow("if (endpointOverridden)");
242+
builder.addStatement("throw new $T($S)", IllegalStateException.class,
243+
"This operation requires endpoint discovery, but an endpoint override was specified "
244+
+ "when the client was created. This is not supported.");
245+
builder.endControlFlow();
246+
247+
builder.beginControlFlow("if (!endpointDiscoveryEnabled)");
248+
builder.addStatement("throw new $T($S)", IllegalStateException.class,
249+
"This operation requires endpoint discovery, but endpoint discovery was disabled on the "
250+
+ "client.");
251+
builder.endControlFlow();
252+
} else {
253+
builder.beginControlFlow("if (endpointOverridden)");
254+
builder.addStatement("endpointDiscoveryEnabled = false");
255+
builder.nextControlFlow("else if (!endpointDiscoveryEnabled)");
256+
builder.addStatement("throw new $T($S)", IllegalStateException.class,
257+
"This operation requires endpoint discovery to be enabled, or for you to specify an "
258+
+ "endpoint override when the client is created.");
259+
builder.endControlFlow();
260+
}
261+
}
262+
223263
builder.addStatement("$T cachedEndpoint = null", URI.class);
224-
builder.beginControlFlow("if (clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED))");
264+
builder.beginControlFlow("if (endpointDiscoveryEnabled)");
225265
builder.addStatement("\n\nString key = clientConfiguration.option($T.CREDENTIALS_PROVIDER).resolveCredentials()" +
226266
".accessKeyId()", AwsClientOption.class);
227267
builder.addStatement("EndpointDiscoveryRequest endpointDiscoveryRequest = $T.builder().required($L)" +

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import software.amazon.awssdk.metrics.MetricCollector;
6161
import software.amazon.awssdk.metrics.MetricPublisher;
6262
import software.amazon.awssdk.metrics.NoOpMetricCollector;
63+
import software.amazon.awssdk.utils.Logger;
6364

6465
//TODO Make SyncClientClass extend SyncClientInterface (similar to what we do in AsyncClientClass)
6566
public class SyncClientClass implements ClassSpec {
@@ -86,6 +87,7 @@ public TypeSpec poetSpec() {
8687
.addSuperinterface(interfaceClass)
8788
.addJavadoc("Internal implementation of {@link $1T}.\n\n@see $1T#builder()",
8889
interfaceClass)
90+
.addField(logger())
8991
.addField(SyncClientHandler.class, "clientHandler", PRIVATE, FINAL)
9092
.addField(protocolSpec.protocolFactory(model))
9193
.addField(SdkClientConfiguration.class, "clientConfiguration", PRIVATE, FINAL)
@@ -119,6 +121,12 @@ public TypeSpec poetSpec() {
119121
return classBuilder.build();
120122
}
121123

124+
private FieldSpec logger() {
125+
return FieldSpec.builder(Logger.class, "log", PRIVATE, STATIC, FINAL)
126+
.initializer("$T.loggerFor($T.class)", Logger.class, className)
127+
.build();
128+
}
129+
122130
private MethodSpec nameMethod() {
123131
return MethodSpec.methodBuilder("serviceName")
124132
.addAnnotation(Override.class)
@@ -154,6 +162,17 @@ private MethodSpec constructor() {
154162
EndpointDiscoveryRefreshCache.class,
155163
poetExtensions.getClientClass(model.getNamingStrategy().getServiceName() +
156164
"EndpointDiscoveryCacheLoader"));
165+
166+
if (model.getCustomizationConfig().allowEndpointOverrideForEndpointDiscoveryRequiredOperations()) {
167+
builder.beginControlFlow("if (clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == "
168+
+ "Boolean.TRUE)");
169+
builder.addStatement("log.warn(() -> $S)",
170+
"Endpoint discovery is enabled for this client, and an endpoint override was also "
171+
+ "specified. This will disable endpoint discovery for methods that require it, instead "
172+
+ "using the specified endpoint override. This may or may not be what you intended.");
173+
builder.endControlFlow();
174+
}
175+
157176
builder.endControlFlow();
158177
}
159178

@@ -181,8 +200,37 @@ private List<MethodSpec> operationMethodSpecs(OperationModel opModel) {
181200
protocolSpec.errorResponseHandler(opModel).ifPresent(method::addCode);
182201

183202
if (opModel.getEndpointDiscovery() != null) {
203+
method.addStatement("boolean endpointDiscoveryEnabled = "
204+
+ "clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED)");
205+
method.addStatement("boolean endpointOverridden = "
206+
+ "clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == Boolean.TRUE");
207+
208+
if (opModel.getEndpointDiscovery().isRequired()) {
209+
if (!model.getCustomizationConfig().allowEndpointOverrideForEndpointDiscoveryRequiredOperations()) {
210+
method.beginControlFlow("if (endpointOverridden)");
211+
method.addStatement("throw new $T($S)", IllegalStateException.class,
212+
"This operation requires endpoint discovery, but an endpoint override was specified "
213+
+ "when the client was created. This is not supported.");
214+
method.endControlFlow();
215+
216+
method.beginControlFlow("if (!endpointDiscoveryEnabled)");
217+
method.addStatement("throw new $T($S)", IllegalStateException.class,
218+
"This operation requires endpoint discovery, but endpoint discovery was disabled on the "
219+
+ "client.");
220+
method.endControlFlow();
221+
} else {
222+
method.beginControlFlow("if (endpointOverridden)");
223+
method.addStatement("endpointDiscoveryEnabled = false");
224+
method.nextControlFlow("else if (!endpointDiscoveryEnabled)");
225+
method.addStatement("throw new $T($S)", IllegalStateException.class,
226+
"This operation requires endpoint discovery to be enabled, or for you to specify an "
227+
+ "endpoint override when the client is created.");
228+
method.endControlFlow();
229+
}
230+
}
231+
184232
method.addStatement("$T cachedEndpoint = null", URI.class);
185-
method.beginControlFlow("if (clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED))");
233+
method.beginControlFlow("if (endpointDiscoveryEnabled)");
186234
method.addStatement("\n\nString key = clientConfiguration.option($T.CREDENTIALS_PROVIDER)." +
187235
"resolveCredentials().accessKeyId()", AwsClientOption.class);
188236
method.addStatement("EndpointDiscoveryRequest endpointDiscoveryRequest = $T.builder().required($L)" +

0 commit comments

Comments
 (0)