Skip to content

Commit f814810

Browse files
Merge pull request #24 from awslabs/DualStack
Dual stack implementation. Reworked Regions. Fixed utf-8 encoding problems.
2 parents 55cef56 + 48cc1b4 commit f814810

File tree

298 files changed

+1645
-3049
lines changed

Some content is hidden

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

298 files changed

+1645
-3049
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ CMake options are variables that can either be ON or OFF, with a controllable de
137137
##### ENABLE_RTTI
138138
(Defaults to ON) Controls whether or not the SDK is built with RTTI information
139139

140+
##### CPP_STANDARD
141+
(Defaults to 11) Allows you to specify a custom c++ standard for use with C++ 14 and 17 code-bases
142+
140143
##### ENABLE_TESTING
141144
(Defaults to ON) Controls whether or not the unit and integration test projects are built
142145

@@ -167,7 +170,7 @@ Several directories are appended with \*integration-tests. After building your p
167170
#### Dependencies:
168171
To compile in Linux, you must have the header files for libcurl, libopenssl, and libuuid. The packages are typically available in your package manager.
169172

170-
Libcurl example:
173+
Debian example:
171174
`sudo apt-get install libcurl-dev uuid-dev`
172175

173176
### Using the SDK
@@ -376,7 +379,7 @@ struct AWS_CORE_API ClientConfiguration
376379
Aws::String userAgent;
377380
Aws::Http::Scheme scheme;
378381
Aws::Region region;
379-
Aws::String authenticationRegion;
382+
bool useDualStack;
380383
unsigned maxConnections;
381384
long requestTimeoutMs;
382385
long connectTimeoutMs;
@@ -403,8 +406,8 @@ The default value for scheme is HTTPS. You can set this value to HTTP if the inf
403406
##### Region
404407
The region specifies where you want the client to communicate. Examples include us-east-1 or us-west-1. You must ensure the service you want to use has an endpoint in the region you configure.
405408

406-
##### Authentication Region
407-
The authentication region allows you to specify an arbitrary region to use for signing. If you don't set this we fall back to Region. If you do set this, you are also responsible for setting endpoint override to connect to the endpoint that cooresponds with your custom region.
409+
##### UseDualStack
410+
Sets the endpoint calculation to go to a dual stack (ipv6 enabled) endpoint. It is your responsibility to check that the service actually supports ipv6 in the region you specify.
408411

409412
##### Max Connections
410413
The default value for the maximum number of allowed connections to a single server for your HTTP communications is 25. You can set this value as high as you can support the bandwidth. We recommend a value around 25.

aws-cpp-sdk-acm/include/aws/acm/ACMEndpoint.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
namespace Aws
2121
{
2222

23-
enum class Region;
24-
2523
namespace ACM
2624
{
2725
namespace ACMEndpoint
2826
{
29-
AWS_ACM_API Aws::String ForRegion(Region region);
27+
AWS_ACM_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
3028
} // namespace ACMEndpoint
3129
} // namespace ACM
3230
} // namespace Aws

