Repository: opensearch-project/opensearch-go
Pull request #114 (2022-06-03 21:19:59)

Using standardized templates from .github
Signed-off-by: Vacha Shah <vachshah@amazon.com>

### Description
Using standardized templates from `.github` to make them consistent.

### Issues Resolved
_List any issues this PR will resolve, e.g. Closes [...]._ 

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).



Patch:
diff --git a/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md b/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md
deleted file mode 100644
index 29eddb9..0000000
--- a/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-name: 🐛 Bug report
-about: Create a report to help us improve
-title: '[BUG]'
-labels: 'bug, untriaged'
-assignees: ''
----
-
-**What is the bug?**
-A clear and concise description of the bug.
-
-**How can one reproduce the bug?**
-Steps to reproduce the behavior:
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
-
-**What is the expected behavior?**
-A clear and concise description of what you expected to happen.
-
-**What is your host/environment?**
- - OS: [e.g. iOS]
- - Version [e.g. 22]
- - Plugins
-
-**Do you have any screenshots?**
-If applicable, add screenshots to help explain your problem.
-
-**Do you have any additional context?**
-Add any other context about the problem.
diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md
deleted file mode 100644
index 19b01d9..0000000
--- a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-name: 🎆 Feature request
-about: Request a feature in this project
-title: '[FEATURE]'
-labels: enhancement
-assignees: ''
----
-**Is your feature request related to a problem?**
-A clear and concise description of what the problem is, e.g. _I'm always frustrated when [...]_
-
-**What solution would you like?**
-A clear and concise description of what you want to happen.
-
-**What alternatives have you considered?**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**Do you have any additional context?**
-Add any other context or screenshots about the feature request here.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md b/.github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md
deleted file mode 100644
index bb37ad0..0000000
--- a/.github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-name: 💭 Proposal
-about: Suggest an idea for a specific feature you wish to propose to the community for comment
-title: '[PROPOSAL]'
-labels: proposal
-assignees: ''
----
-## What kind of business use case are you trying to solve? What are your requirements?
-A clear and concise description of the business problem, e.g. _My customers are asking for [...]_
-
-**What is the problem? What is preventing you from meeting the requirements?**
-Describe what impact this problem has for lack of a solution.
-
-**What are you proposing? What do you suggest we do to solve the problem or improve the existing situation?**
-Describe your proposed solution. It's OK if you don't have one.
-
-**What are your assumptions or prerequisites?**
-Describe any assumptions you may be making that would limit the scope of this proposal.
-
-**What are remaining open questions?**
-List questions that may need to be answered before proceeding with an implementation.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
deleted file mode 100644
index a8199a1..0000000
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-contact_links:
-  - name: OpenSearch Community Support
-    url: https://discuss.opendistrocommunity.dev/
-    about: Please ask and answer questions here.
-  - name: AWS/Amazon Security
-    url: https://aws.amazon.com/security/vulnerability-reporting/
-    about: Please report security vulnerabilities here.
\ No newline at end of file
diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md
index bdcc9ce..443e2f3 100644
--- a/COMPATIBILITY.md
+++ b/COMPATIBILITY.md
@@ -17,8 +17,11 @@ The below matrix shows the compatibility of the [`opensearch-go`](https://pkg.go
 | 1.2.4 | 1.1.0 |
 | 1.3.0 | 1.1.0 |
 | 1.3.1 | 1.1.0 |
+| 1.3.2 | 1.1.0 |
+| 1.3.3 | 1.1.0 |
 | 2.0.0 | 2.0.0 |
+| 2.0.1 | 2.0.0 |
 
 ## Upgrading
 
-Major versions of OpenSearch introduce breaking changes that require careful upgrades of the client. While `opensearch-go-client` 2.0.0 works against OpenSearch 1.3.1, certain deprecated features removed in OpenSearch 2.0 have also been removed from the client. Please refer to the [OpenSearch documentation](https://opensearch.org/docs/latest/clients/index/) for more information.
\ No newline at end of file
+Major versions of OpenSearch introduce breaking changes that require careful upgrades of the client. While `opensearch-go-client` 2.0.0 works against the latest OpenSearch 1.x, certain deprecated features removed in OpenSearch 2.0 have also been removed from the client. Please refer to the [OpenSearch documentation](https://opensearch.org/docs/latest/clients/index/) for more information.
\ No newline at end of file
diff --git a/README.md b/README.md
index de14ad7..f08c6ef 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[![Go Reference](https://pkg.go.dev/badge/github.com/opensearch-project/opensearch-go.svg)](https://pkg.go.dev/github.com/opensearch-project/opensearch-go)
+[![Go Reference](https://pkg.go.dev/badge/github.com/opensearch-project/opensearch-go.svg)](https://pkg.go.dev/github.com/opensearch-project/opensearch-go/v2)
 [![Build](https://github.com/opensearch-project/opensearch-go/actions/workflows/lint.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/lint.yml)
 [![Unit](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-unit.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-unit.yml)
 [![Integration](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-integration.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-integration.yml)
diff --git a/USER_GUIDE.md b/USER_GUIDE.md
index 5ed4ac3..05a2106 100644
--- a/USER_GUIDE.md
+++ b/USER_GUIDE.md
@@ -1,9 +1,11 @@
 - [User Guide](#user-guide)
-  - [Example](#example)
-  - [How to use IAMs as authentication method](#how-to-use-iams-as-authentication-method)
+    - [Example](#example)
+    - [How to use IAMs as authentication method](#how-to-use-iams-as-authentication-method)
+
 # User Guide
 
 ## Example
+
 In the example below, we create a client, an index with non-default settings, insert a document to the index,
 search for the document, delete the document and finally delete the index.
 
@@ -11,75 +13,80 @@ search for the document, delete the document and finally delete the index.
 package main
 
 import (
-    "os"
-    "context"
-    "crypto/tls"
-    "fmt"
-    opensearch "github.com/opensearch-project/opensearch-go"
-    opensearchapi "github.com/opensearch-project/opensearch-go/opensearchapi"
-    "net/http"
-    "strings"
+	"os"
+	"context"
+	"crypto/tls"
+	"fmt"
+	opensearch "github.com/opensearch-project/opensearch-go/v2"
+	opensearchapi "github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"net/http"
+	"strings"
 )
 
 const IndexName = "go-test-index1"
 
 func main() {
 
-    // Initialize the client with SSL/TLS enabled.
-    client, err := opensearch.NewClient(opensearch.Config{
-        Transport: &http.Transport{
-            TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // For testing only. Use certificate for validation.
-        },
-        Addresses: []string{"https://localhost:9200"},
-        Username:  "admin", // For testing only. Don't store credentials in code.
-        Password:  "admin",
-    })
-    if err != nil {
-        fmt.Println("cannot initialize", err)
-        os.Exit(1)
-    }
-    
-    // Print OpenSearch version information on console.
-    fmt.Println(client.Info())
-    
-    // Define index mapping.
-    mapping := strings.NewReader(`{
+	// Initialize the client with SSL/TLS enabled.
+	client, err := opensearch.NewClient(opensearch.Config{
+		Transport: &http.Transport{
+			TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // For testing only. Use certificate for validation.
+		},
+		Addresses: []string{"https://localhost:9200"},
+		Username:  "admin", // For testing only. Don't store credentials in code.
+		Password:  "admin",
+	})
+	if err != nil {
+		fmt.Println("cannot initialize", err)
+		os.Exit(1)
+	}
+
+	// Print OpenSearch version information on console.
+	fmt.Println(client.Info())
+
+	// Define index mapping.
+	mapping := strings.NewReader(`{
      'settings': {
        'index': {
             'number_of_shards': 4
             }
           }
      }`)
-    
-    // Create an index with non-default settings.
-    res := opensearchapi.CreateRequest{
-        Index: IndexName,
-        Body:  mapping,
-    }
-    fmt.Println("creating index", res)
-    
-    // Add a document to the index.
-    document := strings.NewReader(`{
+
+	// Create an index with non-default settings.
+	createIndex := opensearchapi.IndicesCreateRequest{
+		Index: IndexName,
+		Body:  mapping,
+	}
+	createIndexResponse, err := createIndex.Do(context.Background(), client)
+	if err != nil {
+		fmt.Println("failed to create index ", err)
+		os.Exit(1)
+	}
+	fmt.Println(createIndexResponse)
+
+	// Add a document to the index.
+	document := strings.NewReader(`{
         "title": "Moneyball",
         "director": "Bennett Miller",
         "year": "2011"
     }`)
-    
-    docId := "1"
-    req := opensearchapi.IndexRequest{
-        Index:      IndexName,
-        DocumentID: docId,
-        Body:       document,
-    }
-    insertResponse, err := req.Do(context.Background(), client)
-    if err != nil {
-        fmt.Println("failed to insert document ", err)
-        os.Exit(1)
-    }
-    fmt.Println(insertResponse)
-    
-    // Search for the document.
-    content := strings.NewReader(`{
+
+	docId := "1"
+	req := opensearchapi.IndexRequest{
+		Index:      IndexName,
+		DocumentID: docId,
+		Body:       document,
+	}
+	insertResponse, err := req.Do(context.Background(), client)
+	if err != nil {
+		fmt.Println("failed to insert document ", err)
+		os.Exit(1)
+	}
+	fmt.Println(insertResponse)
+
+	// Search for the document.
+	content := strings.NewReader(`{
        "size": 5,
        "query": {
            "multi_match": {
@@ -88,56 +95,71 @@ func main() {
            }
       }
     }`)
-    
-    search := opensearchapi.SearchRequest{
-        Body: content,
-    }
-    
-    searchResponse, err := search.Do(context.Background(), client)
-    if err != nil {
-        fmt.Println("failed to search document ", err)
-        os.Exit(1)
-    }
-    fmt.Println(searchResponse)
-    
-    // Delete the document.
-    delete := opensearchapi.DeleteRequest{
-        Index:      IndexName,
-        DocumentID: docId,
-    }
-    
-    deleteResponse, err := delete.Do(context.Background(), client)
-    if err != nil {
-        fmt.Println("failed to delete document ", err)
-        os.Exit(1)
-    }
-    fmt.Println("deleting document")
-    fmt.Println(deleteResponse)
-    
-    // Delete previously created index.
-    deleteIndex := opensearchapi.IndicesDeleteRequest{
-        Index: []string{IndexName},
-    }
-    
-    deleteIndexResponse, err := deleteIndex.Do(context.Background(), client)
-    if err != nil {
-        fmt.Println("failed to delete index ", err)
-        os.Exit(1)
-    }
-    fmt.Println("deleting index", deleteIndexResponse)
+
+	search := opensearchapi.SearchRequest{
+		Body: content,
+	}
+
+	searchResponse, err := search.Do(context.Background(), client)
+	if err != nil {
+		fmt.Println("failed to search document ", err)
+		os.Exit(1)
+	}
+	fmt.Println(searchResponse)
+
+	// Delete the document.
+	delete := opensearchapi.DeleteRequest{
+		Index:      IndexName,
+		DocumentID: docId,
+	}
+
+	deleteResponse, err := delete.Do(context.Background(), client)
+	if err != nil {
+		fmt.Println("failed to delete document ", err)
+		os.Exit(1)
+	}
+	fmt.Println("deleting document")
+	fmt.Println(deleteResponse)
+
+	// Delete previously created index.
+	deleteIndex := opensearchapi.IndicesDeleteRequest{
+		Index: []string{IndexName},
+	}
+
+	deleteIndexResponse, err := deleteIndex.Do(context.Background(), client)
+	if err != nil {
+		fmt.Println("failed to delete index ", err)
+		os.Exit(1)
+	}
+	fmt.Println("deleting index", deleteIndexResponse)
 }
 
 ```
 
 ## How to use IAMs as authentication method
 
-Before starting, we strongly recommend reading the full AWS documentation regarding using IAM credentials to sign requests to OpenSearch APIs.
+Before starting, we strongly recommend reading the full AWS documentation regarding using IAM credentials to sign
+requests to OpenSearch APIs.
 See [Identity and Access Management in Amazon OpenSearch Service.](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ac.html)
 
-> Even if you configure a completely open resource-based access policy, all requests to the OpenSearch Service configuration API must be signed. If your policies specify IAM users or roles, requests to the OpenSearch APIs also must be signed using AWS Signature Version 4.
+> Even if you configure a completely open resource-based access policy, all requests to the OpenSearch Service
+> configuration API must be signed. If your policies specify IAM users or roles, requests to the OpenSearch APIs also
+> must
+> be signed using AWS Signature Version 4.
+>
 See [Managed Domains signing-service requests.](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ac.html#managedomains-signing-service-requests)
 
-Here is some sample Go code that shows how to sign each OpenSearch request and automatically search for AWS credentials from the ~/.aws folder or environment variables:
+Depending on the version of AWS SDK used, import the v1 or v2 request signer from `signer/aws` or `signer/awsv2`
+respectively.
+Both signers are equivalent in their functionality, they provide AWS Signature Version 4 (SigV4).
+
+To read more about SigV4
+see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)
+
+Here are some Go samples that show how to sign each OpenSearch request and automatically search for AWS credentials from
+the ~/.aws folder or environment variables:
+
+#### AWS SDK V1
 
 ```go
 package main
@@ -148,9 +170,9 @@ import (
 	"log"
 
 	"github.com/aws/aws-sdk-go/aws/session"
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	requestsigner "github.com/opensearch-project/opensearch-go/signer/aws"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	requestsigner "github.com/opensearch-project/opensearch-go/v2/signer/aws"
 )
 
 const endpoint = "" // e.g. https://opensearch-domain.region.com
@@ -168,7 +190,7 @@ func main() {
 	// Create an opensearch client and use the request-signer
 	client, err := opensearch.NewClient(opensearch.Config{
 		Addresses: []string{endpoint},
-		Signer: signer,
+		Signer:    signer,
 	})
 	if err != nil {
 		log.Fatal("client creation err", err)
@@ -196,3 +218,68 @@ func main() {
 	log.Println("PING OK")
 }
 ```
+
+#### AWS SDK V2
+
+```go
+package main
+
+import (
+	"context"
+	"io"
+	"log"
+
+	"github.com/aws/aws-sdk-go-v2/config"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	requestsigner "github.com/opensearch-project/opensearch-go/v2/signer/awsv2"
+)
+
+const endpoint = "" // e.g. https://opensearch-domain.region.com
+
+func main() {
+	ctx := context.Background()
+
+	cfg, err := config.LoadDefaultConfig(ctx)
+	if err != nil {
+		log.Fatal(err) // Do not log.fatal in a production ready app.
+	}
+
+	// Create an AWS request Signer and load AWS configuration using default config folder or env vars.
+	// See https://docs.aws.amazon.com/opensearch-service/latest/developerguide/request-signing.html#request-signing-go
+	signer, err := requestsigner.NewSigner(cfg)
+	if err != nil {
+		log.Fatal(err) // Do not log.fatal in a production ready app.
+	}
+
+	// Create an opensearch client and use the request-signer
+	client, err := opensearch.NewClient(opensearch.Config{
+		Addresses: []string{endpoint},
+		Signer:    signer,
+	})
+	if err != nil {
+		log.Fatal("client creation err", err)
+	}
+
+	ping := opensearchapi.PingRequest{}
+
+	resp, err := ping.Do(ctx, client)
+	if err != nil {
+		log.Fatal(err)
+	}
+	defer resp.Body.Close()
+
+	if resp.IsError() {
+		log.Println("ping response status ", resp.Status())
+
+		respBody, err := io.ReadAll(resp.Body)
+		if err != nil {
+			log.Fatal("response body read err", err)
+		}
+
+		log.Fatal("ping resp body", respBody)
+	}
+
+	log.Println("PING OK")
+}
+
+```
diff --git a/go.mod b/go.mod
index 5cbfa33..ddff76f 100644
--- a/go.mod
+++ b/go.mod
@@ -1,10 +1,10 @@
-module github.com/opensearch-project/opensearch-go
+module github.com/opensearch-project/opensearch-go/v2
 
-go 1.11
+go 1.15
 
 require (
-	github.com/aws/aws-sdk-go v1.42.27
-	github.com/stretchr/testify v1.7.0
-	golang.org/x/text v0.3.7 // indirect
-	golang.org/x/tools v0.1.10 // indirect
+	github.com/aws/aws-sdk-go v1.44.45
+	github.com/aws/aws-sdk-go-v2 v1.16.6
+	github.com/aws/aws-sdk-go-v2/config v1.15.12
+	github.com/stretchr/testify v1.8.0
 )
diff --git a/go.sum b/go.sum
index bf0df39..eda0ef6 100644
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,32 @@
-github.com/aws/aws-sdk-go v1.42.27 h1:kxsBXQg3ee6LLbqjp5/oUeDgG7TENFrWYDmEVnd7spU=
-github.com/aws/aws-sdk-go v1.42.27/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc=
-github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
+github.com/aws/aws-sdk-go v1.44.45 h1:E2i73X4QdVS0XrfX/aVPt/M0Su2IuJ7AFvAMtF0id1Q=
+github.com/aws/aws-sdk-go v1.44.45/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
+github.com/aws/aws-sdk-go-v2 v1.16.6 h1:kzafGZYwkwVgLZ2zEX7P+vTwLli6uIMXF8aGjunN6UI=
+github.com/aws/aws-sdk-go-v2 v1.16.6/go.mod h1:6CpKuLXg2w7If3ABZCl/qZ6rEgwtjZTn4eAf4RcEyuw=
+github.com/aws/aws-sdk-go-v2/config v1.15.12 h1:D4mdf0cOSmZRgJe0DDOd1Qm6tkwHJ7r5i1lz0asa+AA=
+github.com/aws/aws-sdk-go-v2/config v1.15.12/go.mod h1:oxRNnH11J580bxDEXyfTqfB3Auo2fxzhV052LD4HnyA=
+github.com/aws/aws-sdk-go-v2/credentials v1.12.7 h1:e2DcCR0gP+T2zVj5eQPMQoRdxo+vd2p9BkpJ72BdyzA=
+github.com/aws/aws-sdk-go-v2/credentials v1.12.7/go.mod h1:8b1nSHdDaKLho9VEK+K8WivifA/2K5pPm4sfI21NlQ8=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.7 h1:8yi2ORCwXpXEPnj0vP3DjYhejwDQD/5klgBoxXcKOxY=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.7/go.mod h1:81k6q0UUZj6AdQZ1E/VQ27cLrTUpJGraZR6/hVHRxjE=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.13 h1:WuQ1yGs3TMJgxpGVLspcsU/5q1omSA0SG6Cu0yZ4jkM=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.13/go.mod h1:wLLesU+LdMZDM3U0PP9vZXJW39zmD/7L4nY2pSrYZ/g=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.7 h1:mCeDDYeDXp3loo/xKi7nkx34eeh7q3n1mUBtzptsj8c=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.7/go.mod h1:93Uot80ddyVzSl//xEJreNKMhxntr71WtR3v/A1cRYk=
+github.com/aws/aws-sdk-go-v2/internal/ini v1.3.14 h1:bJv4Y9QOiW0GZPStgLgpGrpdfRDSR3XM4V4M3YCQRZo=
+github.com/aws/aws-sdk-go-v2/internal/ini v1.3.14/go.mod h1:R1HF8ZDdcRFfAGF+13En4LSHi2IrrNuPQCaxgWCeGyY=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.7 h1:M7/BzQNsu0XXiJRe3gUn8UA8tExF6kLMAfvo5PT/KJY=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.7/go.mod h1:HvVdEh/x4jsPBsjNvDy+MH3CDCPy4gTZEzFe2r4uJY8=
+github.com/aws/aws-sdk-go-v2/service/sso v1.11.10 h1:icon5WWg9Yg5nkB0pJF6bfKw6M0xozukeGKSNKtnqzw=
+github.com/aws/aws-sdk-go-v2/service/sso v1.11.10/go.mod h1:UHxA35uPrCykRySBV5iSPZhZRlYnWSS2c/aaZVsoU94=
+github.com/aws/aws-sdk-go-v2/service/sts v1.16.8 h1:GLGfpqX+1bmjNvUJkwB1ZaDpNFXQwJ3z9RkQDA58OBY=
+github.com/aws/aws-sdk-go-v2/service/sts v1.16.8/go.mod h1:50YdFq1WIuxA0AGrygvYGucnNYrG24WYzu5fNp7lMgY=
+github.com/aws/smithy-go v1.12.0 h1:gXpeZel/jPoWQ7OEmLIgCUnhkFftqNfwWUwAHSlp1v0=
+github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
+github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
 github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
 github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
 github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
@@ -10,41 +35,22 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
-github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM=
-golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
+golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
-golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
-golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
 gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/internal/build/cmd/commands.go b/internal/build/cmd/commands.go
index 859ec3b..a1ef441 100644
--- a/internal/build/cmd/commands.go
+++ b/internal/build/cmd/commands.go
@@ -31,7 +31,7 @@ import (
 
 	"github.com/spf13/cobra"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var rootCmd = &cobra.Command{
diff --git a/internal/build/cmd/generate/commands/genexamples/command.go b/internal/build/cmd/generate/commands/genexamples/command.go
index 7d76c73..81a9ddb 100644
--- a/internal/build/cmd/generate/commands/genexamples/command.go
+++ b/internal/build/cmd/generate/commands/genexamples/command.go
@@ -39,12 +39,12 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
 
 	"github.com/spf13/cobra"
 	"golang.org/x/tools/imports"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/genexamples/translator.go b/internal/build/cmd/generate/commands/genexamples/translator.go
index d87cefb..6d23267 100644
--- a/internal/build/cmd/generate/commands/genexamples/translator.go
+++ b/internal/build/cmd/generate/commands/genexamples/translator.go
@@ -39,7 +39,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 const testCheck = "\t" + `if err != nil {            // SKIP
diff --git a/internal/build/cmd/generate/commands/gensource/command.go b/internal/build/cmd/generate/commands/gensource/command.go
index b18bfa4..670150b 100644
--- a/internal/build/cmd/generate/commands/gensource/command.go
+++ b/internal/build/cmd/generate/commands/gensource/command.go
@@ -35,11 +35,11 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
 
 	"github.com/spf13/cobra"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/gensource/debug.go b/internal/build/cmd/generate/commands/gensource/debug.go
index 3eaef5c..c1606f1 100644
--- a/internal/build/cmd/generate/commands/gensource/debug.go
+++ b/internal/build/cmd/generate/commands/gensource/debug.go
@@ -32,7 +32,7 @@ import (
 	"strings"
 	"text/tabwriter"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 // DebugInfo returns information about the endpoint as a string.
diff --git a/internal/build/cmd/generate/commands/gensource/generator.go b/internal/build/cmd/generate/commands/gensource/generator.go
index 7a96a8e..69472c1 100644
--- a/internal/build/cmd/generate/commands/gensource/generator.go
+++ b/internal/build/cmd/generate/commands/gensource/generator.go
@@ -35,7 +35,7 @@ import (
 
 	"golang.org/x/tools/imports"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 // Generator represents the "gensource" generator.
diff --git a/internal/build/cmd/generate/commands/gensource/model.go b/internal/build/cmd/generate/commands/gensource/model.go
index 05e2a4e..af72cd7 100644
--- a/internal/build/cmd/generate/commands/gensource/model.go
+++ b/internal/build/cmd/generate/commands/gensource/model.go
@@ -36,7 +36,7 @@ import (
 
 	"gopkg.in/yaml.v2"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/genstruct/command.go b/internal/build/cmd/generate/commands/genstruct/command.go
index a56829b..0109dbd 100644
--- a/internal/build/cmd/generate/commands/genstruct/command.go
+++ b/internal/build/cmd/generate/commands/genstruct/command.go
@@ -35,14 +35,14 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
 
 	"golang.org/x/tools/go/packages"
 	"golang.org/x/tools/imports"
 
 	"github.com/spf13/cobra"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/tools/commands/spec/command.go b/internal/build/cmd/tools/commands/spec/command.go
index 962711c..6e59ff0 100644
--- a/internal/build/cmd/tools/commands/spec/command.go
+++ b/internal/build/cmd/tools/commands/spec/command.go
@@ -40,9 +40,9 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
-	"github.com/opensearch-project/opensearch-go/internal/version"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/version"
 	"github.com/spf13/cobra"
 )
 
diff --git a/internal/build/go.mod b/internal/build/go.mod
index c7a097b..fa01aa2 100644
--- a/internal/build/go.mod
+++ b/internal/build/go.mod
@@ -1,16 +1,14 @@
-module github.com/opensearch-project/opensearch-go/internal/build
+module github.com/opensearch-project/opensearch-go/v2/internal/build
 
 go 1.15
 
-replace github.com/opensearch-project/opensearch-go => ../../
+replace github.com/opensearch-project/opensearch-go/v2 => ../../
 
 require (
 	github.com/alecthomas/chroma v0.8.2
+	github.com/opensearch-project/opensearch-go/v2 v2.0.0
 	github.com/spf13/cobra v1.1.3
-	github.com/opensearch-project/opensearch-go v1.0.0
-	github.com/stretchr/testify v1.4.0 // indirect
 	golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
-	golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect
 	golang.org/x/tools v0.1.0
 	gopkg.in/yaml.v2 v2.4.0
 )
diff --git a/internal/build/go.sum b/internal/build/go.sum
index 745fec8..3c7a2d2 100644
--- a/internal/build/go.sum
+++ b/internal/build/go.sum
@@ -28,6 +28,7 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
 github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
 github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
 github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
+github.com/aws/aws-sdk-go v1.42.27/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
@@ -104,6 +105,8 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p
 github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
 github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
+github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
 github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
@@ -181,8 +184,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
@@ -238,6 +241,7 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -266,14 +270,16 @@ golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A=
-golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -330,10 +336,12 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
 gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/internal/build/main.go b/internal/build/main.go
index cae68de..a4f7131 100644
--- a/internal/build/main.go
+++ b/internal/build/main.go
@@ -27,13 +27,13 @@
 package main
 
 import (
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
 
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/genexamples"
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/gensource"
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/genstruct"
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/gentests"
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/tools/commands/spec"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/genexamples"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/gensource"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/genstruct"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/gentests"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/tools/commands/spec"
 )
 
 func main() {
diff --git a/opensearch.go b/opensearch.go
index cb6e733..593916f 100644
--- a/opensearch.go
+++ b/opensearch.go
@@ -42,11 +42,11 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/signer"
+	"github.com/opensearch-project/opensearch-go/v2/signer"
 
-	"github.com/opensearch-project/opensearch-go/internal/version"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/internal/version"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var (
diff --git a/opensearchapi/opensearchapi.go b/opensearchapi/opensearchapi.go
index 35804c3..92b728a 100644
--- a/opensearchapi/opensearchapi.go
+++ b/opensearchapi/opensearchapi.go
@@ -31,7 +31,7 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/version"
+	"github.com/opensearch-project/opensearch-go/v2/internal/version"
 )
 
 // Version returns the package version as a string.
diff --git a/opensearchtransport/opensearchtransport.go b/opensearchtransport/opensearchtransport.go
index 725fddc..491a9b7 100644
--- a/opensearchtransport/opensearchtransport.go
+++ b/opensearchtransport/opensearchtransport.go
@@ -45,9 +45,9 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/signer"
+	"github.com/opensearch-project/opensearch-go/v2/signer"
 
-	"github.com/opensearch-project/opensearch-go/internal/version"
+	"github.com/opensearch-project/opensearch-go/v2/internal/version"
 )
 
 const (
diff --git a/opensearchutil/bulk_indexer.go b/opensearchutil/bulk_indexer.go
index 2d23d1a..3f08cec 100644
--- a/opensearchutil/bulk_indexer.go
+++ b/opensearchutil/bulk_indexer.go
@@ -38,8 +38,8 @@ import (
 	"sync/atomic"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
 )
 
 // BulkIndexer represents a parallel, asynchronous, efficient indexer for OpenSearch.
diff --git a/signer/awsv2/sdkv2signer.go b/signer/awsv2/sdkv2signer.go
new file mode 100644
index 0000000..3d44a17
--- /dev/null
+++ b/signer/awsv2/sdkv2signer.go
@@ -0,0 +1,98 @@
+// SPDX-License-Identifier: Apache-2.0
+//
+// The OpenSearch Contributors require contributions made to
+// this file be licensed under the Apache-2.0 license or a
+// compatible open source license.
+//
+// Modifications Copyright OpenSearch Contributors. See
+// GitHub history for details.
+
+package awsv2
+
+import (
+	"bytes"
+	"context"
+	"crypto/sha256"
+	"encoding/hex"
+	"errors"
+	"fmt"
+	"github.com/aws/aws-sdk-go-v2/aws"
+	awsSignerV4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
+	"github.com/opensearch-project/opensearch-go/v2/signer"
+	"io/ioutil"
+	"net/http"
+	"strings"
+	"time"
+)
+
+const (
+	openSearchService = "es"
+	emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`
+)
+
+type awsSdkV2Signer struct {
+	service string
+	signer  *awsSignerV4.Signer
+	awsCfg  aws.Config
+}
+
+// NewSigner returns an instance of Signer for AWS OpenSearchService
+func NewSigner(cfg aws.Config) (signer.Signer, error) {
+	return NewSignerWithService(cfg, openSearchService)
+}
+
+// NewSignerWithService returns an instance of Signer for given service
+func NewSignerWithService(cfg aws.Config, service string) (signer.Signer, error) {
+	if len(strings.TrimSpace(service)) < 1 {
+		return nil, errors.New("service cannot be empty")
+	}
+
+	return &awsSdkV2Signer{
+		service: service,
+		signer:  awsSignerV4.NewSigner(),
+		awsCfg:  cfg,
+	}, nil
+}
+
+func (s *awsSdkV2Signer) SignRequest(r *http.Request) error {
+	ctx := context.Background()
+	t := time.Now()
+
+	creds, err := s.awsCfg.Credentials.Retrieve(ctx)
+	if err != nil {
+		return err
+	}
+
+	if len(s.awsCfg.Region) == 0 {
+		return fmt.Errorf("aws region cannot be empty")
+	}
+
+	hash, err := hexEncodedSha256OfRequest(r)
+	if err != nil {
+		return err
+	}
+
+	return s.signer.SignHTTP(ctx, creds, r, hash, s.service, s.awsCfg.Region, t)
+}
+
+func hexEncodedSha256OfRequest(r *http.Request) (string, error) {
+	if r.Body == nil {
+		return emptyStringSHA256, nil
+	}
+
+	hasher := sha256.New()
+	reqBodyBytes, err := ioutil.ReadAll(r.Body)
+	if err != nil {
+		return "", err
+	}
+
+	if err := r.Body.Close(); err != nil {
+		return "", err
+	}
+	r.Body = ioutil.NopCloser(bytes.NewBuffer(reqBodyBytes))
+
+	hasher.Write(reqBodyBytes)
+	digest := hasher.Sum(nil)
+
+	return hex.EncodeToString(digest), nil
+}


Test patch:
diff --git a/.github/workflows/test-compatibility.yml b/.github/workflows/test-compatibility.yml
index 485ff03..02460a7 100644
--- a/.github/workflows/test-compatibility.yml
+++ b/.github/workflows/test-compatibility.yml
@@ -18,7 +18,10 @@ jobs:
           - { opensearch_version: 1.2.4 }
           - { opensearch_version: 1.3.0 }
           - { opensearch_version: 1.3.1 }
+          - { opensearch_version: 1.3.2 }
+          - { opensearch_version: 1.3.3 }
           - { opensearch_version: 2.0.0 }
+          - { opensearch_version: 2.0.1 }
     steps:
       - uses: actions/checkout@v2
         with: { fetch-depth: 1 }
diff --git a/internal/build/cmd/generate/commands/gensource/generator_test.go b/internal/build/cmd/generate/commands/gensource/generator_test.go
index da7e84d..62181e1 100644
--- a/internal/build/cmd/generate/commands/gensource/generator_test.go
+++ b/internal/build/cmd/generate/commands/gensource/generator_test.go
@@ -32,7 +32,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/gensource"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/gensource"
 )
 
 func TestGenerator(t *testing.T) {
diff --git a/internal/build/cmd/generate/commands/gentests/command.go b/internal/build/cmd/generate/commands/gentests/command.go
index ff853f0..e90b730 100644
--- a/internal/build/cmd/generate/commands/gentests/command.go
+++ b/internal/build/cmd/generate/commands/gentests/command.go
@@ -41,8 +41,8 @@ import (
 	"github.com/spf13/cobra"
 	yaml "gopkg.in/yaml.v2"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/gentests/debug.go b/internal/build/cmd/generate/commands/gentests/debug.go
index aef7693..d30ca35 100644
--- a/internal/build/cmd/generate/commands/gentests/debug.go
+++ b/internal/build/cmd/generate/commands/gentests/debug.go
@@ -30,7 +30,7 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 // DebugInfo returns information about the endpoint as a string.
diff --git a/internal/build/cmd/generate/commands/gentests/generator.go b/internal/build/cmd/generate/commands/gentests/generator.go
index 464d92b..06cc716 100644
--- a/internal/build/cmd/generate/commands/gentests/generator.go
+++ b/internal/build/cmd/generate/commands/gentests/generator.go
@@ -221,9 +221,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/gentests/model.go b/internal/build/cmd/generate/commands/gentests/model.go
index 4cfeccf..6e48090 100644
--- a/internal/build/cmd/generate/commands/gentests/model.go
+++ b/internal/build/cmd/generate/commands/gentests/model.go
@@ -35,7 +35,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var reFilename = regexp.MustCompile(`\d*_?(.+)\.ya?ml`)
diff --git a/opensearch_benchmark_test.go b/opensearch_benchmark_test.go
index cc7eb75..020ac38 100644
--- a/opensearch_benchmark_test.go
+++ b/opensearch_benchmark_test.go
@@ -36,8 +36,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
 )
 
 var defaultResponse = http.Response{
diff --git a/opensearch_example_test.go b/opensearch_example_test.go
index 88747ec..6c45b15 100644
--- a/opensearch_example_test.go
+++ b/opensearch_example_test.go
@@ -36,8 +36,8 @@ import (
 	"os"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 func init() {
diff --git a/opensearch_integration_test.go b/opensearch_integration_test.go
index 9e16dc9..3a438fb 100644
--- a/opensearch_integration_test.go
+++ b/opensearch_integration_test.go
@@ -41,9 +41,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 func TestClientTransport(t *testing.T) {
diff --git a/opensearch_internal_test.go b/opensearch_internal_test.go
index 264967e..b61bb06 100644
--- a/opensearch_internal_test.go
+++ b/opensearch_internal_test.go
@@ -42,7 +42,7 @@ import (
 
 	"github.com/stretchr/testify/assert"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var called bool
diff --git a/opensearch_secure_integration_test.go b/opensearch_secure_integration_test.go
index b4e40f8..3e0816a 100644
--- a/opensearch_secure_integration_test.go
+++ b/opensearch_secure_integration_test.go
@@ -18,7 +18,7 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
+	"github.com/opensearch-project/opensearch-go/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/opensearchapi/opensearchapi.response_example_test.go b/opensearchapi/opensearchapi.response_example_test.go
index 3adcf25..d74f6e5 100644
--- a/opensearchapi/opensearchapi.response_example_test.go
+++ b/opensearchapi/opensearchapi.response_example_test.go
@@ -29,7 +29,7 @@ package opensearchapi_test
 import (
 	"log"
 
-	"github.com/opensearch-project/opensearch-go"
+	"github.com/opensearch-project/opensearch-go/v2"
 )
 
 func ExampleResponse_IsError() {
diff --git a/opensearchapi/opensearchapi_benchmark_test.go b/opensearchapi/opensearchapi_benchmark_test.go
index 1b66424..2462760 100644
--- a/opensearchapi/opensearchapi_benchmark_test.go
+++ b/opensearchapi/opensearchapi_benchmark_test.go
@@ -34,8 +34,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
 )
 
 // TODO: Refactor into a shared mock/testing package
diff --git a/opensearchapi/opensearchapi_integration_test.go b/opensearchapi/opensearchapi_integration_test.go
index 772c13b..218ce86 100644
--- a/opensearchapi/opensearchapi_integration_test.go
+++ b/opensearchapi/opensearchapi_integration_test.go
@@ -36,8 +36,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
 )
 
 func TestAPI(t *testing.T) {
diff --git a/opensearchapi/test/go.mod b/opensearchapi/test/go.mod
index d9b614f..6350a5b 100644
--- a/opensearchapi/test/go.mod
+++ b/opensearchapi/test/go.mod
@@ -1,11 +1,11 @@
-module github.com/opensearch-project/opensearch-go/opensearch/test
+module github.com/opensearch-project/opensearch-go/v2/opensearch/test
 
 go 1.11
 
-replace github.com/opensearch-project/opensearch-go => ../../
+replace github.com/opensearch-project/opensearch-go/v2 => ../../
 
 require (
-	github.com/opensearch-project/opensearch-go v1.0.0
+	github.com/opensearch-project/opensearch-go/v2 v2.0.0
 
 	gopkg.in/yaml.v2 v2.4.0
 )
diff --git a/opensearchtransport/logger_benchmark_test.go b/opensearchtransport/logger_benchmark_test.go
index 965ced4..3ed3111 100644
--- a/opensearchtransport/logger_benchmark_test.go
+++ b/opensearchtransport/logger_benchmark_test.go
@@ -35,7 +35,7 @@ import (
 	"net/url"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 func BenchmarkTransportLogger(b *testing.B) {
diff --git a/opensearchtransport/opensearchtransport_benchmark_test.go b/opensearchtransport/opensearchtransport_benchmark_test.go
index eb137fa..6730cab 100644
--- a/opensearchtransport/opensearchtransport_benchmark_test.go
+++ b/opensearchtransport/opensearchtransport_benchmark_test.go
@@ -35,7 +35,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var defaultResponse = http.Response{
diff --git a/opensearchtransport/opensearchtransport_integration_multinode_test.go b/opensearchtransport/opensearchtransport_integration_multinode_test.go
index d9e80ac..d8dcb5b 100644
--- a/opensearchtransport/opensearchtransport_integration_multinode_test.go
+++ b/opensearchtransport/opensearchtransport_integration_multinode_test.go
@@ -35,7 +35,7 @@ import (
 	"net/url"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var (
diff --git a/opensearchtransport/opensearchtransport_integration_test.go b/opensearchtransport/opensearchtransport_integration_test.go
index ed820f5..024da3a 100644
--- a/opensearchtransport/opensearchtransport_integration_test.go
+++ b/opensearchtransport/opensearchtransport_integration_test.go
@@ -39,8 +39,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 var (
diff --git a/opensearchutil/bulk_indexer_benchmark_test.go b/opensearchutil/bulk_indexer_benchmark_test.go
index 5581b6b..a2dcd56 100644
--- a/opensearchutil/bulk_indexer_benchmark_test.go
+++ b/opensearchutil/bulk_indexer_benchmark_test.go
@@ -37,8 +37,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 var mockResponseBody = `{
diff --git a/opensearchutil/bulk_indexer_example_test.go b/opensearchutil/bulk_indexer_example_test.go
index 609412e..f519f37 100644
--- a/opensearchutil/bulk_indexer_example_test.go
+++ b/opensearchutil/bulk_indexer_example_test.go
@@ -35,8 +35,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 func ExampleNewBulkIndexer() {
diff --git a/opensearchutil/bulk_indexer_integration_test.go b/opensearchutil/bulk_indexer_integration_test.go
index 918461e..3d8d00f 100644
--- a/opensearchutil/bulk_indexer_integration_test.go
+++ b/opensearchutil/bulk_indexer_integration_test.go
@@ -38,9 +38,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 func TestBulkIndexerIntegration(t *testing.T) {
diff --git a/opensearchutil/bulk_indexer_internal_test.go b/opensearchutil/bulk_indexer_internal_test.go
index 916441c..a5c909b 100644
--- a/opensearchutil/bulk_indexer_internal_test.go
+++ b/opensearchutil/bulk_indexer_internal_test.go
@@ -47,8 +47,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var infoBody = `{
diff --git a/opensearchutil/json_reader_benchmark_test.go b/opensearchutil/json_reader_benchmark_test.go
index 0633dca..24c489e 100644
--- a/opensearchutil/json_reader_benchmark_test.go
+++ b/opensearchutil/json_reader_benchmark_test.go
@@ -37,7 +37,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 var _ = fmt.Print
diff --git a/opensearchutil/json_reader_integration_test.go b/opensearchutil/json_reader_integration_test.go
index fe55a4a..389626a 100644
--- a/opensearchutil/json_reader_integration_test.go
+++ b/opensearchutil/json_reader_integration_test.go
@@ -32,9 +32,9 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 func TestJSONReaderIntegration(t *testing.T) {
diff --git a/signer/awsv2/sdkv2signer_test.go b/signer/awsv2/sdkv2signer_test.go
new file mode 100644
index 0000000..95d1f24
--- /dev/null
+++ b/signer/awsv2/sdkv2signer_test.go
@@ -0,0 +1,156 @@
+// SPDX-License-Identifier: Apache-2.0
+//
+// The OpenSearch Contributors require contributions made to
+// this file be licensed under the Apache-2.0 license or a
+// compatible open source license.
+//
+// Modifications Copyright OpenSearch Contributors. See
+// GitHub history for details.
+
+package awsv2
+
+import (
+	"bytes"
+	"context"
+	"github.com/aws/aws-sdk-go-v2/aws"
+	"github.com/aws/aws-sdk-go-v2/config"
+	"github.com/stretchr/testify/assert"
+	"net/http"
+	"os"
+	"testing"
+)
+
+func getCredentialProvider(accessKey, secretAccessKey, token string) aws.CredentialsProviderFunc {
+	return func(ctx context.Context) (aws.Credentials, error) {
+		c := &aws.Credentials{
+			AccessKeyID:     accessKey,
+			SecretAccessKey: secretAccessKey,
+			SessionToken:    token,
+		}
+		return *c, nil
+	}
+}
+
+func TestV4SignerAwsSdkV2(t *testing.T) {
+	t.Run("sign request failed due to no region found", func(t *testing.T) {
+		req, err := http.NewRequest(http.MethodGet, "https://localhost:9200", nil)
+		assert.NoError(t, err)
+		region := os.Getenv("AWS_REGION")
+		os.Setenv("AWS_REGION", "")
+		defer func() {
+			os.Setenv("AWS_REGION", region)
+		}()
+		awsCfg, err := config.LoadDefaultConfig(context.TODO(),
+			config.WithCredentialsProvider(
+				getCredentialProvider("AKID", "SECRET_KEY", "TOKEN"),
+			),
+			config.WithRegion(""),
+		)
+		assert.NoError(t, err)
+
+		signer, err := NewSigner(awsCfg)
+		assert.NoError(t, err)
+		err = signer.SignRequest(req)
+
+		assert.EqualErrorf(
+			t, err, "aws region cannot be empty", "unexpected error")
+	})
+	t.Run("sign request success", func(t *testing.T) {
+		req, err := http.NewRequest(http.MethodGet, "https://localhost:9200", nil)
+		assert.NoError(t, err)
+		region := os.Getenv("AWS_REGION")
+		os.Setenv("AWS_REGION", "us-west-2")
+		defer func() {
+			os.Setenv("AWS_REGION", region)
+		}()
+
+		awsCfg, err := config.LoadDefaultConfig(context.TODO(),
+			config.WithRegion("us-west-2"),
+			config.WithCredentialsProvider(
+				getCredentialProvider("AKID", "SECRET_KEY", "TOKEN"),
+			),
+		)
+		assert.NoError(t, err)
+
+		signer, err := NewSigner(awsCfg)
+		assert.NoError(t, err)
+
+		err = signer.SignRequest(req)
+		assert.NoError(t, err)
+
+		q := req.Header
+		assert.NotEmpty(t, q.Get("Authorization"))
+		assert.NotEmpty(t, q.Get("X-Amz-Date"))
+	})
+	t.Run("sign request success with body", func(t *testing.T) {
+		req, err := http.NewRequest(
+			http.MethodPost, "https://localhost:9200",
+			bytes.NewBuffer([]byte(`some data`)))
+		assert.NoError(t, err)
+		region := os.Getenv("AWS_REGION")
+		os.Setenv("AWS_REGION", "us-west-2")
+		defer func() {
+			os.Setenv("AWS_REGION", region)
+		}()
+
+		awsCfg, err := config.LoadDefaultConfig(context.TODO(),
+			config.WithRegion("us-west-2"),
+			config.WithCredentialsProvider(
+				getCredentialProvider("AKID", "SECRET_KEY", "TOKEN"),
+			),
+		)
+		assert.NoError(t, err)
+
+		signer, err := NewSigner(awsCfg)
+		assert.NoError(t, err)
+
+		err = signer.SignRequest(req)
+		assert.NoError(t, err)
+		q := req.Header
+		assert.NotEmpty(t, q.Get("Authorization"))
+		assert.NotEmpty(t, q.Get("X-Amz-Date"))
+	})
+
+	t.Run("sign request success with body for other AWS Services", func(t *testing.T) {
+		req, err := http.NewRequest(
+			http.MethodPost, "https://localhost:9200",
+			bytes.NewBuffer([]byte(`some data`)))
+		assert.NoError(t, err)
+		region := os.Getenv("AWS_REGION")
+		os.Setenv("AWS_REGION", "us-west-2")
+		defer func() {
+			os.Setenv("AWS_REGION", region)
+		}()
+
+		awsCfg, err := config.LoadDefaultConfig(context.TODO(),
+			config.WithRegion("us-west-2"),
+			config.WithCredentialsProvider(
+				getCredentialProvider("AKID", "SECRET_KEY", "TOKEN"),
+			),
+		)
+		assert.NoError(t, err)
+
+		signer, err := NewSignerWithService(awsCfg, "ec")
+		assert.NoError(t, err)
+
+		assert.NoError(t, err)
+		err = signer.SignRequest(req)
+		assert.NoError(t, err)
+		q := req.Header
+		assert.NotEmpty(t, q.Get("Authorization"))
+		assert.NotEmpty(t, q.Get("X-Amz-Date"))
+	})
+
+	t.Run("sign request failed due to invalid service", func(t *testing.T) {
+		awsCfg, err := config.LoadDefaultConfig(context.TODO(),
+			config.WithRegion("us-west-2"),
+			config.WithCredentialsProvider(
+				getCredentialProvider("AKID", "SECRET_KEY", "TOKEN"),
+			),
+		)
+		assert.NoError(t, err)
+
+		_, err = NewSignerWithService(awsCfg, "")
+		assert.EqualError(t, err, "service cannot be empty")
+	})
+}