diff --git a/.doc_gen/metadata/entityresolution_metadata.yaml b/.doc_gen/metadata/entityresolution_metadata.yaml
new file mode 100644
index 00000000000..b318b6c2a41
--- /dev/null
+++ b/.doc_gen/metadata/entityresolution_metadata.yaml
@@ -0,0 +1,162 @@
+entityresolution_Hello:
+ title: Hello &ERlong;
+ title_abbrev: Hello &ER;
+ synopsis: get started using &ER;.
+ category: Hello
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_hello.main
+ services:
+ entityresolution: {listMatchingWorkflows}
+entityresolution_DeleteSchemaMapping:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_delete_mappings.main
+ services:
+ entityresolution: {DeleteSchemaMapping}
+entityresolution_TagEntityResource:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_tag_resource.main
+ services:
+ entityresolution: {TagEntityResource}
+entityresolution_CreateMatchingWorkflow:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_create_matching_workflow.main
+ services:
+ entityresolution: {CreateMatchingWorkflow}
+entityresolution_CheckWorkflowStatus:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_check_matching_workflow.main
+ services:
+ entityresolution: {CheckWorkflowStatus}
+entityresolution_StartMatchingJob:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_start_job.main
+ services:
+ entityresolution: {StartMatchingJob}
+entityresolution_GetMatchingJob:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_get_job.main
+ services:
+ entityresolution: {GetMatchingJob}
+entityresolution_DeleteMatchingWorkflow:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_delete_matching_workflow.main
+ services:
+ entityresolution: {DeleteMatchingWorkflow}
+entityresolution_ListSchemaMappings:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_list_mappings.main
+ services:
+ entityresolution: {ListSchemaMappings}
+entityresolution_GetSchemaMapping:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_get_schema_mapping.main
+ services:
+ entityresolution: {GetSchemaMapping}
+entityresolution_CreateSchemaMapping:
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ excerpts:
+ - description:
+ snippet_tags:
+ - entityres.java2_create_schema.main
+ services:
+ entityresolution: {CreateSchemaMapping}
+entityresolution_Scenario:
+ synopsis_list:
+ - Create Schema Mapping.
+ - Create an &ERlong; workflow.
+ - Start the matching job for the workflow.
+ - Get details for the matching job.
+ - Get Schema Mapping.
+ - List all Schema Mappings.
+ - Tag the Schema Mapping resource.
+ - Delete the &ERlong; Assets.
+ category: Basics
+ languages:
+ Java:
+ versions:
+ - sdk_version: 2
+ github: javav2/example_code/entityresolution
+ sdkguide:
+ excerpts:
+ - description: Run an interactive scenario demonstrating &ERlong; features.
+ snippet_tags:
+ - entityres.java2_scenario.main
+ - description: A wrapper class for &ERlong; SDK methods.
+ snippet_tags:
+ - entityres.java2_actions.main
+ services:
+ entityresolution: {}
diff --git a/.doc_gen/validation.yaml b/.doc_gen/validation.yaml
index ea3da0450aa..242ab71ebf2 100644
--- a/.doc_gen/validation.yaml
+++ b/.doc_gen/validation.yaml
@@ -5,6 +5,7 @@ allow_list:
- "e9772d140489982e0e3704fea5ee93d536f1e275"
# Safe look-alikes, mostly tokens and paths that happen to be 40 characters.
- "/AmazonEventBridgeServiceIntegrationTest"
+ - "erbucketf684533d2680435fa99d24b1bdaf5179"
- "/ListOrganizationalUnitsForParentExample"
- "AmazonDataZoneBedrockPermissionsBoundary"
- "AWSEC2/latest/APIReference/OperationList"
diff --git a/javav2/example_code/entityresolution/.gitignore b/javav2/example_code/entityresolution/.gitignore
new file mode 100644
index 00000000000..5ff6309b719
--- /dev/null
+++ b/javav2/example_code/entityresolution/.gitignore
@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/javav2/example_code/entityresolution/README.md b/javav2/example_code/entityresolution/README.md
new file mode 100644
index 00000000000..70ff18acb90
--- /dev/null
+++ b/javav2/example_code/entityresolution/README.md
@@ -0,0 +1,123 @@
+# AWS Entity Resolution code examples for the SDK for Java 2.x
+
+## Overview
+
+Shows how to use the AWS SDK for Java 2.x to work with AWS Entity Resolution.
+
+
+
+
+_AWS Entity Resolution helps organizations extract, link, and organize information from multiple data sources._
+
+## ⚠ Important
+
+* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
+* Running the tests might result in charges to your AWS account.
+* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
+* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
+
+
+
+
+## Code examples
+
+### Prerequisites
+
+For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav2` folder.
+
+
+
+
+
+### Get started
+
+- [Hello AWS Entity Resolution](src/main/java/com/example/entity/HelloEntityResoultion.java#L19) (`listMatchingWorkflows`)
+
+
+### Basics
+
+Code examples that show you how to perform the essential operations within a service.
+
+- [Learn the basics](src/main/java/com/example/entity/scenario/EntityResScenario.java)
+
+
+### Single actions
+
+Code excerpts that show you how to call individual service functions.
+
+- [CheckWorkflowStatus](src/main/java/com/example/entity/scenario/EntityResActions.java#L391)
+- [CreateMatchingWorkflow](src/main/java/com/example/entity/scenario/EntityResActions.java#L429)
+- [CreateSchemaMapping](src/main/java/com/example/entity/scenario/EntityResActions.java#L230)
+- [DeleteMatchingWorkflow](src/main/java/com/example/entity/scenario/EntityResActions.java#L196)
+- [DeleteSchemaMapping](src/main/java/com/example/entity/scenario/EntityResActions.java#L137)
+- [GetMatchingJob](src/main/java/com/example/entity/scenario/EntityResActions.java#L317)
+- [GetSchemaMapping](src/main/java/com/example/entity/scenario/EntityResActions.java#L280)
+- [ListSchemaMappings](src/main/java/com/example/entity/scenario/EntityResActions.java#L173)
+- [StartMatchingJob](src/main/java/com/example/entity/scenario/EntityResActions.java#L354)
+- [TagEntityResource](src/main/java/com/example/entity/scenario/EntityResActions.java#L516)
+
+
+
+
+
+## Run the examples
+
+### Instructions
+
+
+
+
+
+#### Hello AWS Entity Resolution
+
+This example shows you how to get started using AWS Entity Resolution.
+
+
+#### Learn the basics
+
+This example shows you how to do the following:
+
+- Create Schema Mapping.
+- Create an AWS Entity Resolution workflow.
+- Start the matching job for the workflow.
+- Get details for the matching job.
+- Get Schema Mapping.
+- List all Schema Mappings.
+- Tag the Schema Mapping resource.
+- Delete the AWS Entity Resolution Assets.
+
+
+
+
+
+
+
+
+
+### Tests
+
+⚠ Running tests might result in charges to your AWS account.
+
+
+To find instructions for running these tests, see the [README](../../README.md#Tests)
+in the `javav2` folder.
+
+
+
+
+
+
+## Additional resources
+
+- [AWS Entity Resolution User Guide](https://docs.aws.amazon.com/entityresolution/latest/userguide/what-is-service.html)
+- [AWS Entity Resolution API Reference](https://docs.aws.amazon.com/entityresolution/latest/apireference/Welcome.html)
+- [SDK for Java 2.x AWS Entity Resolution reference](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/entityresolution/package-summary.html)
+
+
+
+
+---
+
+Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+
+SPDX-License-Identifier: Apache-2.0
diff --git a/javav2/example_code/entityresolution/pom.xml b/javav2/example_code/entityresolution/pom.xml
new file mode 100644
index 00000000000..a70292a446b
--- /dev/null
+++ b/javav2/example_code/entityresolution/pom.xml
@@ -0,0 +1,132 @@
+
+
+ 4.0.0
+
+ org.example
+ entityresolution
+ 1.0-SNAPSHOT
+
+ UTF-8
+ 17
+ 17
+ 17
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.22.1
+
+ IntegrationTest
+
+
+
+
+
+
+
+ software.amazon.awssdk
+ bom
+ 2.29.45
+ pom
+ import
+
+
+ org.apache.logging.log4j
+ log4j-bom
+ 2.23.1
+ pom
+ import
+
+
+
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.9.2
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.9.2
+ test
+
+
+ software.amazon.awssdk
+ secretsmanager
+
+
+ com.google.code.gson
+ gson
+ 2.10.1
+
+
+ org.junit.platform
+ junit-platform-commons
+ 1.9.2
+
+
+ org.junit.platform
+ junit-platform-launcher
+ 1.9.2
+ test
+
+
+ software.amazon.awssdk
+ entityresolution
+
+
+ com.opencsv
+ opencsv
+ 5.7.1
+
+
+ software.amazon.awssdk
+ s3
+
+
+
+ org.fusesource.jansi
+ jansi
+ 2.4.0
+
+
+ software.amazon.awssdk
+ netty-nio-client
+
+
+ software.amazon.awssdk
+ cloudformation
+
+
+ software.amazon.awssdk
+ sso
+
+
+ software.amazon.awssdk
+ ssooidc
+
+
+ org.apache.logging.log4j
+ log4j-core
+
+
+ org.slf4j
+ slf4j-api
+ 2.0.13
+
+
+ org.apache.logging.log4j
+ log4j-slf4j2-impl
+
+
+ org.apache.logging.log4j
+ log4j-1.2-api
+
+
+
\ No newline at end of file
diff --git a/javav2/example_code/entityresolution/src/main/java/com/example/entity/HelloEntityResoultion.java b/javav2/example_code/entityresolution/src/main/java/com/example/entity/HelloEntityResoultion.java
new file mode 100644
index 00000000000..770f183c9ee
--- /dev/null
+++ b/javav2/example_code/entityresolution/src/main/java/com/example/entity/HelloEntityResoultion.java
@@ -0,0 +1,93 @@
+// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+// SPDX-License-Identifier: Apache-2.0
+
+package com.example.entity;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.core.retry.RetryMode;
+import software.amazon.awssdk.http.async.SdkAsyncHttpClient;
+import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.entityresolution.EntityResolutionAsyncClient;
+import software.amazon.awssdk.services.entityresolution.model.ListMatchingWorkflowsRequest;
+import software.amazon.awssdk.services.entityresolution.paginators.ListMatchingWorkflowsPublisher;
+import java.time.Duration;
+import java.util.concurrent.CompletableFuture;
+
+// snippet-start:[entityres.java2_hello.main]
+/**
+ * Before running this Java V2 code example, set up your development
+ * environment, including your credentials.
+ *
+ * For more information, see the following documentation topic:
+ *
+ * https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html
+ */
+public class HelloEntityResoultion {
+
+ private static final Logger logger = LoggerFactory.getLogger(HelloEntityResoultion.class);
+
+ private static EntityResolutionAsyncClient entityResolutionAsyncClient;
+ public static void main(String[] args) {
+ listMatchingWorkflows();
+ }
+
+ public static EntityResolutionAsyncClient getResolutionAsyncClient() {
+ if (entityResolutionAsyncClient == null) {
+ /*
+ The `NettyNioAsyncHttpClient` class is part of the AWS SDK for Java, version 2,
+ and it is designed to provide a high-performance, asynchronous HTTP client for interacting with AWS services.
+ It uses the Netty framework to handle the underlying network communication and the Java NIO API to
+ provide a non-blocking, event-driven approach to HTTP requests and responses.
+ */
+
+ SdkAsyncHttpClient httpClient = NettyNioAsyncHttpClient.builder()
+ .maxConcurrency(50) // Adjust as needed.
+ .connectionTimeout(Duration.ofSeconds(60)) // Set the connection timeout.
+ .readTimeout(Duration.ofSeconds(60)) // Set the read timeout.
+ .writeTimeout(Duration.ofSeconds(60)) // Set the write timeout.
+ .build();
+
+ ClientOverrideConfiguration overrideConfig = ClientOverrideConfiguration.builder()
+ .apiCallTimeout(Duration.ofMinutes(2)) // Set the overall API call timeout.
+ .apiCallAttemptTimeout(Duration.ofSeconds(90)) // Set the individual call attempt timeout.
+ .retryStrategy(RetryMode.STANDARD)
+ .build();
+
+ entityResolutionAsyncClient = EntityResolutionAsyncClient.builder()
+ .httpClient(httpClient)
+ .overrideConfiguration(overrideConfig)
+ .build();
+ }
+ return entityResolutionAsyncClient;
+ }
+
+ /**
+ * Lists all matching workflows using an asynchronous paginator.
+ *
+ * This method requests a paginated list of matching workflows from the
+ * AWS Entity Resolution service and logs the names of the retrieved workflows.
+ * It uses an asynchronous approach with a paginator and waits for the operation
+ * to complete using {@code CompletableFuture#join()}.
+ *
+ */
+ public static void listMatchingWorkflows() {
+ ListMatchingWorkflowsRequest request = ListMatchingWorkflowsRequest.builder().build();
+
+ ListMatchingWorkflowsPublisher paginator =
+ getResolutionAsyncClient().listMatchingWorkflowsPaginator(request);
+
+ // Iterate through the paginated results asynchronously
+ CompletableFuture future = paginator.subscribe(response -> {
+ response.workflowSummaries().forEach(workflow ->
+ logger.info("Matching Workflow Name: " + workflow.workflowName())
+ );
+ });
+
+ // Wait for the asynchronous operation to complete
+ future.join();
+ }
+}
+// snippet-end:[entityres.java2_hello.main]
diff --git a/javav2/example_code/entityresolution/src/main/java/com/example/entity/scenario/CloudFormationHelper.java b/javav2/example_code/entityresolution/src/main/java/com/example/entity/scenario/CloudFormationHelper.java
new file mode 100644
index 00000000000..12f48a586bd
--- /dev/null
+++ b/javav2/example_code/entityresolution/src/main/java/com/example/entity/scenario/CloudFormationHelper.java
@@ -0,0 +1,188 @@
+// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+// SPDX-License-Identifier: Apache-2.0
+
+package com.example.entity.scenario;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.core.retry.RetryMode;
+import software.amazon.awssdk.http.async.SdkAsyncHttpClient;
+import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient;
+import software.amazon.awssdk.services.cloudformation.CloudFormationAsyncClient;
+import software.amazon.awssdk.services.cloudformation.model.Capability;
+import software.amazon.awssdk.services.cloudformation.model.CloudFormationException;
+import software.amazon.awssdk.services.cloudformation.model.DescribeStacksRequest;
+import software.amazon.awssdk.services.cloudformation.model.DescribeStacksResponse;
+import software.amazon.awssdk.services.cloudformation.model.Output;
+import software.amazon.awssdk.services.cloudformation.model.Stack;
+import software.amazon.awssdk.services.cloudformation.waiters.CloudFormationAsyncWaiter;
+import software.amazon.awssdk.services.s3.S3AsyncClient;
+import software.amazon.awssdk.services.s3.model.DeleteObjectResponse;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.Duration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
+
+public class CloudFormationHelper {
+ private static final String CFN_TEMPLATE = "template.yaml";
+ private static final Logger logger = LoggerFactory.getLogger(CloudFormationHelper.class);
+
+ private static CloudFormationAsyncClient cloudFormationClient;
+
+ public static void main(String[] args) {
+ emptyS3Bucket(args[0]);
+ }
+
+ private static CloudFormationAsyncClient getCloudFormationClient() {
+ if (cloudFormationClient == null) {
+ SdkAsyncHttpClient httpClient = NettyNioAsyncHttpClient.builder()
+ .maxConcurrency(100)
+ .connectionTimeout(Duration.ofSeconds(60))
+ .readTimeout(Duration.ofSeconds(60))
+ .writeTimeout(Duration.ofSeconds(60))
+ .build();
+
+ ClientOverrideConfiguration overrideConfig = ClientOverrideConfiguration.builder()
+ .apiCallTimeout(Duration.ofMinutes(2))
+ .apiCallAttemptTimeout(Duration.ofSeconds(90))
+ .retryStrategy(RetryMode.STANDARD)
+ .build();
+
+ cloudFormationClient = CloudFormationAsyncClient.builder()
+ .httpClient(httpClient)
+ .overrideConfiguration(overrideConfig)
+ .build();
+ }
+ return cloudFormationClient;
+ }
+
+ public static void deployCloudFormationStack(String stackName) {
+ String templateBody;
+ boolean doesExist = describeStack(stackName);
+ if (!doesExist) {
+ try {
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ Path filePath = Paths.get(classLoader.getResource(CFN_TEMPLATE).toURI());
+ templateBody = Files.readString(filePath);
+ } catch (IOException | URISyntaxException e) {
+ throw new RuntimeException(e);
+ }
+
+ getCloudFormationClient().createStack(b -> b.stackName(stackName)
+ .templateBody(templateBody)
+ .capabilities(Capability.CAPABILITY_IAM))
+ .whenComplete((csr, t) -> {
+ if (csr != null) {
+ System.out.println("Stack creation requested, ARN is " + csr.stackId());
+ try (CloudFormationAsyncWaiter waiter = getCloudFormationClient().waiter()) {
+ waiter.waitUntilStackCreateComplete(request -> request.stackName(stackName))
+ .whenComplete((dsr, th) -> {
+ if (th != null) {
+ System.out.println("Error waiting for stack creation: " + th.getMessage());
+ } else {
+ dsr.matched().response().orElseThrow(() -> new RuntimeException("Failed to deploy"));
+ System.out.println("Stack created successfully");
+ }
+ }).join();
+ }
+ } else {
+ System.out.format("Error creating stack: " + t.getMessage(), t);
+ throw new RuntimeException(t.getCause().getMessage(), t);
+ }
+ }).join();
+ } else {
+ logger.info("{} stack already exists", stackName);
+ }
+ }
+
+ // Check to see if the Stack exists before deploying it
+ public static Boolean describeStack(String stackName) {
+ try {
+ CompletableFuture> future = getCloudFormationClient().describeStacks();
+ DescribeStacksResponse stacksResponse = (DescribeStacksResponse) future.join();
+ List stacks = stacksResponse.stacks();
+ for (Stack myStack : stacks) {
+ if (myStack.stackName().compareTo(stackName) == 0) {
+ return true;
+ }
+ }
+ } catch (CloudFormationException e) {
+ System.err.println(e.getMessage());
+ }
+ return false;
+ }
+
+ public static void destroyCloudFormationStack(String stackName) {
+ getCloudFormationClient().deleteStack(b -> b.stackName(stackName))
+ .whenComplete((dsr, t) -> {
+ if (dsr != null) {
+ System.out.println("Delete stack requested ....");
+ try (CloudFormationAsyncWaiter waiter = getCloudFormationClient().waiter()) {
+ waiter.waitUntilStackDeleteComplete(request -> request.stackName(stackName))
+ .whenComplete((waiterResponse, throwable) ->
+ System.out.println("Stack deleted successfully."))
+ .join();
+ }
+ } else {
+ System.out.format("Error deleting stack: " + t.getMessage(), t);
+ throw new RuntimeException(t.getCause().getMessage(), t);
+ }
+ }).join();
+ }
+
+ public static CompletableFuture