From 229c8eabe84916f3e7bbdb70cd7f6aa7054f0f46 Mon Sep 17 00:00:00 2001 From: sbiscigl Date: Mon, 29 Sep 2025 15:50:20 -0400 Subject: [PATCH] ignore endpoint discovery for endpoint override --- cmake/sdksCommon.cmake | 1 + .../source/TimestreamQueryClient.cpp | 28 +++--- .../source/TimestreamWriteClient.cpp | 36 ++++---- .../CMakeLists.txt | 33 +++++++ .../TimeStreamQueryUnitTests.cpp | 92 +++++++++++++++++++ ...ientOperationEndpointDiscoveryWithRules.vm | 2 +- ...ientOperationsEndpointPrepareCommonBody.vm | 2 +- 7 files changed, 160 insertions(+), 34 deletions(-) create mode 100644 tests/aws-cpp-sdk-timestream-query-unit-tests/CMakeLists.txt create mode 100644 tests/aws-cpp-sdk-timestream-query-unit-tests/TimeStreamQueryUnitTests.cpp diff --git a/cmake/sdksCommon.cmake b/cmake/sdksCommon.cmake index 4d66f46c147..d6e18bfa7e6 100644 --- a/cmake/sdksCommon.cmake +++ b/cmake/sdksCommon.cmake @@ -114,6 +114,7 @@ list(APPEND SDK_TEST_PROJECT_LIST "sqs:tests/aws-cpp-sdk-sqs-integration-tests") list(APPEND SDK_TEST_PROJECT_LIST "sqs:tests/aws-cpp-sdk-sqs-unit-tests") list(APPEND SDK_TEST_PROJECT_LIST "transfer:tests/aws-cpp-sdk-transfer-tests") list(APPEND SDK_TEST_PROJECT_LIST "text-to-speech:tests/aws-cpp-sdk-text-to-speech-tests,tests/aws-cpp-sdk-polly-sample") +list(APPEND SDK_TEST_PROJECT_LIST "timestream-query:tests/aws-cpp-sdk-timestream-query-unit-tests") list(APPEND SDK_TEST_PROJECT_LIST "transcribestreaming:tests/aws-cpp-sdk-transcribestreaming-integ-tests") list(APPEND SDK_TEST_PROJECT_LIST "eventbridge:tests/aws-cpp-sdk-eventbridge-tests") list(APPEND SDK_TEST_PROJECT_LIST "dsql:tests/aws-cpp-sdk-dsql-unit-tests") diff --git a/generated/src/aws-cpp-sdk-timestream-query/source/TimestreamQueryClient.cpp b/generated/src/aws-cpp-sdk-timestream-query/source/TimestreamQueryClient.cpp index de0ab4d726e..0da01844919 100644 --- a/generated/src/aws-cpp-sdk-timestream-query/source/TimestreamQueryClient.cpp +++ b/generated/src/aws-cpp-sdk-timestream-query/source/TimestreamQueryClient.cpp @@ -226,7 +226,7 @@ CancelQueryOutcome TimestreamQueryClient::CancelQuery(const CancelQueryRequest& } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "CancelQuery" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -295,7 +295,7 @@ CreateScheduledQueryOutcome TimestreamQueryClient::CreateScheduledQuery(const Cr } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "CreateScheduledQuery" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -364,7 +364,7 @@ DeleteScheduledQueryOutcome TimestreamQueryClient::DeleteScheduledQuery(const De } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "DeleteScheduledQuery" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -433,7 +433,7 @@ DescribeAccountSettingsOutcome TimestreamQueryClient::DescribeAccountSettings(co } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "DescribeAccountSettings" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -528,7 +528,7 @@ DescribeScheduledQueryOutcome TimestreamQueryClient::DescribeScheduledQuery(cons } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "DescribeScheduledQuery" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -597,7 +597,7 @@ ExecuteScheduledQueryOutcome TimestreamQueryClient::ExecuteScheduledQuery(const } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "ExecuteScheduledQuery" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -666,7 +666,7 @@ ListScheduledQueriesOutcome TimestreamQueryClient::ListScheduledQueries(const Li } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "ListScheduledQueries" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -735,7 +735,7 @@ ListTagsForResourceOutcome TimestreamQueryClient::ListTagsForResource(const List } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "ListTagsForResource" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -804,7 +804,7 @@ PrepareQueryOutcome TimestreamQueryClient::PrepareQuery(const PrepareQueryReques } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "PrepareQuery" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -873,7 +873,7 @@ QueryOutcome TimestreamQueryClient::Query(const QueryRequest& request) const } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "Query" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -942,7 +942,7 @@ TagResourceOutcome TimestreamQueryClient::TagResource(const TagResourceRequest& } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "TagResource" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1011,7 +1011,7 @@ UntagResourceOutcome TimestreamQueryClient::UntagResource(const UntagResourceReq } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "UntagResource" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1080,7 +1080,7 @@ UpdateAccountSettingsOutcome TimestreamQueryClient::UpdateAccountSettings(const } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "UpdateAccountSettings" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1149,7 +1149,7 @@ UpdateScheduledQueryOutcome TimestreamQueryClient::UpdateScheduledQuery(const Up } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "UpdateScheduledQuery" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" diff --git a/generated/src/aws-cpp-sdk-timestream-write/source/TimestreamWriteClient.cpp b/generated/src/aws-cpp-sdk-timestream-write/source/TimestreamWriteClient.cpp index 3d047bf5e0c..152fa6699b9 100644 --- a/generated/src/aws-cpp-sdk-timestream-write/source/TimestreamWriteClient.cpp +++ b/generated/src/aws-cpp-sdk-timestream-write/source/TimestreamWriteClient.cpp @@ -230,7 +230,7 @@ CreateBatchLoadTaskOutcome TimestreamWriteClient::CreateBatchLoadTask(const Crea } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "CreateBatchLoadTask" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -299,7 +299,7 @@ CreateDatabaseOutcome TimestreamWriteClient::CreateDatabase(const CreateDatabase } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "CreateDatabase" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -368,7 +368,7 @@ CreateTableOutcome TimestreamWriteClient::CreateTable(const CreateTableRequest& } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "CreateTable" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -437,7 +437,7 @@ DeleteDatabaseOutcome TimestreamWriteClient::DeleteDatabase(const DeleteDatabase } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "DeleteDatabase" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -506,7 +506,7 @@ DeleteTableOutcome TimestreamWriteClient::DeleteTable(const DeleteTableRequest& } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "DeleteTable" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -575,7 +575,7 @@ DescribeBatchLoadTaskOutcome TimestreamWriteClient::DescribeBatchLoadTask(const } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "DescribeBatchLoadTask" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -644,7 +644,7 @@ DescribeDatabaseOutcome TimestreamWriteClient::DescribeDatabase(const DescribeDa } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "DescribeDatabase" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -739,7 +739,7 @@ DescribeTableOutcome TimestreamWriteClient::DescribeTable(const DescribeTableReq } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "DescribeTable" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -808,7 +808,7 @@ ListBatchLoadTasksOutcome TimestreamWriteClient::ListBatchLoadTasks(const ListBa } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "ListBatchLoadTasks" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -877,7 +877,7 @@ ListDatabasesOutcome TimestreamWriteClient::ListDatabases(const ListDatabasesReq } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "ListDatabases" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -946,7 +946,7 @@ ListTablesOutcome TimestreamWriteClient::ListTables(const ListTablesRequest& req } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "ListTables" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1015,7 +1015,7 @@ ListTagsForResourceOutcome TimestreamWriteClient::ListTagsForResource(const List } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "ListTagsForResource" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1084,7 +1084,7 @@ ResumeBatchLoadTaskOutcome TimestreamWriteClient::ResumeBatchLoadTask(const Resu } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "ResumeBatchLoadTask" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1153,7 +1153,7 @@ TagResourceOutcome TimestreamWriteClient::TagResource(const TagResourceRequest& } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "TagResource" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1222,7 +1222,7 @@ UntagResourceOutcome TimestreamWriteClient::UntagResource(const UntagResourceReq } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "UntagResource" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1291,7 +1291,7 @@ UpdateDatabaseOutcome TimestreamWriteClient::UpdateDatabase(const UpdateDatabase } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "UpdateDatabase" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1360,7 +1360,7 @@ UpdateTableOutcome TimestreamWriteClient::UpdateTable(const UpdateTableRequest& } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "UpdateTable" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" @@ -1429,7 +1429,7 @@ WriteRecordsOutcome TimestreamWriteClient::WriteRecords(const WriteRecordsReques } } } - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "WriteRecords" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" diff --git a/tests/aws-cpp-sdk-timestream-query-unit-tests/CMakeLists.txt b/tests/aws-cpp-sdk-timestream-query-unit-tests/CMakeLists.txt new file mode 100644 index 00000000000..802c8823817 --- /dev/null +++ b/tests/aws-cpp-sdk-timestream-query-unit-tests/CMakeLists.txt @@ -0,0 +1,33 @@ +add_project(aws-cpp-sdk-timestream-query-unit-tests + "Unit Tests for the Timestream Query SDK Client" + aws-cpp-sdk-timestream-query + testing-resources + aws_test_main + aws-cpp-sdk-core) + +add_definitions(-DRESOURCES_DIR="${CMAKE_CURRENT_SOURCE_DIR}/resources") + +if(MSVC AND BUILD_SHARED_LIBS) + add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1) +endif() + +enable_testing() + +if(PLATFORM_ANDROID AND BUILD_SHARED_LIBS) + add_library(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/TimeStreamQueryUnitTests.cpp) +else() + add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/TimeStreamQueryUnitTests.cpp) +endif() + +set_compiler_flags(${PROJECT_NAME}) +set_compiler_warnings(${PROJECT_NAME}) + +target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS}) + +if(MSVC AND BUILD_SHARED_LIBS) + set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:aws-cpp-sdk-timestream-query.dll /DELAYLOAD:aws-cpp-sdk-core.dll") + target_link_libraries(${PROJECT_NAME} delayimp.lib) +endif() + +include(GoogleTest) +gtest_add_tests(TARGET ${PROJECT_NAME}) diff --git a/tests/aws-cpp-sdk-timestream-query-unit-tests/TimeStreamQueryUnitTests.cpp b/tests/aws-cpp-sdk-timestream-query-unit-tests/TimeStreamQueryUnitTests.cpp new file mode 100644 index 00000000000..9e12eefced5 --- /dev/null +++ b/tests/aws-cpp-sdk-timestream-query-unit-tests/TimeStreamQueryUnitTests.cpp @@ -0,0 +1,92 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace Aws; +using namespace Aws::Client; +using namespace Aws::Auth; +using namespace Aws::Http; +using namespace Aws::Http::Standard; +using namespace Aws::TimestreamQuery; +using namespace Aws::TimestreamQuery::Model; + +namespace { +const char* ALLOCATION_TAG = "TimestreamQueryUnitTest"; +} + +class TimestreamQueryUnitTest : public testing::Test { + protected: + static void SetUpTestSuite() { +#ifdef USE_AWS_MEMORY_MANAGEMENT + testMemorySystem_.reset(new ExactTestMemorySystem(1024, 128)); + options_.memoryManagementOptions.memoryManager = testMemorySystem_.get(); +#endif + InitAPI(options_); + mockClientFactory_ = Aws::MakeShared(ALLOCATION_TAG); + mockHttpClient_ = Aws::MakeShared(ALLOCATION_TAG); + mockClientFactory_->SetClient(mockHttpClient_); + SetHttpClientFactory(mockClientFactory_); + } + + static void TearDownTestSuite() { + mockClientFactory_.reset(); + mockHttpClient_.reset(); + ShutdownAPI(options_); +#ifdef USE_AWS_MEMORY_MANAGEMENT + EXPECT_EQ(testMemorySystem_->GetCurrentOutstandingAllocations(), 0ULL); + EXPECT_EQ(testMemorySystem_->GetCurrentBytesAllocated(), 0ULL); + EXPECT_TRUE(testMemorySystem_->IsClean()); + if (testMemorySystem_->GetCurrentOutstandingAllocations() != 0ULL) FAIL(); + if (testMemorySystem_->GetCurrentBytesAllocated() != 0ULL) FAIL(); + if (!testMemorySystem_->IsClean()) FAIL(); + testMemorySystem_.reset(); +#endif + } + + static SDKOptions options_; + static std::shared_ptr mockHttpClient_; + static std::shared_ptr mockClientFactory_; +#ifdef USE_AWS_MEMORY_MANAGEMENT + static std::unique_ptr testMemorySystem_; +#endif +}; + +SDKOptions TimestreamQueryUnitTest::options_; +std::shared_ptr TimestreamQueryUnitTest::mockHttpClient_ = nullptr; +std::shared_ptr TimestreamQueryUnitTest::mockClientFactory_ = nullptr; +#ifdef USE_AWS_MEMORY_MANAGEMENT +// this must be std:: because this is an utility to track allocations in the SDK and should not rely on SDK +std::unique_ptr TimestreamQueryUnitTest::testMemorySystem_ = nullptr; +#endif + +TEST_F(TimestreamQueryUnitTest, EndpointOverrideShouldDisableEndpointDiscovery) { + ClientConfigurationInitValues initValues{}; + initValues.shouldDisableIMDS = true; + TimestreamQueryClientConfiguration config{initValues}; + config.endpointOverride = "http://spacers-choice.com:8080"; + config.region = "us-east-1"; + const AWSCredentials credentials{}; + const TimestreamQueryClient client(credentials, nullptr, config); + + const auto responseStream = Aws::MakeShared(ALLOCATION_TAG, "mockuri", HttpMethod::HTTP_GET); + responseStream->SetResponseStreamFactory(Utils::Stream::DefaultResponseStreamFactoryMethod); + auto response = Aws::MakeShared(ALLOCATION_TAG, responseStream); + response->SetResponseCode(HttpResponseCode::OK); + response->AddHeader("Content-Type", "application/x-amz-json-1.0"); + response->AddHeader("x-amzn-RequestId", "a918fbf2-457a-4fe1-99ba-5685ce220fc1"); + + mockHttpClient_->AddResponseToReturn(response, [](IOStream& bodyStream) -> void { bodyStream << R"({})"; }); + + auto queryResponse = client.Query(QueryRequest{}.WithQueryString("SELECT 1")); + AWS_EXPECT_SUCCESS(queryResponse); + EXPECT_EQ(mockHttpClient_->GetMostRecentHttpRequest().GetUri().GetURIString(), "http://spacers-choice.com:8080"); +} diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationEndpointDiscoveryWithRules.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationEndpointDiscoveryWithRules.vm index cef3296fec7..e66ad539f59 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationEndpointDiscoveryWithRules.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationEndpointDiscoveryWithRules.vm @@ -75,7 +75,7 @@ } } #if($operation.requireEndpointDiscovery) - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "${operation.name}" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )" diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceClientOperationsEndpointPrepareCommonBody.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceClientOperationsEndpointPrepareCommonBody.vm index c304bf74e3a..96bec0305ee 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceClientOperationsEndpointPrepareCommonBody.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceClientOperationsEndpointPrepareCommonBody.vm @@ -120,7 +120,7 @@ } } #if($operation.requireEndpointDiscovery) - else + else if (m_clientConfiguration.endpointOverride.empty()) { Aws::String errorMessage = R"(Unable to perform "${operation.name}" without endpoint discovery. )" R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", )"