Skip to content

Commit

Permalink
Merge pull request #940 from aws/staging/51dc7e8b-a401-45ca-8f22-1995…
Browse files Browse the repository at this point in the history
…7724b650

Pull request: release <- staging/51dc7e8b-a401-45ca-8f22-19957724b650
  • Loading branch information
aws-sdk-java-automation authored Aug 28, 2020
2 parents b8c61b4 + 212a922 commit 7ce6281
Show file tree
Hide file tree
Showing 298 changed files with 1,502 additions and 309 deletions.
31 changes: 31 additions & 0 deletions .changes/2.14.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": "2.14.7",
"date": "2020-08-28",
"entries": [
{
"type": "feature",
"category": "AWS Cost and Usage Report Service",
"description": "This release add MONTHLY as the new supported TimeUnit for ReportDefinition."
},
{
"type": "feature",
"category": "Amazon CloudFront",
"description": "You can now manage CloudFront's additional, real-time metrics with the CloudFront API."
},
{
"type": "feature",
"category": "Amazon Route 53",
"description": "Documentation updates for Route 53"
},
{
"type": "feature",
"category": "Amazon Elastic MapReduce",
"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."
},
{
"type": "feature",
"category": "AWS SDK for Java v2",
"description": "Updated service endpoint metadata."
}
]
}
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# __2.14.7__ __2020-08-28__
## __AWS Cost and Usage Report Service__
- ### Features
- This release add MONTHLY as the new supported TimeUnit for ReportDefinition.

## __AWS SDK for Java v2__
- ### Features
- Updated service endpoint metadata.

## __Amazon CloudFront__
- ### Features
- You can now manage CloudFront's additional, real-time metrics with the CloudFront API.

## __Amazon Elastic MapReduce__
- ### Features
- 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.

## __Amazon Route 53__
- ### Features
- Documentation updates for Route 53

