Skip to content

Commit 5379331

Browse files
authored
docs: update versioning (#183)
1 parent df27962 commit 5379331

File tree

6 files changed

+84
-88
lines changed

6 files changed

+84
-88
lines changed

docs/Documentation.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
- [Sample Code](./using-the-aws-driver/UsingTheAwsDriver.md#sample-code)
2424
- [08007 - Connection Failure During Transaction](./using-the-aws-driver/UsingTheAwsDriver.md#08007---connection-failure-during-transaction)
2525
- [Sample Code](./using-the-aws-driver/UsingTheAwsDriver.md#sample-code-1)
26-
- [AWS Authentication](./using-the-aws-driver/UsingTheAwsDriver.md#aws-authentication)
27-
- [IAM Authentication](./using-the-aws-driver/UsingTheAwsDriver.md#iam-authentication)
28-
- [How to use IAM](./using-the-aws-driver/UsingTheAwsDriver.md#how-to-use-iam)
29-
- [Secrets Manager Authentication](./using-the-aws-driver/UsingTheAwsDriver.md#secrets-manager-authentication)
30-
- [How to use Secrets Manager](./using-the-aws-driver/UsingTheAwsDriver.md#how-to-use-secrets-manager)
26+
- [AWS Authentication](./using-the-aws-driver/AwsAuthentication.md)
27+
- [IAM Authentication](./using-the-aws-driver/AwsAuthentication.md#iam-authentication)
28+
- [How to use IAM](./using-the-aws-driver/AwsAuthentication.md#how-to-use-iam)
29+
- [Secrets Manager Authentication](./using-the-aws-driver/AwsAuthentication.md#secrets-manager-authentication)
30+
- [How to use Secrets Manager](./using-the-aws-driver/AwsAuthentication.md#how-to-use-secrets-manager)
3131
- [Logging](./using-the-aws-driver/UsingTheAwsDriver.md#logging)
3232
- [Enabling Logs On Windows](./using-the-aws-driver/UsingTheAwsDriver.md#enabling-logs-on-windows)
3333
- [Example](./using-the-aws-driver/UsingTheAwsDriver.md#example)
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# Building the AWS SDK for C++
22
The driver supports AWS IAM and AWS Secrets Manager authentication by using [AWS SDK for C++](https://docs.aws.amazon.com/sdk-for-cpp/). The driver requires `aws-cpp-sdk-core`, `aws-cpp-sdk-rds`, and `aws-cpp-sdk-secretsmanager`. You can either build the SDK yourself directly from the source using the script under `scripts` folder or [download the libraries using a package manager](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/sdk-from-pm.html). The script will install the SDK under `aws_sdk/install` folder. The driver will look for SDK dependencies through `aws_sdk/install` folder and `CMAKE_PREFIX_PATH` environment variable.
3-
> **_NOTE:_** On Windows, depending on the use case, you may build the SDK as a static library or dynamic library. On Linux and macOS, you should always build the SDK as a dynamic library.
3+
> [!NOTE]\
4+
> On Windows, depending on the use case, you may build the SDK as a static library or dynamic library. On Linux and macOS, you should always build the SDK as a dynamic library.
45
56
## Windows
67
### For release version unit tests or driver
78
```
8-
.\scripts\build_aws_sdk_win.ps1 x64 Release ON "Visual Studio 16 2019"
9+
.\scripts\build_aws_sdk_win.ps1 x64 Release ON "Visual Studio 17 2022"
910
```
1011
### For debug version unit tests
1112
```
12-
.\scripts\build_aws_sdk_win.ps1 x64 Debug ON "Visual Studio 16 2019"
13+
.\scripts\build_aws_sdk_win.ps1 x64 Debug ON "Visual Studio 17 2022"
1314
```
14-
Note:
15-
- Use ```Visual Studio 17 2022`` for Visual Studio 2022.
16-
1715
## Linux/macOS
1816
```
1917
./scripts/build_aws_sdk_unix.sh Release
2018
```
2119

2220
## Troubleshoot
23-
See https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/troubleshooting-cmake.html
21+
See https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/troubleshooting-cmake.html

docs/building-the-aws-driver/BuildingTheAwsDriver.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@
55
1. Install the following programs to build the driver:
66
- [CMake](https://cmake.org/download/)
77
- [Visual Studio](https://visualstudio.microsoft.com/downloads/)
8-
> The driver has been built successfully using `Visual Studio 2019`, and it may not build correctly with other versions. When installing Visual Studio, ensure the `Visual C++ 2019` and `Visual Studio Tools for CMake` packages are also installed.
98
- [MySQL Server](https://dev.mysql.com/downloads/installer/)
109

1110
2. Refer to [Building the AWS SDK for C++](./BuildingAwsSdkCpp.md) to install required AWS dependencies.
1211

1312
3. Build the driver in the `build` directory with the following commands:
1413
```
15-
cmake -S . -B build -G "Visual Studio 16 2019" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.0" -DMYSQLCLIENT_STATIC_LINKING=TRUE
14+
cmake -S . -B build -G "Visual Studio 17 2022" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.3" -DMYSQLCLIENT_STATIC_LINKING=TRUE
1615
cmake --build build --config Release
1716
```
1817
4. To build the installer, MySQL 8.0.36 is required. Other MySQL versions may not work. Download the [MySQL 8.0.36](https://downloads.mysql.com/archives/community/) ZIP archive or msi installer. If the zip archive is used, unzip it to a folder before using it.
1918
2019
Run `build_installer.ps1` with specified MySQL 8.0.36 installation or unzipped folder path in a developer powershell. For example
2120
```
22-
.\build_installer.ps1 x64 Release "Visual Studio 16 2019" "C:\Users\MyUser\Downloads\mysql-8.0.36-winx64\mysql-8.0.36-winx64"
21+
.\build_installer.ps1 x64 Release "Visual Studio 17 2022" "C:\Users\MyUser\Downloads\mysql-8.0.36-winx64\mysql-8.0.36-winx64"
2322
```
2423
2524
### Troubleshooting:

docs/testing-the-aws-driver/TestingTheAwsDriver.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77

88
- For release version unit tests, run the following command from repository root
99
```
10-
cmake -S . -B build -G "Visual Studio 16 2019" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.0" -DMYSQLCLIENT_STATIC_LINKING=TRUE -DENABLE_UNIT_TESTS=TRUE
10+
cmake -S . -B build -G "Visual Studio 17 2022" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.3" -DMYSQLCLIENT_STATIC_LINKING=TRUE -DENABLE_UNIT_TESTS=TRUE
1111
cmake --build build --config Release
1212
```
1313
- For debug version unit tests
1414
1515
- Download MySQL debug binaries from [MySQL::Download MySQL Community Server](https://dev.mysql.com/downloads/mysql/).
1616
17-
- Extract the `mysqlclient.lib` from debug binaries. Make sure to backup your release version of mysqlclient.lib in `MYSQL_DIR\lib`, e.g. `C:\Program Files\MySQL\MySQL Server 8.0\lib`. Replace release version `mysqlclient.lib` with debug version of `mysqlclient.lib`.
17+
- Extract the `mysqlclient.lib` from debug binaries. Make sure to backup your release version of mysqlclient.lib in `MYSQL_DIR\lib`, e.g. `C:\Program Files\MySQL\MySQL Server 8.3\lib`. Replace release version `mysqlclient.lib` with debug version of `mysqlclient.lib`.
1818
- Run the following command from repository root
1919
2020
```
21-
cmake -S . -B build -G "Visual Studio 16 2019" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.0" -DMYSQLCLIENT_STATIC_LINKING=TRUE -DENABLE_UNIT_TESTS=TRUE -DCMAKE_BUILD_TYPE=Debug
21+
cmake -S . -B build -G "Visual Studio 17 2022" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.3" -DMYSQLCLIENT_STATIC_LINKING=TRUE -DENABLE_UNIT_TESTS=TRUE -DCMAKE_BUILD_TYPE=Debug
2222
cmake --build build --config Debug
2323
```
2424
- **MacOS**
2525
- Run the following command from repository root
2626
```
27-
cmake -S . -B build -G "Unix Makefiles" -DMYSQLCLIENT_STATIC_LINKING=true -DODBC_INCLUDES=/usr/local/Cellar/libiodbc/3.52.15/include -DENABLE_UNIT_TESTS=TRUE
27+
cmake -S . -B build -G "Unix Makefiles" -DMYSQLCLIENT_STATIC_LINKING=true -DODBC_INCLUDES=/usr/local/Cellar/libiodbc/3.52.16/include -DENABLE_UNIT_TESTS=TRUE
2828
cmake --build build --config Release
2929
```
3030
- **Linux**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## AWS Authentication
2+
3+
### IAM Authentication
4+
5+
AWS Identity and Access Management (IAM) grants users access control across all Amazon Web Services. IAM supports granular permissions, giving you the ability to grant different permissions to different users. For more information on IAM and it's use cases, please refer to the [IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html).
6+
7+
The AWS ODBC Driver for MySQL supports Amazon AWS Identity and Access Management (IAM) authentication. When using AWS IAM database authentication, the host URL must be a valid Amazon endpoint, and not a custom domain or an IP address.
8+
<br>ie. `db-identifier.cluster-XYZ.us-east-2.rds.amazonaws.com`
9+
10+
IAM database authentication use is limited to certain database engines. For more information on limitations and recommendations, please [review the IAM documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html).
11+
12+
#### How to use IAM?
13+
1. Enable AWS IAM database authentication on an existing database or create a new database with AWS IAM database authentication on the AWS RDS Console:
14+
1. If needed, review the documentation about [creating a new database](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html).
15+
2. If needed, review the documentation about [modifying an existing database](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html).
16+
2. Set up an [AWS IAM policy](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.IAMPolicy.html) for AWS IAM database authentication.
17+
3. [Create a database account](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.DBAccounts.html) using AWS IAM database authentication:
18+
Use the following commands to create a new IAM user:<br>
19+
`CREATE USER example_user_name IDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS';`
20+
`GRANT ALL PRIVILEGES ON example_database.* TO 'example_user_name'@'%';`
21+
4. Connect to a MySQL database with the following connection parameters configured in a DSN or connection string. (Note these are in addition to the parameters that you can configure for the [MySQL Connector/ODBC driver](https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-connection-parameters.html))
22+
23+
| Option | Description | Type | Required | Default |
24+
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|-------|----------|-------------|
25+
| `AUTHENTICATION_MODE` | Set to `IAM` to enable IAM Authentication. | char* | Yes | Off |
26+
| `AWS_REGION` | Region used to generate IAM tokens. | char* | No | `us-east-1` |
27+
| `IAM_HOST` | Host URL for IAM authentication. URL must be a valid Amazon endpoint, and not a custom domain or an IP address. | char* | Yes | Empty |
28+
| `IAM_PORT` | Port used for IAM authentication. | int | No | `3306` |
29+
| `IAM_EXPIRATION_TIME` | Amount of time in seconds before the generated IAM token expires. After expiration, future connections will require a new token to be generated. | int | No | `900` |
30+
31+
If you are working with the Windows DSN UI, click `Details >>` and navigate to the `AWS Authentication` tab to configure the parameters.
32+
33+
![sample_iam_dsn](../images/sample_iam_dsn.png)
34+
35+
### Secrets Manager Authentication
36+
37+
The AWS ODBC Driver for MySQL supports usage of database credentials stored as secrets in the [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/). When you connect using Secrets Manager authentication, the driver will retrieve the secret and the connection will be created with the credentials inside that secret.
38+
39+
#### How to use Secrets Manager
40+
The following parameters are required for the AWS Secrets Manager Connection Plugin to retrieve database credentials from the AWS Secrets Manager.
41+
42+
| Option | Description | Type | Required | Default |
43+
|-----------------------|--------------------------------------------------------------------|-------|--------------------------------|-------------|
44+
| `AUTHENTICATION_MODE` | Set to `SECRETS MANAGER` to enable Secrets Manager Authentication. | char* | Yes | Off |
45+
| `AWS_REGION` | Region of the secret. | char* | Optional when secret id is ARN | `us-east-1` |
46+
| `SECRET_ID` | Secret name or secret ARN. | char* | Yes | Empty |
47+
48+
If you are working with the Windows DSN UI, click `Details >>` and navigate to the `AWS Authentication` tab to configure the parameters.
49+
50+
![sample_sm_dsn](../images/sample_sm_dsn.png)

0 commit comments

Comments
 (0)