aws-cpp-sdk-acm/nuget/aws-cpp-sdk-acm.autopkg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ nuget {
1313
id = AWSSDKCPP-ACM;
1414

1515
// Version number. Follows NuGet standards. (currently SemVer 1.0)
16-
version : 0.13.20151208.15;
16+
version : @RUNTIME_MAJOR_VERSION@.20151208.@RUNTIME_MINOR_VERSION@;
1717

1818
// Display name for package.
1919
title: AWS SDK for C++ (AWS Certificate Manager);
@@ -48,7 +48,7 @@ nuget {
4848

4949
dependencies {
5050
packages: {
51-
AWSSDKCPP-Core/0.13.1
51+
AWSSDKCPP-Core/@RUNTIME_MAJOR_VERSION@.1
5252
}
5353
}
5454

aws-cpp-sdk-acm/source/ACMClient.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ static const char* ALLOCATION_TAG = "ACMClient";
5151
ACMClient::ACMClient(const Client::ClientConfiguration& clientConfiguration) :
5252
BASECLASS(clientConfiguration,
5353
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
54-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
55-
: clientConfiguration.authenticationRegion),
54+
SERVICE_NAME, clientConfiguration.region),
5655
Aws::MakeShared<ACMErrorMarshaller>(ALLOCATION_TAG)),
5756
m_executor(clientConfiguration.executor)
5857
{
@@ -62,8 +61,7 @@ ACMClient::ACMClient(const Client::ClientConfiguration& clientConfiguration) :
6261
ACMClient::ACMClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
6362
BASECLASS(clientConfiguration,
6463
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
65-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
66-
: clientConfiguration.authenticationRegion),
64+
SERVICE_NAME, clientConfiguration.region),
6765
Aws::MakeShared<ACMErrorMarshaller>(ALLOCATION_TAG)),
6866
m_executor(clientConfiguration.executor)
6967
{
@@ -74,8 +72,7 @@ ACMClient::ACMClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsP
7472
const Client::ClientConfiguration& clientConfiguration) :
7573
BASECLASS(clientConfiguration,
7674
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
77-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
78-
: clientConfiguration.authenticationRegion),
75+
SERVICE_NAME, clientConfiguration.region),
7976
Aws::MakeShared<ACMErrorMarshaller>(ALLOCATION_TAG)),
8077
m_executor(clientConfiguration.executor)
8178
{
@@ -91,9 +88,9 @@ void ACMClient::init(const ClientConfiguration& config)
9188
Aws::StringStream ss;
9289
ss << SchemeMapper::ToString(config.scheme) << "://";
9390

94-
if(config.endpointOverride.empty() && config.authenticationRegion.empty())
91+
if(config.endpointOverride.empty())
9592
{
96-
ss << ACMEndpoint::ForRegion(config.region);
93+
ss << ACMEndpoint::ForRegion(config.region, config.useDualStack);
9794
}
9895
else
9996
{

aws-cpp-sdk-acm/source/ACMEndpoint.cpp

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
* permissions and limitations under the License.
1414
*/
1515
#include <aws/acm/ACMEndpoint.h>
16-
#include <aws/core/utils/memory/stl/AWSMap.h>
16+
#include <aws/core/utils/memory/stl/AWSStringStream.h>
17+
#include <aws/core/utils/HashingUtils.h>
1718

1819
using namespace Aws;
1920
using namespace Aws::ACM;
@@ -24,35 +25,20 @@ namespace ACM
2425
{
2526
namespace ACMEndpoint
2627
{
27-
Aws::String ForRegion(Region region)
28+
29+
30+
Aws::String ForRegion(const Aws::String& regionName, bool useDualStack)
2831
{
29-
switch(region)
32+
Aws::StringStream ss;
33+
ss << "acm" << ".";
34+
35+
if(useDualStack)
3036
{
31-
case Region::US_EAST_1:
32-
return "acm.us-east-1.amazonaws.com";
33-
case Region::US_WEST_1:
34-
return "acm.us-west-1.amazonaws.com";
35-
case Region::US_WEST_2:
36-
return "acm.us-west-2.amazonaws.com";
37-
case Region::EU_WEST_1:
38-
return "acm.eu-west-1.amazonaws.com";
39-
case Region::EU_CENTRAL_1:
40-
return "acm.eu-central-1.amazonaws.com";
41-
case Region::AP_SOUTHEAST_1:
42-
return "acm.ap-southeast-1.amazonaws.com";
43-
case Region::AP_SOUTHEAST_2:
44-
return "acm.ap-southeast-2.amazonaws.com";
45-
case Region::AP_NORTHEAST_1:
46-
return "acm.ap-northeast-1.amazonaws.com";
47-
case Region::AP_NORTHEAST_2:
48-
return "acm.ap-northeast-2.amazonaws.com";
49-
case Region::SA_EAST_1:
50-
return "acm.sa-east-1.amazonaws.com";
51-
case Region::AP_SOUTH_1:
52-
return "acm.ap-south-1.amazonaws.com";
53-
default:
54-
return "acm.us-east-1.amazonaws.com";
37+
ss << "dualstack.";
5538
}
39+
40+
ss << regionName << ".amazonaws.com";
41+
return ss.str();
5642
}
5743

5844
} // namespace ACMEndpoint

aws-cpp-sdk-apigateway/include/aws/apigateway/APIGatewayEndpoint.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
namespace Aws
2121
{
2222

23-
enum class Region;
24-
2523
namespace APIGateway
2624
{
2725
namespace APIGatewayEndpoint
2826
{
29-
AWS_APIGATEWAY_API Aws::String ForRegion(Region region);
27+
AWS_APIGATEWAY_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
3028
} // namespace APIGatewayEndpoint
3129
} // namespace APIGateway
3230
} // namespace Aws

aws-cpp-sdk-apigateway/nuget/aws-cpp-sdk-apigateway.autopkg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ nuget {
1313
id = AWSSDKCPP-APIGateway;
1414

1515
// Version number. Follows NuGet standards. (currently SemVer 1.0)
16-
version : 0.13.20150709.15;
16+
version : @RUNTIME_MAJOR_VERSION@.20150709.@RUNTIME_MINOR_VERSION@;
1717

1818
// Display name for package.
1919
title: AWS SDK for C++ (Amazon API Gateway);
@@ -48,7 +48,7 @@ nuget {
4848

4949
dependencies {
5050
packages: {
51-
AWSSDKCPP-Core/0.13.1
51+
AWSSDKCPP-Core/@RUNTIME_MAJOR_VERSION@.1
5252
}
5353
}
5454

aws-cpp-sdk-apigateway/source/APIGatewayClient.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ static const char* ALLOCATION_TAG = "APIGatewayClient";
119119
APIGatewayClient::APIGatewayClient(const Client::ClientConfiguration& clientConfiguration) :
120120
BASECLASS(clientConfiguration,
121121
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
122-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
123-
: clientConfiguration.authenticationRegion),
122+
SERVICE_NAME, clientConfiguration.region),
124123
Aws::MakeShared<APIGatewayErrorMarshaller>(ALLOCATION_TAG)),
125124
m_executor(clientConfiguration.executor)
126125
{
@@ -130,8 +129,7 @@ APIGatewayClient::APIGatewayClient(const Client::ClientConfiguration& clientConf
130129
APIGatewayClient::APIGatewayClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
131130
BASECLASS(clientConfiguration,
132131
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
133-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
134-
: clientConfiguration.authenticationRegion),
132+
SERVICE_NAME, clientConfiguration.region),
135133
Aws::MakeShared<APIGatewayErrorMarshaller>(ALLOCATION_TAG)),
136134
m_executor(clientConfiguration.executor)
137135
{
@@ -142,8 +140,7 @@ APIGatewayClient::APIGatewayClient(const std::shared_ptr<AWSCredentialsProvider>
142140
const Client::ClientConfiguration& clientConfiguration) :
143141
BASECLASS(clientConfiguration,
144142
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
145-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
146-
: clientConfiguration.authenticationRegion),
143+
SERVICE_NAME, clientConfiguration.region),
147144
Aws::MakeShared<APIGatewayErrorMarshaller>(ALLOCATION_TAG)),
148145
m_executor(clientConfiguration.executor)
149146
{
@@ -159,9 +156,9 @@ void APIGatewayClient::init(const ClientConfiguration& config)
159156
Aws::StringStream ss;
160157
ss << SchemeMapper::ToString(config.scheme) << "://";
161158

162-
if(config.endpointOverride.empty() && config.authenticationRegion.empty())
159+
if(config.endpointOverride.empty())
163160
{
164-
ss << APIGatewayEndpoint::ForRegion(config.region);
161+
ss << APIGatewayEndpoint::ForRegion(config.region, config.useDualStack);
165162
}
166163
else
167164
{

aws-cpp-sdk-apigateway/source/APIGatewayEndpoint.cpp

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
* permissions and limitations under the License.
1414
*/
1515
#include <aws/apigateway/APIGatewayEndpoint.h>
16-
#include <aws/core/utils/memory/stl/AWSMap.h>
16+
#include <aws/core/utils/memory/stl/AWSStringStream.h>
17+
#include <aws/core/utils/HashingUtils.h>
1718

1819
using namespace Aws;
1920
using namespace Aws::APIGateway;
@@ -24,35 +25,20 @@ namespace APIGateway
2425
{
2526
namespace APIGatewayEndpoint
2627
{
27-
Aws::String ForRegion(Region region)
28+
29+
30+
Aws::String ForRegion(const Aws::String& regionName, bool useDualStack)
2831
{
29-
switch(region)
32+
Aws::StringStream ss;
33+
ss << "apigateway" << ".";
34+
35+
if(useDualStack)
3036
{
31-
case Region::US_EAST_1:
32-
return "apigateway.us-east-1.amazonaws.com";
33-
case Region::US_WEST_1:
34-
return "apigateway.us-west-1.amazonaws.com";
35-
case Region::US_WEST_2:
36-
return "apigateway.us-west-2.amazonaws.com";
37-
case Region::EU_WEST_1:
38-
return "apigateway.eu-west-1.amazonaws.com";
39-
case Region::EU_CENTRAL_1:
40-
return "apigateway.eu-central-1.amazonaws.com";
41-
case Region::AP_SOUTHEAST_1:
42-
return "apigateway.ap-southeast-1.amazonaws.com";
43-
case Region::AP_SOUTHEAST_2:
44-
return "apigateway.ap-southeast-2.amazonaws.com";
45-
case Region::AP_NORTHEAST_1:
46-
return "apigateway.ap-northeast-1.amazonaws.com";
47-
case Region::AP_NORTHEAST_2:
48-
return "apigateway.ap-northeast-2.amazonaws.com";
49-
case Region::SA_EAST_1:
50-
return "apigateway.sa-east-1.amazonaws.com";
51-
case Region::AP_SOUTH_1:
52-
return "apigateway.ap-south-1.amazonaws.com";
53-
default:
54-
return "apigateway.us-east-1.amazonaws.com";
37+
ss << "dualstack.";
5538
}
39+
40+
ss << regionName << ".amazonaws.com";
41+
return ss.str();
5642
}
5743

5844
} // namespace APIGatewayEndpoint

aws-cpp-sdk-application-autoscaling/include/aws/application-autoscaling/ApplicationAutoScalingEndpoint.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
namespace Aws
2121
{
2222

23-
enum class Region;
24-
2523
namespace ApplicationAutoScaling
2624
{
2725
namespace ApplicationAutoScalingEndpoint
2826
{
29-
AWS_APPLICATIONAUTOSCALING_API Aws::String ForRegion(Region region);
27+
AWS_APPLICATIONAUTOSCALING_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
3028
} // namespace ApplicationAutoScalingEndpoint
3129
} // namespace ApplicationAutoScaling
3230
} // namespace Aws

aws-cpp-sdk-application-autoscaling/nuget/aws-cpp-sdk-application-autoscaling.autopkg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ nuget {
1313
id = AWSSDKCPP-ApplicationAutoScaling;
1414

1515
// Version number. Follows NuGet standards. (currently SemVer 1.0)
16-
version : 0.13.20160206.15;
16+
version : @RUNTIME_MAJOR_VERSION@.20160206.@RUNTIME_MINOR_VERSION@;
1717

1818
// Display name for package.
1919
title: AWS SDK for C++ (Application Auto Scaling);
@@ -48,7 +48,7 @@ nuget {
4848

4949
dependencies {
5050
packages: {
51-
AWSSDKCPP-Core/0.13.1
51+
AWSSDKCPP-Core/@RUNTIME_MAJOR_VERSION@.1
5252
}
5353
}
5454

aws-cpp-sdk-application-autoscaling/source/ApplicationAutoScalingClient.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ static const char* ALLOCATION_TAG = "ApplicationAutoScalingClient";
4949
ApplicationAutoScalingClient::ApplicationAutoScalingClient(const Client::ClientConfiguration& clientConfiguration) :
5050
BASECLASS(clientConfiguration,
5151
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
52-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
53-
: clientConfiguration.authenticationRegion),
52+
SERVICE_NAME, clientConfiguration.region),
5453
Aws::MakeShared<ApplicationAutoScalingErrorMarshaller>(ALLOCATION_TAG)),
5554
m_executor(clientConfiguration.executor)
5655
{
@@ -60,8 +59,7 @@ ApplicationAutoScalingClient::ApplicationAutoScalingClient(const Client::ClientC
6059
ApplicationAutoScalingClient::ApplicationAutoScalingClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
6160
BASECLASS(clientConfiguration,
6261
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
63-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
64-
: clientConfiguration.authenticationRegion),
62+
SERVICE_NAME, clientConfiguration.region),
6563
Aws::MakeShared<ApplicationAutoScalingErrorMarshaller>(ALLOCATION_TAG)),
6664
m_executor(clientConfiguration.executor)
6765
{
@@ -72,8 +70,7 @@ ApplicationAutoScalingClient::ApplicationAutoScalingClient(const std::shared_ptr
7270
const Client::ClientConfiguration& clientConfiguration) :
7371
BASECLASS(clientConfiguration,
7472
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
75-
SERVICE_NAME, clientConfiguration.authenticationRegion.empty() ? RegionMapper::GetRegionName(clientConfiguration.region)
76-
: clientConfiguration.authenticationRegion),
73+
SERVICE_NAME, clientConfiguration.region),
7774
Aws::MakeShared<ApplicationAutoScalingErrorMarshaller>(ALLOCATION_TAG)),
7875
m_executor(clientConfiguration.executor)
7976
{
@@ -89,9 +86,9 @@ void ApplicationAutoScalingClient::init(const ClientConfiguration& config)
8986
Aws::StringStream ss;
9087
ss << SchemeMapper::ToString(config.scheme) << "://";
9188

92-
if(config.endpointOverride.empty() && config.authenticationRegion.empty())
89+
if(config.endpointOverride.empty())
9390
{
94-
ss << ApplicationAutoScalingEndpoint::ForRegion(config.region);
91+
ss << ApplicationAutoScalingEndpoint::ForRegion(config.region, config.useDualStack);
9592
}
9693
else
9794
{

0 commit comments

Comments
 (0)