# __2.14.6__ __2020-08-27__
## __AWS Elemental MediaConvert__
- ### Features
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To automatically manage module versions (currently all modules have the same ver
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -83,12 +83,12 @@ Alternatively you can add dependencies for the specific services you use only:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ec2</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
</dependency>
```

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

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-lambda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.14.6</version>
<version>2.14.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetype-lambda</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.14.6</version>
<version>2.14.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetypes</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>aws-sdk-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.14.6</version>
<version>2.14.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
</parent>
<artifactId>bundle</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-lite-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
</parent>
<artifactId>codegen-lite</artifactId>
<name>AWS Java SDK :: Code Generator Lite</name>
Expand Down
2 changes: 1 addition & 1 deletion codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.14.6</version>
<version>2.14.7</version>
</parent>
<artifactId>codegen</artifactId>
<name>AWS Java SDK :: Code Generator</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ public class CustomizationConfig {
*/
private boolean enableEndpointDiscoveryMethodRequired = false;

/**
* Allow a customer to set an endpoint override AND bypass endpoint discovery on their client even when endpoint discovery
* enabled is true and endpoint discovery is required for an operation. This customization should almost never be "true"
* because it creates a confusing customer experience.
*/
private boolean allowEndpointOverrideForEndpointDiscoveryRequiredOperations = false;

private CustomizationConfig() {
}

Expand Down Expand Up @@ -420,4 +427,14 @@ public boolean isEnableEndpointDiscoveryMethodRequired() {
public void setEnableEndpointDiscoveryMethodRequired(boolean enableEndpointDiscoveryMethodRequired) {
this.enableEndpointDiscoveryMethodRequired = enableEndpointDiscoveryMethodRequired;
}

public boolean allowEndpointOverrideForEndpointDiscoveryRequiredOperations() {
return allowEndpointOverrideForEndpointDiscoveryRequiredOperations;
}

public void setAllowEndpointOverrideForEndpointDiscoveryRequiredOperations(
boolean allowEndpointOverrideForEndpointDiscoveryRequiredOperations) {
this.allowEndpointOverrideForEndpointDiscoveryRequiredOperations =
allowEndpointOverrideForEndpointDiscoveryRequiredOperations;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ private MethodSpec constructor(Builder classBuilder) {
EndpointDiscoveryRefreshCache.class,
poetExtensions.getClientClass(model.getNamingStrategy().getServiceName() +
"AsyncEndpointDiscoveryCacheLoader"));

if (model.getCustomizationConfig().allowEndpointOverrideForEndpointDiscoveryRequiredOperations()) {
builder.beginControlFlow("if (clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == "
+ "Boolean.TRUE)");
builder.addStatement("log.warn($S)",
"Endpoint discovery is enabled for this client, and an endpoint override was also "
+ "specified. This will disable endpoint discovery for methods that require it, instead "
+ "using the specified endpoint override. This may or may not be what you intended.");
builder.endControlFlow();
}

builder.endControlFlow();
}

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

if (opModel.getEndpointDiscovery() != null) {
builder.addStatement("boolean endpointDiscoveryEnabled = "
+ "clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED)");
builder.addStatement("boolean endpointOverridden = "
+ "clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == Boolean.TRUE");

if (opModel.getEndpointDiscovery().isRequired()) {
if (!model.getCustomizationConfig().allowEndpointOverrideForEndpointDiscoveryRequiredOperations()) {
builder.beginControlFlow("if (endpointOverridden)");
builder.addStatement("throw new $T($S)", IllegalStateException.class,
"This operation requires endpoint discovery, but an endpoint override was specified "
+ "when the client was created. This is not supported.");
builder.endControlFlow();

builder.beginControlFlow("if (!endpointDiscoveryEnabled)");
builder.addStatement("throw new $T($S)", IllegalStateException.class,
"This operation requires endpoint discovery, but endpoint discovery was disabled on the "
+ "client.");
builder.endControlFlow();
} else {
builder.beginControlFlow("if (endpointOverridden)");
builder.addStatement("endpointDiscoveryEnabled = false");
builder.nextControlFlow("else if (!endpointDiscoveryEnabled)");
builder.addStatement("throw new $T($S)", IllegalStateException.class,
"This operation requires endpoint discovery to be enabled, or for you to specify an "
+ "endpoint override when the client is created.");
builder.endControlFlow();
}
}

builder.addStatement("$T cachedEndpoint = null", URI.class);
builder.beginControlFlow("if (clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED))");
builder.beginControlFlow("if (endpointDiscoveryEnabled)");
builder.addStatement("\n\nString key = clientConfiguration.option($T.CREDENTIALS_PROVIDER).resolveCredentials()" +
".accessKeyId()", AwsClientOption.class);
builder.addStatement("EndpointDiscoveryRequest endpointDiscoveryRequest = $T.builder().required($L)" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.utils.Logger;

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

private FieldSpec logger() {
return FieldSpec.builder(Logger.class, "log", PRIVATE, STATIC, FINAL)
.initializer("$T.loggerFor($T.class)", Logger.class, className)
.build();
}

private MethodSpec nameMethod() {
return MethodSpec.methodBuilder("serviceName")
.addAnnotation(Override.class)
Expand Down Expand Up @@ -154,6 +162,17 @@ private MethodSpec constructor() {
EndpointDiscoveryRefreshCache.class,
poetExtensions.getClientClass(model.getNamingStrategy().getServiceName() +
"EndpointDiscoveryCacheLoader"));

if (model.getCustomizationConfig().allowEndpointOverrideForEndpointDiscoveryRequiredOperations()) {
builder.beginControlFlow("if (clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == "
+ "Boolean.TRUE)");
builder.addStatement("log.warn(() -> $S)",
"Endpoint discovery is enabled for this client, and an endpoint override was also "
+ "specified. This will disable endpoint discovery for methods that require it, instead "
+ "using the specified endpoint override. This may or may not be what you intended.");
builder.endControlFlow();
}

builder.endControlFlow();
}

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

if (opModel.getEndpointDiscovery() != null) {
method.addStatement("boolean endpointDiscoveryEnabled = "
+ "clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED)");
method.addStatement("boolean endpointOverridden = "
+ "clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == Boolean.TRUE");

if (opModel.getEndpointDiscovery().isRequired()) {
if (!model.getCustomizationConfig().allowEndpointOverrideForEndpointDiscoveryRequiredOperations()) {
method.beginControlFlow("if (endpointOverridden)");
method.addStatement("throw new $T($S)", IllegalStateException.class,
"This operation requires endpoint discovery, but an endpoint override was specified "
+ "when the client was created. This is not supported.");
method.endControlFlow();

method.beginControlFlow("if (!endpointDiscoveryEnabled)");
method.addStatement("throw new $T($S)", IllegalStateException.class,
"This operation requires endpoint discovery, but endpoint discovery was disabled on the "
+ "client.");
method.endControlFlow();
} else {
method.beginControlFlow("if (endpointOverridden)");
method.addStatement("endpointDiscoveryEnabled = false");
method.nextControlFlow("else if (!endpointDiscoveryEnabled)");
method.addStatement("throw new $T($S)", IllegalStateException.class,
"This operation requires endpoint discovery to be enabled, or for you to specify an "
+ "endpoint override when the client is created.");
method.endControlFlow();
}
}

method.addStatement("$T cachedEndpoint = null", URI.class);
method.beginControlFlow("if (clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED))");
method.beginControlFlow("if (endpointDiscoveryEnabled)");
method.addStatement("\n\nString key = clientConfiguration.option($T.CREDENTIALS_PROVIDER)." +
"resolveCredentials().accessKeyId()", AwsClientOption.class);
method.addStatement("EndpointDiscoveryRequest endpointDiscoveryRequest = $T.builder().required($L)" +
Expand Down
Loading

0 comments on commit 7ce6281

Please sign in to comment.