Skip to content

Commit ba7466f

Browse files
Merge pull request #723 from aws/staging/6b422956-0a82-430b-920b-9bcbac422702
Pull request: release <- staging/6b422956-0a82-430b-920b-9bcbac422702
2 parents 8a571ee + e1b7747 commit ba7466f

File tree

364 files changed

+5541
-1013
lines changed

Some content is hidden

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

364 files changed

+5541
-1013
lines changed

.changes/2.10.55.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.10.55",
3+
"date": "2020-01-23",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "Amazon Relational Database Service",
8+
"description": "This SDK release introduces APIs that automate the export of Amazon RDS snapshot data to Amazon S3. The new APIs include: StartExportTask, CancelExportTask, DescribeExportTasks. These APIs automate the extraction of data from an RDS snapshot and export it to an Amazon S3 bucket. The data is stored in a compressed, consistent, and query-able format. After the data is exported, you can query it directly using tools such as Amazon Athena or Redshift Spectrum. You can also consume the data as part of a data lake solution. If you archive the data in S3 Infrequent Access or Glacier, you can reduce long term data storage costs by applying data lifecycle policies."
9+
},
10+
{
11+
"type": "feature",
12+
"category": "AWS SDK for Java v2",
13+
"description": "Updated service endpoint metadata."
14+
},
15+
{
16+
"type": "feature",
17+
"category": "AWS SDK for Java v2",
18+
"description": "Added ServiceMetadata.servicePartitions() to get partition metadata for a specific service"
19+
},
20+
{
21+
"type": "feature",
22+
"category": "AWS Identity and Access Management",
23+
"description": "This release enables the Identity and Access Management policy simulator to simulate permissions boundary policies."
24+
},
25+
{
26+
"type": "feature",
27+
"category": "Amazon DynamoDB Enhanced Client [Preview]",
28+
"description": "Support for non-blocking asynchronous calling of all mapper operations"
29+
},
30+
{
31+
"type": "feature",
32+
"category": "AWS SDK for Java v2",
33+
"description": "Improved error messages on UnknownHostExceptions"
34+
}
35+
]
36+
}

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# __2.10.55__ __2020-01-23__
2+
## __AWS Identity and Access Management__
3+
- ### Features
4+
- This release enables the Identity and Access Management policy simulator to simulate permissions boundary policies.
5+
6+
## __AWS SDK for Java v2__
7+
- ### Features
8+
- Added ServiceMetadata.servicePartitions() to get partition metadata for a specific service
9+
- Improved error messages on UnknownHostExceptions
10+
- Updated service endpoint metadata.
11+
12+
## __Amazon DynamoDB Enhanced Client [Preview]__
13+
- ### Features
14+
- Support for non-blocking asynchronous calling of all mapper operations
15+
16+
## __Amazon Relational Database Service__
17+
- ### Features
18+
- This SDK release introduces APIs that automate the export of Amazon RDS snapshot data to Amazon S3. The new APIs include: StartExportTask, CancelExportTask, DescribeExportTasks. These APIs automate the extraction of data from an RDS snapshot and export it to an Amazon S3 bucket. The data is stored in a compressed, consistent, and query-able format. After the data is exported, you can query it directly using tools such as Amazon Athena or Redshift Spectrum. You can also consume the data as part of a data lake solution. If you archive the data in S3 Infrequent Access or Glacier, you can reduce long term data storage costs by applying data lifecycle policies.
19+
120
# __2.10.54__ __2020-01-21__
221
## __AWS Application Discovery Service__
322
- ### Features

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To automatically manage module versions (currently all modules have the same ver
4848
<dependency>
4949
<groupId>software.amazon.awssdk</groupId>
5050
<artifactId>bom</artifactId>
51-
<version>2.10.54</version>
51+
<version>2.10.55</version>
5252
<type>pom</type>
5353
<scope>import</scope>
5454
</dependency>
@@ -82,12 +82,12 @@ Alternatively you can add dependencies for the specific services you use only:
8282
<dependency>
8383
<groupId>software.amazon.awssdk</groupId>
8484
<artifactId>ec2</artifactId>
85-
<version>2.10.54</version>
85+
<version>2.10.55</version>
8686
</dependency>
8787
<dependency>
8888
<groupId>software.amazon.awssdk</groupId>
8989
<artifactId>s3</artifactId>
90-
<version>2.10.54</version>
90+
<version>2.10.55</version>
9191
</dependency>
9292
```
9393

@@ -99,7 +99,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
9999
<dependency>
100100
<groupId>software.amazon.awssdk</groupId>
101101
<artifactId>aws-sdk-java</artifactId>
102-
<version>2.10.54</version>
102+
<version>2.10.55</version>
103103
</dependency>
104104
```
105105

aws-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>software.amazon.awssdk</groupId>
2121
<artifactId>aws-sdk-java-pom</artifactId>
22-
<version>2.10.54</version>
22+
<version>2.10.55</version>
2323
<relativePath>../pom.xml</relativePath>
2424
</parent>
2525
<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.10.54</version>
23+
<version>2.10.55</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
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>software.amazon.awssdk</groupId>
2121
<artifactId>aws-sdk-java-pom</artifactId>
22-
<version>2.10.54</version>
22+
<version>2.10.55</version>
2323
<relativePath>../pom.xml</relativePath>
2424
</parent>
2525
<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.10.54</version>
24+
<version>2.10.55</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.10.54</version>
25+
<version>2.10.55</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite-maven-plugin/src/main/java/software/amazon/awssdk/codegen/lite/maven/plugin/RegionGenerationMojo.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ public void generateServiceMetadata(Path baseSourcesDirectory, Partitions partit
9494
Set<String> services = new HashSet<>();
9595
partitions.getPartitions().forEach(p -> services.addAll(p.getServices().keySet()));
9696

97-
services.stream()
98-
// Use hardcoded file for elasticache until the incorrect fips endpoint is fixed
99-
//TODO Remove once elasticache endpoints are fixed at source
100-
.filter(s -> !"elasticache".equals(s))
101-
.forEach(s -> new CodeGenerator(sourcesDirectory.toString(), new ServiceMetadataGenerator(partitions,
97+
services.forEach(s -> new CodeGenerator(sourcesDirectory.toString(), new ServiceMetadataGenerator(partitions,
10298
s,
10399
SERVICE_METADATA_BASE,
104100
REGION_BASE))

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.10.54</version>
24+
<version>2.10.55</version>
2525
</parent>
2626
<artifactId>codegen-lite</artifactId>
2727
<name>AWS Java SDK :: Code Generator Lite</name>

codegen-lite/src/main/java/software/amazon/awssdk/codegen/lite/regions/ServiceMetadataGenerator.java

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@
5050
public class ServiceMetadataGenerator implements PoetClass {
5151

5252
private final Partitions partitions;
53-
private final String service;
53+
private final String serviceEndpointPrefix;
5454
private final String basePackage;
5555
private final String regionBasePackage;
5656

5757
public ServiceMetadataGenerator(Partitions partitions,
58-
String service,
58+
String serviceEndpointPrefix,
5959
String basePackage,
6060
String regionBasePackage) {
6161
this.partitions = partitions;
62-
this.service = service;
62+
this.serviceEndpointPrefix = serviceEndpointPrefix;
6363
this.basePackage = basePackage;
6464
this.regionBasePackage = regionBasePackage;
6565
}
@@ -68,6 +68,8 @@ public ServiceMetadataGenerator(Partitions partitions,
6868
public TypeSpec poetClass() {
6969
TypeName listOfRegions = ParameterizedTypeName.get(ClassName.get(List.class), ClassName.get(regionBasePackage, "Region"));
7070
TypeName mapOfStringString = ParameterizedTypeName.get(Map.class, String.class, String.class);
71+
TypeName listOfServicePartitionMetadata =
72+
ParameterizedTypeName.get(ClassName.get(List.class), ClassName.get(regionBasePackage, "ServicePartitionMetadata"));
7173

7274
return TypeSpec.classBuilder(className())
7375
.addModifiers(Modifier.PUBLIC)
@@ -79,7 +81,7 @@ public TypeSpec poetClass() {
7981
.addSuperinterface(ClassName.get(regionBasePackage, "ServiceMetadata"))
8082
.addField(FieldSpec.builder(String.class, "ENDPOINT_PREFIX")
8183
.addModifiers(PRIVATE, FINAL, STATIC)
82-
.initializer("$S", service)
84+
.initializer("$S", serviceEndpointPrefix)
8385
.build())
8486
.addField(FieldSpec.builder(mapOfStringString, "PARTITION_OVERRIDDEN_ENDPOINTS")
8587
.addModifiers(PRIVATE, FINAL, STATIC)
@@ -97,15 +99,20 @@ public TypeSpec poetClass() {
9799
.addModifiers(PRIVATE, FINAL, STATIC)
98100
.initializer(signingRegionOverrides(partitions))
99101
.build())
102+
.addField(FieldSpec.builder(listOfServicePartitionMetadata, "PARTITIONS")
103+
.addModifiers(PRIVATE, FINAL, STATIC)
104+
.initializer(servicePartitions(partitions))
105+
.build())
100106
.addMethod(regions())
101107
.addMethod(endpointFor())
102108
.addMethod(signingRegion())
109+
.addMethod(partitions(listOfServicePartitionMetadata))
103110
.build();
104111
}
105112

106113
@Override
107114
public ClassName className() {
108-
String sanitizedServiceName = service.replace(".", "-");
115+
String sanitizedServiceName = serviceEndpointPrefix.replace(".", "-");
109116
return ClassName.get(basePackage, Stream.of(sanitizedServiceName.split("-"))
110117
.map(Utils::capitalize)
111118
.collect(Collectors.joining()) + "ServiceMetadata");
@@ -150,8 +157,8 @@ private CodeBlock regionsField(Partitions partitions) {
150157

151158
partitions.getPartitions()
152159
.stream()
153-
.filter(p -> p.getServices().containsKey(service))
154-
.forEach(p -> regions.addAll(p.getServices().get(service).getEndpoints().keySet()
160+
.filter(p -> p.getServices().containsKey(serviceEndpointPrefix))
161+
.forEach(p -> regions.addAll(p.getServices().get(serviceEndpointPrefix).getEndpoints().keySet()
155162
.stream()
156163
.filter(r -> RegionValidationUtil.validRegion(r, p.getRegionRegex()))
157164
.collect(Collectors.toList())));
@@ -185,6 +192,39 @@ private CodeBlock signingRegionOverrides(Partitions partitions) {
185192
return builder.add(".build()").build();
186193
}
187194

195+
private CodeBlock servicePartitions(Partitions partitions) {
196+
return CodeBlock.builder()
197+
.add("$T.unmodifiableList($T.asList(", Collections.class, Arrays.class)
198+
.add(commaSeparatedServicePartitions(partitions))
199+
.add("))")
200+
.build();
201+
}
202+
203+
private CodeBlock commaSeparatedServicePartitions(Partitions partitions) {
204+
ClassName defaultServicePartitionMetadata = ClassName.get(regionBasePackage + ".internal",
205+
"DefaultServicePartitionMetadata");
206+
return partitions.getPartitions()
207+
.stream()
208+
.filter(p -> p.getServices().containsKey(serviceEndpointPrefix))
209+
.map(p -> CodeBlock.of("new $T($S, $L)",
210+
defaultServicePartitionMetadata,
211+
p.getPartition(),
212+
globalRegion(p)))
213+
.collect(CodeBlock.joining(","));
214+
}
215+
216+
private CodeBlock globalRegion(Partition partition) {
217+
ClassName region = ClassName.get(regionBasePackage, "Region");
218+
Service service = partition.getServices().get(this.serviceEndpointPrefix);
219+
boolean hasGlobalRegionForPartition = service.isRegionalized() != null &&
220+
!service.isRegionalized() &&
221+
service.isPartitionWideEndpointAvailable();
222+
String globalRegionForPartition = hasGlobalRegionForPartition ? service.getPartitionEndpoint() : null;
223+
return globalRegionForPartition == null
224+
? CodeBlock.of("null")
225+
: CodeBlock.of("$T.of($S)", region, globalRegionForPartition);
226+
}
227+
188228
private MethodSpec regions() {
189229
TypeName listOfRegions = ParameterizedTypeName.get(ClassName.get(List.class),
190230
ClassName.get(regionBasePackage, "Region"));
@@ -219,14 +259,23 @@ private MethodSpec signingRegion() {
219259
.build();
220260
}
221261

262+
private MethodSpec partitions(TypeName listOfServicePartitionMetadata) {
263+
return MethodSpec.methodBuilder("servicePartitions")
264+
.addModifiers(Modifier.PUBLIC)
265+
.addAnnotation(Override.class)
266+
.returns(listOfServicePartitionMetadata)
267+
.addStatement("return $L", "PARTITIONS")
268+
.build();
269+
}
270+
222271
private Map<Partition, Service> getServiceData(Partitions partitions) {
223272
Map<Partition, Service> serviceData = new TreeMap<>(Comparator.comparing(Partition::getPartition));
224273

225274
partitions.getPartitions()
226275
.forEach(p -> p.getServices()
227276
.entrySet()
228277
.stream()
229-
.filter(s -> s.getKey().equalsIgnoreCase(service))
278+
.filter(s -> s.getKey().equalsIgnoreCase(serviceEndpointPrefix))
230279
.forEach(s -> serviceData.put(p, s.getValue())));
231280

232281
return serviceData;

codegen-lite/src/main/java/software/amazon/awssdk/codegen/lite/regions/model/Service.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public final class Service {
4545
/**
4646
* Returns true if the service is regionalized.
4747
*/
48-
private boolean isRegionalized;
48+
private Boolean isRegionalized;
4949

5050
public Service() {}
5151

@@ -99,15 +99,15 @@ public void setPartitionEndpoint(String partitionEndpoint) {
9999
/**
100100
* returns true if the service is regionalized.
101101
*/
102-
public boolean isRegionalized() {
102+
public Boolean isRegionalized() {
103103
return isRegionalized;
104104
}
105105

106106
/**
107107
* sets the regionalized property for a service..
108108
*/
109109
@JsonProperty(value = "isRegionalized")
110-
public void setIsRegionalized(boolean regionalized) {
110+
public void setIsRegionalized(Boolean regionalized) {
111111
isRegionalized = regionalized;
112112
}
113113

0 commit comments

Comments
 (0)