├── 408-Working-with-Aurora-and-Data-APIs ├── .gitignore ├── cdk-AWS-Cookbook-408 │ ├── cdk_aws_cookbook_408 │ │ └── __init__.py │ ├── requirements.txt │ ├── .gitignore │ ├── cdk.json │ ├── app.py │ ├── source.bat │ ├── setup.py │ └── helper.py └── policy-template.json ├── 407-Migrating-Databases-to-Amazon-RDS ├── .gitignore ├── cdk-AWS-Cookbook-407 │ ├── cdk_aws_cookbook_407 │ │ └── __init__.py │ ├── requirements.txt │ ├── lambda-layers │ │ ├── pymysql │ │ │ └── python │ │ │ │ ├── pymysql │ │ │ │ ├── constants │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── FLAG.py │ │ │ │ │ ├── SERVER_STATUS.py │ │ │ │ │ ├── FIELD_TYPE.py │ │ │ │ │ ├── COMMAND.py │ │ │ │ │ └── CLIENT.py │ │ │ │ ├── util.py │ │ │ │ ├── times.py │ │ │ │ ├── _compat.py │ │ │ │ └── optionfile.py │ │ │ │ └── PyMySQL-0.10.1.dist-info │ │ │ │ ├── REQUESTED │ │ │ │ ├── INSTALLER │ │ │ │ ├── top_level.txt │ │ │ │ ├── pbr.json │ │ │ │ ├── WHEEL │ │ │ │ └── LICENSE │ │ ├── sqlparse │ │ │ └── python │ │ │ │ ├── sqlparse-0.4.1.dist-info │ │ │ │ ├── REQUESTED │ │ │ │ ├── INSTALLER │ │ │ │ ├── top_level.txt │ │ │ │ ├── entry_points.txt │ │ │ │ ├── WHEEL │ │ │ │ └── LICENSE │ │ │ │ ├── bin │ │ │ │ └── sqlformat │ │ │ │ └── sqlparse │ │ │ │ ├── exceptions.py │ │ │ │ ├── engine │ │ │ │ ├── __init__.py │ │ │ │ └── filter_stack.py │ │ │ │ ├── __main__.py │ │ │ │ ├── compat.py │ │ │ │ └── filters │ │ │ │ ├── __init__.py │ │ │ │ ├── right_margin.py │ │ │ │ └── tokens.py │ │ └── smart_open │ │ │ └── python │ │ │ ├── smart_open-4.1.0.dist-info │ │ │ ├── REQUESTED │ │ │ ├── INSTALLER │ │ │ ├── top_level.txt │ │ │ ├── WHEEL │ │ │ └── LICENSE │ │ │ └── smart_open │ │ │ ├── tests │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── good_transport.py │ │ │ │ ├── no_schemes_transport.py │ │ │ │ └── missing_deps_transport.py │ │ │ ├── test_data │ │ │ │ ├── 1984.txt.gz │ │ │ │ ├── cp852.tsv.txt │ │ │ │ ├── crime-and-punishment.txt.gz │ │ │ │ ├── crime-and-punishment.txt.xz │ │ │ │ ├── crlf_at_1k_boundary.warc.gz │ │ │ │ └── crime-and-punishment.txt │ │ │ ├── __init__.py │ │ │ ├── test_utils.py │ │ │ ├── test_transport.py │ │ │ ├── test_package.py │ │ │ └── test_sanity.py │ │ │ ├── version.py │ │ │ ├── constants.py │ │ │ └── local_file.py │ ├── s3_content │ │ └── employees.sql.gz │ ├── .gitignore │ ├── cdk.json │ ├── app.py │ ├── source.bat │ ├── setup.py │ └── helper.py ├── assume-role-policy.json ├── table-mapping-all.json └── table-mapping-single-table.json ├── 402-Using-IAM-Authentication-with-RDS ├── .gitignore ├── cdk-AWS-Cookbook-402 │ ├── cdk_aws_cookbook_402 │ │ └── __init__.py │ ├── requirements.txt │ ├── s3_content │ │ ├── employees.sql.gz │ │ └── enable_iam_auth.sql.gz │ ├── .gitignore │ ├── cdk.json │ ├── app.py │ ├── source.bat │ ├── setup.py │ └── helper.py ├── lambda_function.zip ├── assume-role-policy.json ├── policy-template.json └── lambda_function.py ├── 403-Leveraging-RDS-Proxy-For-Db-Conns ├── .gitignore ├── cdk-AWS-Cookbook-403 │ ├── cdk_aws_cookbook_403 │ │ └── __init__.py │ ├── requirements.txt │ ├── lambda-layers │ │ ├── pymysql │ │ │ └── python │ │ │ │ ├── pymysql │ │ │ │ ├── constants │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── FLAG.py │ │ │ │ │ ├── SERVER_STATUS.py │ │ │ │ │ ├── FIELD_TYPE.py │ │ │ │ │ ├── COMMAND.py │ │ │ │ │ └── CLIENT.py │ │ │ │ ├── util.py │ │ │ │ ├── times.py │ │ │ │ ├── _compat.py │ │ │ │ └── optionfile.py │ │ │ │ ├── PyMySQL-0.10.1.dist-info │ │ │ │ ├── REQUESTED │ │ │ │ ├── INSTALLER │ │ │ │ ├── top_level.txt │ │ │ │ ├── pbr.json │ │ │ │ ├── WHEEL │ │ │ │ └── LICENSE │ │ │ │ └── AmazonRootCA1.pem │ │ ├── sqlparse │ │ │ └── python │ │ │ │ ├── sqlparse-0.4.1.dist-info │ │ │ │ ├── REQUESTED │ │ │ │ ├── INSTALLER │ │ │ │ ├── top_level.txt │ │ │ │ ├── entry_points.txt │ │ │ │ ├── WHEEL │ │ │ │ └── LICENSE │ │ │ │ ├── bin │ │ │ │ └── sqlformat │ │ │ │ └── sqlparse │ │ │ │ ├── exceptions.py │ │ │ │ ├── engine │ │ │ │ ├── __init__.py │ │ │ │ └── filter_stack.py │ │ │ │ ├── __main__.py │ │ │ │ ├── compat.py │ │ │ │ └── filters │ │ │ │ ├── __init__.py │ │ │ │ ├── right_margin.py │ │ │ │ └── tokens.py │ │ └── smart_open │ │ │ └── python │ │ │ ├── smart_open-4.1.0.dist-info │ │ │ ├── REQUESTED │ │ │ ├── INSTALLER │ │ │ ├── top_level.txt │ │ │ ├── WHEEL │ │ │ └── LICENSE │ │ │ └── smart_open │ │ │ ├── tests │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── good_transport.py │ │ │ │ ├── no_schemes_transport.py │ │ │ │ └── missing_deps_transport.py │ │ │ ├── test_data │ │ │ │ ├── 1984.txt.gz │ │ │ │ ├── cp852.tsv.txt │ │ │ │ ├── crime-and-punishment.txt.gz │ │ │ │ ├── crime-and-punishment.txt.xz │ │ │ │ ├── crlf_at_1k_boundary.warc.gz │ │ │ │ └── crime-and-punishment.txt │ │ │ ├── __init__.py │ │ │ ├── test_utils.py │ │ │ ├── test_transport.py │ │ │ ├── test_package.py │ │ │ └── test_sanity.py │ │ │ ├── version.py │ │ │ ├── constants.py │ │ │ └── local_file.py │ ├── s3_content │ │ └── employees.sql.gz │ ├── .gitignore │ ├── cdk.json │ ├── app.py │ ├── source.bat │ ├── db-app-lambda │ │ └── lambda_function.py │ ├── setup.py │ └── helper.py ├── assume-role-policy.json └── policy-template.json ├── 401-Creating-an-Aurora-Serverless-DB └── cdk-AWS-Cookbook-401 │ ├── requirements.txt │ ├── cdk_aws_cookbook_401 │ └── __init__.py │ ├── .gitignore │ ├── cdk.json │ ├── app.py │ ├── source.bat │ ├── setup.py │ ├── helper.py │ └── README.md ├── 404-Encrypt-Existing-RDS-MySQL-DB └── cdk-AWS-Cookbook-404 │ ├── cdk_aws_cookbook_404 │ └── __init__.py │ ├── requirements.txt │ ├── lambda-layers │ ├── pymysql │ │ └── python │ │ │ ├── pymysql │ │ │ ├── constants │ │ │ │ ├── __init__.py │ │ │ │ ├── FLAG.py │ │ │ │ ├── SERVER_STATUS.py │ │ │ │ ├── FIELD_TYPE.py │ │ │ │ ├── COMMAND.py │ │ │ │ └── CLIENT.py │ │ │ ├── util.py │ │ │ ├── times.py │ │ │ ├── _compat.py │ │ │ └── optionfile.py │ │ │ └── PyMySQL-0.10.1.dist-info │ │ │ ├── REQUESTED │ │ │ ├── INSTALLER │ │ │ ├── top_level.txt │ │ │ ├── pbr.json │ │ │ ├── WHEEL │ │ │ └── LICENSE │ ├── smart_open │ │ └── python │ │ │ ├── smart_open-4.1.0.dist-info │ │ │ ├── REQUESTED │ │ │ ├── INSTALLER │ │ │ ├── top_level.txt │ │ │ ├── WHEEL │ │ │ └── LICENSE │ │ │ └── smart_open │ │ │ ├── tests │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── good_transport.py │ │ │ │ ├── no_schemes_transport.py │ │ │ │ └── missing_deps_transport.py │ │ │ ├── test_data │ │ │ │ ├── 1984.txt.gz │ │ │ │ ├── cp852.tsv.txt │ │ │ │ ├── crime-and-punishment.txt.gz │ │ │ │ ├── crime-and-punishment.txt.xz │ │ │ │ ├── crlf_at_1k_boundary.warc.gz │ │ │ │ └── crime-and-punishment.txt │ │ │ ├── __init__.py │ │ │ ├── test_utils.py │ │ │ ├── test_transport.py │ │ │ ├── test_package.py │ │ │ └── test_sanity.py │ │ │ ├── version.py │ │ │ ├── constants.py │ │ │ └── local_file.py │ └── sqlparse │ │ └── python │ │ ├── sqlparse-0.4.1.dist-info │ │ ├── REQUESTED │ │ ├── INSTALLER │ │ ├── top_level.txt │ │ ├── entry_points.txt │ │ ├── WHEEL │ │ └── LICENSE │ │ ├── bin │ │ └── sqlformat │ │ └── sqlparse │ │ ├── exceptions.py │ │ ├── engine │ │ ├── __init__.py │ │ └── filter_stack.py │ │ ├── __main__.py │ │ ├── compat.py │ │ └── filters │ │ ├── __init__.py │ │ ├── right_margin.py │ │ └── tokens.py │ ├── s3_content │ └── employees.sql.gz │ ├── .gitignore │ ├── cdk.json │ ├── app.py │ ├── source.bat │ ├── setup.py │ ├── helper.py │ └── README.md ├── 405-Rotating-Database-Passwords-in-RDS ├── cdk-AWS-Cookbook-405 │ ├── cdk_aws_cookbook_405 │ │ └── __init__.py │ ├── requirements.txt │ ├── lambda-layers │ │ ├── pymysql │ │ │ └── python │ │ │ │ ├── pymysql │ │ │ │ ├── constants │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── FLAG.py │ │ │ │ │ ├── SERVER_STATUS.py │ │ │ │ │ ├── FIELD_TYPE.py │ │ │ │ │ ├── COMMAND.py │ │ │ │ │ └── CLIENT.py │ │ │ │ ├── util.py │ │ │ │ ├── times.py │ │ │ │ ├── _compat.py │ │ │ │ └── optionfile.py │ │ │ │ └── PyMySQL-0.10.1.dist-info │ │ │ │ ├── REQUESTED │ │ │ │ ├── INSTALLER │ │ │ │ ├── top_level.txt │ │ │ │ ├── pbr.json │ │ │ │ ├── WHEEL │ │ │ │ └── LICENSE │ │ ├── smart_open │ │ │ └── python │ │ │ │ ├── smart_open-4.1.0.dist-info │ │ │ │ ├── REQUESTED │ │ │ │ ├── INSTALLER │ │ │ │ ├── top_level.txt │ │ │ │ ├── WHEEL │ │ │ │ └── LICENSE │ │ │ │ └── smart_open │ │ │ │ ├── tests │ │ │ │ ├── fixtures │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── good_transport.py │ │ │ │ │ ├── no_schemes_transport.py │ │ │ │ │ └── missing_deps_transport.py │ │ │ │ ├── test_data │ │ │ │ │ ├── 1984.txt.gz │ │ │ │ │ ├── cp852.tsv.txt │ │ │ │ │ ├── crime-and-punishment.txt.gz │ │ │ │ │ ├── crime-and-punishment.txt.xz │ │ │ │ │ ├── crlf_at_1k_boundary.warc.gz │ │ │ │ │ └── crime-and-punishment.txt │ │ │ │ ├── __init__.py │ │ │ │ ├── test_utils.py │ │ │ │ ├── test_transport.py │ │ │ │ ├── test_package.py │ │ │ │ └── test_sanity.py │ │ │ │ ├── version.py │ │ │ │ ├── constants.py │ │ │ │ └── local_file.py │ │ └── sqlparse │ │ │ └── python │ │ │ ├── sqlparse-0.4.1.dist-info │ │ │ ├── REQUESTED │ │ │ ├── INSTALLER │ │ │ ├── top_level.txt │ │ │ ├── entry_points.txt │ │ │ ├── WHEEL │ │ │ └── LICENSE │ │ │ ├── bin │ │ │ └── sqlformat │ │ │ └── sqlparse │ │ │ ├── exceptions.py │ │ │ ├── engine │ │ │ ├── __init__.py │ │ │ └── filter_stack.py │ │ │ ├── __main__.py │ │ │ ├── compat.py │ │ │ └── filters │ │ │ ├── __init__.py │ │ │ ├── right_margin.py │ │ │ └── tokens.py │ ├── s3_content │ │ └── employees.sql.gz │ ├── .gitignore │ ├── cdk.json │ ├── app.py │ ├── source.bat │ ├── setup.py │ └── helper.py ├── .gitignore ├── rdscreds-template.json └── assume-role-policy.json ├── 406-Auto-Scaling-DynamoDB ├── read-policy.json ├── write-policy.json └── README.md ├── README.md ├── .github └── ISSUE_TEMPLATE │ ├── recipe-request.md │ └── bug_report.md └── LICENSE /408-Working-with-Aurora-and-Data-APIs/.gitignore: -------------------------------------------------------------------------------- 1 | policy.json -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/.gitignore: -------------------------------------------------------------------------------- 1 | response.json 2 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/.gitignore: -------------------------------------------------------------------------------- 1 | policy.json 2 | response.json 3 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/.gitignore: -------------------------------------------------------------------------------- 1 | response.json 2 | policy.json 3 | -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | boto3 -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/cdk_aws_cookbook_404/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | boto3 -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/cdk_aws_cookbook_401/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/cdk_aws_cookbook_402/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | boto3 -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/cdk_aws_cookbook_403/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | boto3 -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/cdk_aws_cookbook_405/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | boto3 -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/cdk_aws_cookbook_407/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | boto3 -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/cdk-AWS-Cookbook-408/cdk_aws_cookbook_408/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/cdk-AWS-Cookbook-408/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | boto3 -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/constants/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/constants/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/constants/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/constants/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/REQUESTED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/.gitignore: -------------------------------------------------------------------------------- 1 | rdscreds.json 2 | response.json 3 | lambda_function.py 4 | lambda_function.zip 5 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pymysql 2 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pymysql 2 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | sqlparse 2 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pymysql 2 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | sqlparse 2 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | smart_open 2 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pymysql 2 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | sqlparse 2 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | sqlparse 2 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | smart_open 2 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | smart_open 2 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | smart_open 2 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/pbr.json: -------------------------------------------------------------------------------- 1 | {"is_release": false, "git_version": "08bac52"} -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/pbr.json: -------------------------------------------------------------------------------- 1 | {"is_release": false, "git_version": "08bac52"} -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/pbr.json: -------------------------------------------------------------------------------- 1 | {"is_release": false, "git_version": "08bac52"} -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/lambda_function.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/402-Using-IAM-Authentication-with-RDS/lambda_function.zip -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/pbr.json: -------------------------------------------------------------------------------- 1 | {"is_release": false, "git_version": "08bac52"} -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | sqlformat = sqlparse.__main__:main 3 | 4 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | sqlformat = sqlparse.__main__:main 3 | 4 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | sqlformat = sqlparse.__main__:main 3 | 4 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | sqlformat = sqlparse.__main__:main 3 | 4 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '4.1.0' 2 | 3 | 4 | if __name__ == '__main__': 5 | print(__version__) 6 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '4.1.0' 2 | 3 | 4 | if __name__ == '__main__': 5 | print(__version__) 6 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '4.1.0' 2 | 3 | 4 | if __name__ == '__main__': 5 | print(__version__) 6 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '4.1.0' 2 | 3 | 4 | if __name__ == '__main__': 5 | print(__version__) 6 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/s3_content/employees.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/s3_content/employees.sql.gz -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.35.1) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/s3_content/employees.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/s3_content/employees.sql.gz -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.35.1) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/s3_content/employees.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/s3_content/employees.sql.gz -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.36.2) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.35.1) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/s3_content/employees.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/s3_content/employees.sql.gz -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.35.1) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/s3_content/employees.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/s3_content/employees.sql.gz -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.36.2) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.36.2) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.36.2) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/s3_content/enable_iam_auth.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/s3_content/enable_iam_auth.sql.gz -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.34.2) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.34.2) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.34.2) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.34.2) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/cdk-AWS-Cookbook-408/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /406-Auto-Scaling-DynamoDB/read-policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "PredefinedMetricSpecification": { 3 | "PredefinedMetricType": "DynamoDBReadCapacityUtilization" 4 | }, 5 | "ScaleOutCooldown": 60, 6 | "ScaleInCooldown": 60, 7 | "TargetValue": 50.0 8 | } 9 | -------------------------------------------------------------------------------- /406-Auto-Scaling-DynamoDB/write-policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "PredefinedMetricSpecification": { 3 | "PredefinedMetricType": "DynamoDBWriteCapacityUtilization" 4 | }, 5 | "ScaleOutCooldown": 60, 6 | "ScaleInCooldown": 60, 7 | "TargetValue": 50.0 8 | } 9 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/rdscreds-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "username": "admin", 3 | "password": "PASSWORD", 4 | "engine": "mysql", 5 | "host": "HOST", 6 | "port": 3306, 7 | "dbname": "DBNAME", 8 | "dbInstanceIdentifier": "DBIDENTIFIER" 9 | } -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/1984.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/1984.txt.gz -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/cp852.tsv.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/cp852.tsv.txt -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": false, 5 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false, 6 | "@aws-cdk/core:stackRelativeExports": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/1984.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/1984.txt.gz -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": false, 5 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false, 6 | "@aws-cdk/core:stackRelativeExports": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2019 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/1984.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/1984.txt.gz -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/1984.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/1984.txt.gz -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": false, 5 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false, 6 | "@aws-cdk/core:stackRelativeExports": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": false, 5 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false, 6 | "@aws-cdk/core:stackRelativeExports": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2019 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/cp852.tsv.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/cp852.tsv.txt -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": false, 5 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false, 6 | "@aws-cdk/core:stackRelativeExports": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2019 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/cp852.tsv.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/cp852.tsv.txt -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": false, 5 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false, 6 | "@aws-cdk/core:stackRelativeExports": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2019 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/cp852.tsv.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/cp852.tsv.txt -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/cdk-AWS-Cookbook-408/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": false, 5 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false, 6 | "@aws-cdk/core:stackRelativeExports": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import aws_cdk as cdk 4 | 5 | from cdk_aws_cookbook_401.cdk_aws_cookbook_401_stack import CdkAwsCookbook401Stack 6 | 7 | 8 | app = cdk.App() 9 | CdkAwsCookbook401Stack(app, "cdk-aws-cookbook-401") 10 | 11 | app.synth() 12 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import aws_cdk as cdk 4 | 5 | from cdk_aws_cookbook_404.cdk_aws_cookbook_404_stack import CdkAwsCookbook404Stack 6 | 7 | 8 | app = cdk.App() 9 | CdkAwsCookbook404Stack(app, "cdk-aws-cookbook-404") 10 | 11 | app.synth() 12 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/assume-role-policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Allow", 6 | "Principal": { 7 | "Service": "dms.amazonaws.com" 8 | }, 9 | "Action": "sts:AssumeRole" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import aws_cdk as cdk 4 | 5 | from cdk_aws_cookbook_402.cdk_aws_cookbook_402_stack import CdkAwsCookbook402Stack 6 | 7 | 8 | app = cdk.App() 9 | CdkAwsCookbook402Stack(app, "cdk-aws-cookbook-402") 10 | 11 | app.synth() 12 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import aws_cdk as cdk 4 | 5 | from cdk_aws_cookbook_403.cdk_aws_cookbook_403_stack import CdkAwsCookbook403Stack 6 | 7 | 8 | app = cdk.App() 9 | CdkAwsCookbook403Stack(app, "cdk-aws-cookbook-403") 10 | 11 | app.synth() 12 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import aws_cdk as cdk 4 | 5 | from cdk_aws_cookbook_405.cdk_aws_cookbook_405_stack import CdkAwsCookbook405Stack 6 | 7 | 8 | app = cdk.App() 9 | CdkAwsCookbook405Stack(app, "cdk-aws-cookbook-405") 10 | 11 | app.synth() 12 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import aws_cdk as cdk 4 | 5 | from cdk_aws_cookbook_407.cdk_aws_cookbook_407_stack import CdkAwsCookbook407Stack 6 | 7 | 8 | app = cdk.App() 9 | CdkAwsCookbook407Stack(app, "cdk-aws-cookbook-407") 10 | 11 | app.synth() 12 | -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/cdk-AWS-Cookbook-408/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import aws_cdk as cdk 4 | 5 | from cdk_aws_cookbook_408.cdk_aws_cookbook_408_stack import CdkAwsCookbook408Stack 6 | 7 | 8 | app = cdk.App() 9 | CdkAwsCookbook408Stack(app, "cdk-aws-cookbook-408") 10 | 11 | app.synth() 12 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.gz -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.xz -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/crlf_at_1k_boundary.warc.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/crlf_at_1k_boundary.warc.gz -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.gz -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.xz -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/crlf_at_1k_boundary.warc.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/crlf_at_1k_boundary.warc.gz -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/util.py: -------------------------------------------------------------------------------- 1 | import struct 2 | 3 | 4 | def byte2int(b): 5 | if isinstance(b, int): 6 | return b 7 | else: 8 | return struct.unpack("!B", b)[0] 9 | 10 | 11 | def int2byte(i): 12 | return struct.pack("!B", i) 13 | 14 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.gz -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.xz -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/crlf_at_1k_boundary.warc.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/crlf_at_1k_boundary.warc.gz -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chapter 4 - Databases 2 | ## Set and export your default region: 3 | 4 | `export AWS_REGION=us-east-1` 5 | 6 | ## Set your AWS ACCOUNT ID:: 7 | 8 | `AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)` 9 | 10 | ## Validate AWS Cli Setup and access: 11 | 12 | `aws ec2 describe-instances` 13 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/util.py: -------------------------------------------------------------------------------- 1 | import struct 2 | 3 | 4 | def byte2int(b): 5 | if isinstance(b, int): 6 | return b 7 | else: 8 | return struct.unpack("!B", b)[0] 9 | 10 | 11 | def int2byte(i): 12 | return struct.pack("!B", i) 13 | 14 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/util.py: -------------------------------------------------------------------------------- 1 | import struct 2 | 3 | 4 | def byte2int(b): 5 | if isinstance(b, int): 6 | return b 7 | else: 8 | return struct.unpack("!B", b)[0] 9 | 10 | 11 | def int2byte(i): 12 | return struct.pack("!B", i) 13 | 14 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.gz -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt.xz -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/crlf_at_1k_boundary.warc.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWSCookbook/Databases/HEAD/405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/crlf_at_1k_boundary.warc.gz -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/util.py: -------------------------------------------------------------------------------- 1 | import struct 2 | 3 | 4 | def byte2int(b): 5 | if isinstance(b, int): 6 | return b 7 | else: 8 | return struct.unpack("!B", b)[0] 9 | 10 | 11 | def int2byte(i): 12 | return struct.pack("!B", i) 13 | 14 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/assume-role-policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Allow", 6 | "Principal": { 7 | "Service": "lambda.amazonaws.com" 8 | }, 9 | "Action": "sts:AssumeRole" 10 | } 11 | ] 12 | } 13 | 14 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/assume-role-policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Allow", 6 | "Principal": { 7 | "Service": "rds.amazonaws.com" 8 | }, 9 | "Action": "sts:AssumeRole" 10 | } 11 | ] 12 | } 13 | 14 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/assume-role-policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Allow", 6 | "Principal": { 7 | "Service": "lambda.amazonaws.com" 8 | }, 9 | "Action": "sts:AssumeRole" 10 | } 11 | ] 12 | } 13 | 14 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/constants/FLAG.py: -------------------------------------------------------------------------------- 1 | NOT_NULL = 1 2 | PRI_KEY = 2 3 | UNIQUE_KEY = 4 4 | MULTIPLE_KEY = 8 5 | BLOB = 16 6 | UNSIGNED = 32 7 | ZEROFILL = 64 8 | BINARY = 128 9 | ENUM = 256 10 | AUTO_INCREMENT = 512 11 | TIMESTAMP = 1024 12 | SET = 2048 13 | PART_KEY = 16384 14 | GROUP = 32767 15 | UNIQUE = 65536 16 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/constants/FLAG.py: -------------------------------------------------------------------------------- 1 | NOT_NULL = 1 2 | PRI_KEY = 2 3 | UNIQUE_KEY = 4 4 | MULTIPLE_KEY = 8 5 | BLOB = 16 6 | UNSIGNED = 32 7 | ZEROFILL = 64 8 | BINARY = 128 9 | ENUM = 256 10 | AUTO_INCREMENT = 512 11 | TIMESTAMP = 1024 12 | SET = 2048 13 | PART_KEY = 16384 14 | GROUP = 32767 15 | UNIQUE = 65536 16 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/constants/FLAG.py: -------------------------------------------------------------------------------- 1 | NOT_NULL = 1 2 | PRI_KEY = 2 3 | UNIQUE_KEY = 4 4 | MULTIPLE_KEY = 8 5 | BLOB = 16 6 | UNSIGNED = 32 7 | ZEROFILL = 64 8 | BINARY = 128 9 | ENUM = 256 10 | AUTO_INCREMENT = 512 11 | TIMESTAMP = 1024 12 | SET = 2048 13 | PART_KEY = 16384 14 | GROUP = 32767 15 | UNIQUE = 65536 16 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/constants/FLAG.py: -------------------------------------------------------------------------------- 1 | NOT_NULL = 1 2 | PRI_KEY = 2 3 | UNIQUE_KEY = 4 4 | MULTIPLE_KEY = 8 5 | BLOB = 16 6 | UNSIGNED = 32 7 | ZEROFILL = 64 8 | BINARY = 128 9 | ENUM = 256 10 | AUTO_INCREMENT = 512 11 | TIMESTAMP = 1024 12 | SET = 2048 13 | PART_KEY = 16384 14 | GROUP = 32767 15 | UNIQUE = 65536 16 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/policy-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Allow", 6 | "Action": [ 7 | "rds-db:connect" 8 | ], 9 | "Resource": [ 10 | "arn:aws:rds-db:AWS_REGION:AWS_ACCOUNT_ID:dbuser:RDSProxyID/*" 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/policy-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Allow", 6 | "Action": [ 7 | "rds-db:connect" 8 | ], 9 | "Resource": [ 10 | "arn:aws:rds-db:AWS_REGION:AWS_ACCOUNT_ID:dbuser:DBResourceId/db_user" 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/table-mapping-all.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": [ 3 | { 4 | "rule-type": "selection", 5 | "rule-id": "1", 6 | "rule-name": "1", 7 | "object-locator": { 8 | "schema-name": "Employees", 9 | "table-name": "%" 10 | }, 11 | "rule-action": "include" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/table-mapping-single-table.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": [ 3 | { 4 | "rule-type": "selection", 5 | "rule-id": "1", 6 | "rule-name": "1", 7 | "object-locator": { 8 | "schema-name": "Employees", 9 | "table-name": "departments" 10 | }, 11 | "rule-action": "include" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/fixtures/good_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """A no-op transport that registers scheme 'foo'""" 3 | import io 4 | 5 | SCHEME = "foo" 6 | open = io.open 7 | 8 | 9 | def parse_uri(uri_as_string): # pragma: no cover 10 | ... 11 | 12 | 13 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 14 | ... 15 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/bin/sqlformat: -------------------------------------------------------------------------------- 1 | #!/Users/johnculkin/repos/AWSCookbook/Chapter1/102-Using-IAM-Authentication-with-a-RDS-Database/cdk-AWS-Cookbook-102/.env/bin/python 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from sqlparse.__main__ import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/fixtures/good_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """A no-op transport that registers scheme 'foo'""" 3 | import io 4 | 5 | SCHEME = "foo" 6 | open = io.open 7 | 8 | 9 | def parse_uri(uri_as_string): # pragma: no cover 10 | ... 11 | 12 | 13 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 14 | ... 15 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/bin/sqlformat: -------------------------------------------------------------------------------- 1 | #!/Users/johnculkin/repos/AWSCookbook/Chapter1/102-Using-IAM-Authentication-with-a-RDS-Database/cdk-AWS-Cookbook-102/.env/bin/python 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from sqlparse.__main__ import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/fixtures/good_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """A no-op transport that registers scheme 'foo'""" 3 | import io 4 | 5 | SCHEME = "foo" 6 | open = io.open 7 | 8 | 9 | def parse_uri(uri_as_string): # pragma: no cover 10 | ... 11 | 12 | 13 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 14 | ... 15 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/bin/sqlformat: -------------------------------------------------------------------------------- 1 | #!/Users/johnculkin/repos/AWSCookbook/Chapter1/102-Using-IAM-Authentication-with-a-RDS-Database/cdk-AWS-Cookbook-102/.env/bin/python 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from sqlparse.__main__ import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/fixtures/good_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """A no-op transport that registers scheme 'foo'""" 3 | import io 4 | 5 | SCHEME = "foo" 6 | open = io.open 7 | 8 | 9 | def parse_uri(uri_as_string): # pragma: no cover 10 | ... 11 | 12 | 13 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 14 | ... 15 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/bin/sqlformat: -------------------------------------------------------------------------------- 1 | #!/Users/johnculkin/repos/AWSCookbook/Chapter1/102-Using-IAM-Authentication-with-a-RDS-Database/cdk-AWS-Cookbook-102/.env/bin/python 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from sqlparse.__main__ import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/fixtures/no_schemes_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """A transport that is missing the required SCHEME/SCHEMAS attributes""" 3 | import io 4 | 5 | open = io.open 6 | 7 | 8 | def parse_uri(uri_as_string): # pragma: no cover 9 | ... 10 | 11 | 12 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 13 | ... 14 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/fixtures/no_schemes_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """A transport that is missing the required SCHEME/SCHEMAS attributes""" 3 | import io 4 | 5 | open = io.open 6 | 7 | 8 | def parse_uri(uri_as_string): # pragma: no cover 9 | ... 10 | 11 | 12 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 13 | ... 14 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/fixtures/no_schemes_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """A transport that is missing the required SCHEME/SCHEMAS attributes""" 3 | import io 4 | 5 | open = io.open 6 | 7 | 8 | def parse_uri(uri_as_string): # pragma: no cover 9 | ... 10 | 11 | 12 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 13 | ... 14 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/fixtures/no_schemes_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """A transport that is missing the required SCHEME/SCHEMAS attributes""" 3 | import io 4 | 5 | open = io.open 6 | 7 | 8 | def parse_uri(uri_as_string): # pragma: no cover 9 | ... 10 | 11 | 12 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 13 | ... 14 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/constants/SERVER_STATUS.py: -------------------------------------------------------------------------------- 1 | 2 | SERVER_STATUS_IN_TRANS = 1 3 | SERVER_STATUS_AUTOCOMMIT = 2 4 | SERVER_MORE_RESULTS_EXISTS = 8 5 | SERVER_QUERY_NO_GOOD_INDEX_USED = 16 6 | SERVER_QUERY_NO_INDEX_USED = 32 7 | SERVER_STATUS_CURSOR_EXISTS = 64 8 | SERVER_STATUS_LAST_ROW_SENT = 128 9 | SERVER_STATUS_DB_DROPPED = 256 10 | SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512 11 | SERVER_STATUS_METADATA_CHANGED = 1024 12 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/constants/SERVER_STATUS.py: -------------------------------------------------------------------------------- 1 | 2 | SERVER_STATUS_IN_TRANS = 1 3 | SERVER_STATUS_AUTOCOMMIT = 2 4 | SERVER_MORE_RESULTS_EXISTS = 8 5 | SERVER_QUERY_NO_GOOD_INDEX_USED = 16 6 | SERVER_QUERY_NO_INDEX_USED = 32 7 | SERVER_STATUS_CURSOR_EXISTS = 64 8 | SERVER_STATUS_LAST_ROW_SENT = 128 9 | SERVER_STATUS_DB_DROPPED = 256 10 | SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512 11 | SERVER_STATUS_METADATA_CHANGED = 1024 12 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse/exceptions.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | """Exceptions used in this package.""" 9 | 10 | 11 | class SQLParseError(Exception): 12 | """Base class for exceptions in this module.""" 13 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/constants/SERVER_STATUS.py: -------------------------------------------------------------------------------- 1 | 2 | SERVER_STATUS_IN_TRANS = 1 3 | SERVER_STATUS_AUTOCOMMIT = 2 4 | SERVER_MORE_RESULTS_EXISTS = 8 5 | SERVER_QUERY_NO_GOOD_INDEX_USED = 16 6 | SERVER_QUERY_NO_INDEX_USED = 32 7 | SERVER_STATUS_CURSOR_EXISTS = 64 8 | SERVER_STATUS_LAST_ROW_SENT = 128 9 | SERVER_STATUS_DB_DROPPED = 256 10 | SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512 11 | SERVER_STATUS_METADATA_CHANGED = 1024 12 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/constants/SERVER_STATUS.py: -------------------------------------------------------------------------------- 1 | 2 | SERVER_STATUS_IN_TRANS = 1 3 | SERVER_STATUS_AUTOCOMMIT = 2 4 | SERVER_MORE_RESULTS_EXISTS = 8 5 | SERVER_QUERY_NO_GOOD_INDEX_USED = 16 6 | SERVER_QUERY_NO_INDEX_USED = 32 7 | SERVER_STATUS_CURSOR_EXISTS = 64 8 | SERVER_STATUS_LAST_ROW_SENT = 128 9 | SERVER_STATUS_DB_DROPPED = 256 10 | SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512 11 | SERVER_STATUS_METADATA_CHANGED = 1024 12 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse/exceptions.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | """Exceptions used in this package.""" 9 | 10 | 11 | class SQLParseError(Exception): 12 | """Base class for exceptions in this module.""" 13 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse/exceptions.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | """Exceptions used in this package.""" 9 | 10 | 11 | class SQLParseError(Exception): 12 | """Base class for exceptions in this module.""" 13 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse/exceptions.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | """Exceptions used in this package.""" 9 | 10 | 11 | class SQLParseError(Exception): 12 | """Base class for exceptions in this module.""" 13 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/times.py: -------------------------------------------------------------------------------- 1 | from time import localtime 2 | from datetime import date, datetime, time, timedelta 3 | 4 | 5 | Date = date 6 | Time = time 7 | TimeDelta = timedelta 8 | Timestamp = datetime 9 | 10 | 11 | def DateFromTicks(ticks): 12 | return date(*localtime(ticks)[:3]) 13 | 14 | 15 | def TimeFromTicks(ticks): 16 | return time(*localtime(ticks)[3:6]) 17 | 18 | 19 | def TimestampFromTicks(ticks): 20 | return datetime(*localtime(ticks)[:6]) 21 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/times.py: -------------------------------------------------------------------------------- 1 | from time import localtime 2 | from datetime import date, datetime, time, timedelta 3 | 4 | 5 | Date = date 6 | Time = time 7 | TimeDelta = timedelta 8 | Timestamp = datetime 9 | 10 | 11 | def DateFromTicks(ticks): 12 | return date(*localtime(ticks)[:3]) 13 | 14 | 15 | def TimeFromTicks(ticks): 16 | return time(*localtime(ticks)[3:6]) 17 | 18 | 19 | def TimestampFromTicks(ticks): 20 | return datetime(*localtime(ticks)[:6]) 21 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/times.py: -------------------------------------------------------------------------------- 1 | from time import localtime 2 | from datetime import date, datetime, time, timedelta 3 | 4 | 5 | Date = date 6 | Time = time 7 | TimeDelta = timedelta 8 | Timestamp = datetime 9 | 10 | 11 | def DateFromTicks(ticks): 12 | return date(*localtime(ticks)[:3]) 13 | 14 | 15 | def TimeFromTicks(ticks): 16 | return time(*localtime(ticks)[3:6]) 17 | 18 | 19 | def TimestampFromTicks(ticks): 20 | return datetime(*localtime(ticks)[:6]) 21 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/times.py: -------------------------------------------------------------------------------- 1 | from time import localtime 2 | from datetime import date, datetime, time, timedelta 3 | 4 | 5 | Date = date 6 | Time = time 7 | TimeDelta = timedelta 8 | Timestamp = datetime 9 | 10 | 11 | def DateFromTicks(ticks): 12 | return date(*localtime(ticks)[:3]) 13 | 14 | 15 | def TimeFromTicks(ticks): 16 | return time(*localtime(ticks)[3:6]) 17 | 18 | 19 | def TimestampFromTicks(ticks): 20 | return datetime(*localtime(ticks)[:6]) 21 | -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/cdk-AWS-Cookbook-408/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/fixtures/missing_deps_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Transport that has missing deps""" 3 | import io 4 | 5 | 6 | try: 7 | import this_module_does_not_exist_but_we_need_it # noqa 8 | except ImportError: 9 | MISSING_DEPS = True 10 | 11 | SCHEME = "missing" 12 | open = io.open 13 | 14 | 15 | def parse_uri(uri_as_string): # pragma: no cover 16 | ... 17 | 18 | 19 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 20 | ... 21 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/fixtures/missing_deps_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Transport that has missing deps""" 3 | import io 4 | 5 | 6 | try: 7 | import this_module_does_not_exist_but_we_need_it # noqa 8 | except ImportError: 9 | MISSING_DEPS = True 10 | 11 | SCHEME = "missing" 12 | open = io.open 13 | 14 | 15 | def parse_uri(uri_as_string): # pragma: no cover 16 | ... 17 | 18 | 19 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 20 | ... 21 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/fixtures/missing_deps_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Transport that has missing deps""" 3 | import io 4 | 5 | 6 | try: 7 | import this_module_does_not_exist_but_we_need_it # noqa 8 | except ImportError: 9 | MISSING_DEPS = True 10 | 11 | SCHEME = "missing" 12 | open = io.open 13 | 14 | 15 | def parse_uri(uri_as_string): # pragma: no cover 16 | ... 17 | 18 | 19 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 20 | ... 21 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/fixtures/missing_deps_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Transport that has missing deps""" 3 | import io 4 | 5 | 6 | try: 7 | import this_module_does_not_exist_but_we_need_it # noqa 8 | except ImportError: 9 | MISSING_DEPS = True 10 | 11 | SCHEME = "missing" 12 | open = io.open 13 | 14 | 15 | def parse_uri(uri_as_string): # pragma: no cover 16 | ... 17 | 18 | 19 | def open_uri(uri_as_string, mode, transport_params): # pragma: no cover 20 | ... 21 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse.engine import grouping 9 | from sqlparse.engine.filter_stack import FilterStack 10 | from sqlparse.engine.statement_splitter import StatementSplitter 11 | 12 | __all__ = [ 13 | 'grouping', 14 | 'FilterStack', 15 | 'StatementSplitter', 16 | ] 17 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse.engine import grouping 9 | from sqlparse.engine.filter_stack import FilterStack 10 | from sqlparse.engine.statement_splitter import StatementSplitter 11 | 12 | __all__ = [ 13 | 'grouping', 14 | 'FilterStack', 15 | 'StatementSplitter', 16 | ] 17 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse.engine import grouping 9 | from sqlparse.engine.filter_stack import FilterStack 10 | from sqlparse.engine.statement_splitter import StatementSplitter 11 | 12 | __all__ = [ 13 | 'grouping', 14 | 'FilterStack', 15 | 'StatementSplitter', 16 | ] 17 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse.engine import grouping 9 | from sqlparse.engine.filter_stack import FilterStack 10 | from sqlparse.engine.statement_splitter import StatementSplitter 11 | 12 | __all__ = [ 13 | 'grouping', 14 | 'FilterStack', 15 | 'StatementSplitter', 16 | ] 17 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/constants/FIELD_TYPE.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | DECIMAL = 0 4 | TINY = 1 5 | SHORT = 2 6 | LONG = 3 7 | FLOAT = 4 8 | DOUBLE = 5 9 | NULL = 6 10 | TIMESTAMP = 7 11 | LONGLONG = 8 12 | INT24 = 9 13 | DATE = 10 14 | TIME = 11 15 | DATETIME = 12 16 | YEAR = 13 17 | NEWDATE = 14 18 | VARCHAR = 15 19 | BIT = 16 20 | JSON = 245 21 | NEWDECIMAL = 246 22 | ENUM = 247 23 | SET = 248 24 | TINY_BLOB = 249 25 | MEDIUM_BLOB = 250 26 | LONG_BLOB = 251 27 | BLOB = 252 28 | VAR_STRING = 253 29 | STRING = 254 30 | GEOMETRY = 255 31 | 32 | CHAR = TINY 33 | INTERVAL = ENUM 34 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/constants/FIELD_TYPE.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | DECIMAL = 0 4 | TINY = 1 5 | SHORT = 2 6 | LONG = 3 7 | FLOAT = 4 8 | DOUBLE = 5 9 | NULL = 6 10 | TIMESTAMP = 7 11 | LONGLONG = 8 12 | INT24 = 9 13 | DATE = 10 14 | TIME = 11 15 | DATETIME = 12 16 | YEAR = 13 17 | NEWDATE = 14 18 | VARCHAR = 15 19 | BIT = 16 20 | JSON = 245 21 | NEWDECIMAL = 246 22 | ENUM = 247 23 | SET = 248 24 | TINY_BLOB = 249 25 | MEDIUM_BLOB = 250 26 | LONG_BLOB = 251 27 | BLOB = 252 28 | VAR_STRING = 253 29 | STRING = 254 30 | GEOMETRY = 255 31 | 32 | CHAR = TINY 33 | INTERVAL = ENUM 34 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/constants/FIELD_TYPE.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | DECIMAL = 0 4 | TINY = 1 5 | SHORT = 2 6 | LONG = 3 7 | FLOAT = 4 8 | DOUBLE = 5 9 | NULL = 6 10 | TIMESTAMP = 7 11 | LONGLONG = 8 12 | INT24 = 9 13 | DATE = 10 14 | TIME = 11 15 | DATETIME = 12 16 | YEAR = 13 17 | NEWDATE = 14 18 | VARCHAR = 15 19 | BIT = 16 20 | JSON = 245 21 | NEWDECIMAL = 246 22 | ENUM = 247 23 | SET = 248 24 | TINY_BLOB = 249 25 | MEDIUM_BLOB = 250 26 | LONG_BLOB = 251 27 | BLOB = 252 28 | VAR_STRING = 253 29 | STRING = 254 30 | GEOMETRY = 255 31 | 32 | CHAR = TINY 33 | INTERVAL = ENUM 34 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/constants/FIELD_TYPE.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | DECIMAL = 0 4 | TINY = 1 5 | SHORT = 2 6 | LONG = 3 7 | FLOAT = 4 8 | DOUBLE = 5 9 | NULL = 6 10 | TIMESTAMP = 7 11 | LONGLONG = 8 12 | INT24 = 9 13 | DATE = 10 14 | TIME = 11 15 | DATETIME = 12 16 | YEAR = 13 17 | NEWDATE = 14 18 | VARCHAR = 15 19 | BIT = 16 20 | JSON = 245 21 | NEWDECIMAL = 246 22 | ENUM = 247 23 | SET = 248 24 | TINY_BLOB = 249 25 | MEDIUM_BLOB = 250 26 | LONG_BLOB = 251 27 | BLOB = 252 28 | VAR_STRING = 253 29 | STRING = 254 30 | GEOMETRY = 255 31 | 32 | CHAR = TINY 33 | INTERVAL = ENUM 34 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/_compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | PY2 = sys.version_info[0] == 2 4 | PYPY = hasattr(sys, 'pypy_translation_info') 5 | JYTHON = sys.platform.startswith('java') 6 | IRONPYTHON = sys.platform == 'cli' 7 | CPYTHON = not PYPY and not JYTHON and not IRONPYTHON 8 | 9 | if PY2: 10 | import __builtin__ 11 | range_type = xrange 12 | text_type = unicode 13 | long_type = long 14 | str_type = basestring 15 | unichr = __builtin__.unichr 16 | else: 17 | range_type = range 18 | text_type = str 19 | long_type = int 20 | str_type = str 21 | unichr = chr 22 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/_compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | PY2 = sys.version_info[0] == 2 4 | PYPY = hasattr(sys, 'pypy_translation_info') 5 | JYTHON = sys.platform.startswith('java') 6 | IRONPYTHON = sys.platform == 'cli' 7 | CPYTHON = not PYPY and not JYTHON and not IRONPYTHON 8 | 9 | if PY2: 10 | import __builtin__ 11 | range_type = xrange 12 | text_type = unicode 13 | long_type = long 14 | str_type = basestring 15 | unichr = __builtin__.unichr 16 | else: 17 | range_type = range 18 | text_type = str 19 | long_type = int 20 | str_type = str 21 | unichr = chr 22 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/_compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | PY2 = sys.version_info[0] == 2 4 | PYPY = hasattr(sys, 'pypy_translation_info') 5 | JYTHON = sys.platform.startswith('java') 6 | IRONPYTHON = sys.platform == 'cli' 7 | CPYTHON = not PYPY and not JYTHON and not IRONPYTHON 8 | 9 | if PY2: 10 | import __builtin__ 11 | range_type = xrange 12 | text_type = unicode 13 | long_type = long 14 | str_type = basestring 15 | unichr = __builtin__.unichr 16 | else: 17 | range_type = range 18 | text_type = str 19 | long_type = int 20 | str_type = str 21 | unichr = chr 22 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/_compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | PY2 = sys.version_info[0] == 2 4 | PYPY = hasattr(sys, 'pypy_translation_info') 5 | JYTHON = sys.platform.startswith('java') 6 | IRONPYTHON = sys.platform == 'cli' 7 | CPYTHON = not PYPY and not JYTHON and not IRONPYTHON 8 | 9 | if PY2: 10 | import __builtin__ 11 | range_type = xrange 12 | text_type = unicode 13 | long_type = long 14 | str_type = basestring 15 | unichr = __builtin__.unichr 16 | else: 17 | range_type = range 18 | text_type = str 19 | long_type = int 20 | str_type = str 21 | unichr = chr 22 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2020 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | 9 | """Some universal constants that are common to I/O operations.""" 10 | 11 | 12 | READ_BINARY = 'rb' 13 | 14 | WRITE_BINARY = 'wb' 15 | 16 | BINARY_MODES = (READ_BINARY, WRITE_BINARY) 17 | 18 | BINARY_NEWLINE = b'\n' 19 | 20 | WHENCE_START = 0 21 | 22 | WHENCE_CURRENT = 1 23 | 24 | WHENCE_END = 2 25 | 26 | WHENCE_CHOICES = (WHENCE_START, WHENCE_CURRENT, WHENCE_END) 27 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2020 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | 9 | """Some universal constants that are common to I/O operations.""" 10 | 11 | 12 | READ_BINARY = 'rb' 13 | 14 | WRITE_BINARY = 'wb' 15 | 16 | BINARY_MODES = (READ_BINARY, WRITE_BINARY) 17 | 18 | BINARY_NEWLINE = b'\n' 19 | 20 | WHENCE_START = 0 21 | 22 | WHENCE_CURRENT = 1 23 | 24 | WHENCE_END = 2 25 | 26 | WHENCE_CHOICES = (WHENCE_START, WHENCE_CURRENT, WHENCE_END) 27 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2020 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | 9 | """Some universal constants that are common to I/O operations.""" 10 | 11 | 12 | READ_BINARY = 'rb' 13 | 14 | WRITE_BINARY = 'wb' 15 | 16 | BINARY_MODES = (READ_BINARY, WRITE_BINARY) 17 | 18 | BINARY_NEWLINE = b'\n' 19 | 20 | WHENCE_START = 0 21 | 22 | WHENCE_CURRENT = 1 23 | 24 | WHENCE_END = 2 25 | 26 | WHENCE_CHOICES = (WHENCE_START, WHENCE_CURRENT, WHENCE_END) 27 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2020 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | 9 | """Some universal constants that are common to I/O operations.""" 10 | 11 | 12 | READ_BINARY = 'rb' 13 | 14 | WRITE_BINARY = 'wb' 15 | 16 | BINARY_MODES = (READ_BINARY, WRITE_BINARY) 17 | 18 | BINARY_NEWLINE = b'\n' 19 | 20 | WHENCE_START = 0 21 | 22 | WHENCE_CURRENT = 1 23 | 24 | WHENCE_END = 2 25 | 26 | WHENCE_CHOICES = (WHENCE_START, WHENCE_CURRENT, WHENCE_END) 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/recipe-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Recipe request 3 | about: Suggest a recipe for this Chapter 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your recipe request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe what you'd like to learn** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2019 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | 9 | import unittest 10 | 11 | import smart_open.utils 12 | 13 | 14 | class ClampTest(unittest.TestCase): 15 | def test_low(self): 16 | self.assertEqual(smart_open.utils.clamp(5, 0, 10), 5) 17 | 18 | def test_high(self): 19 | self.assertEqual(smart_open.utils.clamp(11, 0, 10), 10) 20 | 21 | def test_out_of_range(self): 22 | self.assertEqual(smart_open.utils.clamp(-1, 0, 10), 0) 23 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2019 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | 9 | import unittest 10 | 11 | import smart_open.utils 12 | 13 | 14 | class ClampTest(unittest.TestCase): 15 | def test_low(self): 16 | self.assertEqual(smart_open.utils.clamp(5, 0, 10), 5) 17 | 18 | def test_high(self): 19 | self.assertEqual(smart_open.utils.clamp(11, 0, 10), 10) 20 | 21 | def test_out_of_range(self): 22 | self.assertEqual(smart_open.utils.clamp(-1, 0, 10), 0) 23 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2019 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | 9 | import unittest 10 | 11 | import smart_open.utils 12 | 13 | 14 | class ClampTest(unittest.TestCase): 15 | def test_low(self): 16 | self.assertEqual(smart_open.utils.clamp(5, 0, 10), 5) 17 | 18 | def test_high(self): 19 | self.assertEqual(smart_open.utils.clamp(11, 0, 10), 10) 20 | 21 | def test_out_of_range(self): 22 | self.assertEqual(smart_open.utils.clamp(-1, 0, 10), 0) 23 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2019 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | 9 | import unittest 10 | 11 | import smart_open.utils 12 | 13 | 14 | class ClampTest(unittest.TestCase): 15 | def test_low(self): 16 | self.assertEqual(smart_open.utils.clamp(5, 0, 10), 5) 17 | 18 | def test_high(self): 19 | self.assertEqual(smart_open.utils.clamp(11, 0, 10), 10) 20 | 21 | def test_out_of_range(self): 22 | self.assertEqual(smart_open.utils.clamp(-1, 0, 10), 0) 23 | -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/policy-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Action": [ 6 | "rds-data:BatchExecuteStatement", 7 | "rds-data:BeginTransaction", 8 | "rds-data:CommitTransaction", 9 | "rds-data:ExecuteStatement", 10 | "rds-data:RollbackTransaction" 11 | ], 12 | "Resource": "*", 13 | "Effect": "Allow" 14 | }, 15 | { 16 | "Action": [ 17 | "secretsmanager:GetSecretValue", 18 | "secretsmanager:DescribeSecret" 19 | ], 20 | "Resource": "SecretArn", 21 | "Effect": "Allow" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 4 | # 5 | # 6 | # This module is part of python-sqlparse and is released under 7 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 8 | 9 | """Entrypoint module for `python -m sqlparse`. 10 | 11 | Why does this file exist, and why __main__? For more info, read: 12 | - https://www.python.org/dev/peps/pep-0338/ 13 | - https://docs.python.org/2/using/cmdline.html#cmdoption-m 14 | - https://docs.python.org/3/using/cmdline.html#cmdoption-m 15 | """ 16 | 17 | import sys 18 | 19 | from sqlparse.cli import main 20 | 21 | if __name__ == '__main__': 22 | sys.exit(main()) 23 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 4 | # 5 | # 6 | # This module is part of python-sqlparse and is released under 7 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 8 | 9 | """Entrypoint module for `python -m sqlparse`. 10 | 11 | Why does this file exist, and why __main__? For more info, read: 12 | - https://www.python.org/dev/peps/pep-0338/ 13 | - https://docs.python.org/2/using/cmdline.html#cmdoption-m 14 | - https://docs.python.org/3/using/cmdline.html#cmdoption-m 15 | """ 16 | 17 | import sys 18 | 19 | from sqlparse.cli import main 20 | 21 | if __name__ == '__main__': 22 | sys.exit(main()) 23 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 4 | # 5 | # 6 | # This module is part of python-sqlparse and is released under 7 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 8 | 9 | """Entrypoint module for `python -m sqlparse`. 10 | 11 | Why does this file exist, and why __main__? For more info, read: 12 | - https://www.python.org/dev/peps/pep-0338/ 13 | - https://docs.python.org/2/using/cmdline.html#cmdoption-m 14 | - https://docs.python.org/3/using/cmdline.html#cmdoption-m 15 | """ 16 | 17 | import sys 18 | 19 | from sqlparse.cli import main 20 | 21 | if __name__ == '__main__': 22 | sys.exit(main()) 23 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 4 | # 5 | # 6 | # This module is part of python-sqlparse and is released under 7 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 8 | 9 | """Entrypoint module for `python -m sqlparse`. 10 | 11 | Why does this file exist, and why __main__? For more info, read: 12 | - https://www.python.org/dev/peps/pep-0338/ 13 | - https://docs.python.org/2/using/cmdline.html#cmdoption-m 14 | - https://docs.python.org/3/using/cmdline.html#cmdoption-m 15 | """ 16 | 17 | import sys 18 | 19 | from sqlparse.cli import main 20 | 21 | if __name__ == '__main__': 22 | sys.exit(main()) 23 | -------------------------------------------------------------------------------- /406-Auto-Scaling-DynamoDB/README.md: -------------------------------------------------------------------------------- 1 | # Auto Scaling DynamoDB Table Provisioned Capacity 2 | ## Preparation 3 | 4 | ### Create a DynamoDB table with fixed capacity of 1 Read Capacity Units and 1 Write Capacity Units: 5 | ``` 6 | aws dynamodb create-table \ 7 | --table-name 'AWSCookbook406' \ 8 | --attribute-definitions 'AttributeName=UserID,AttributeType=S' \ 9 | --key-schema 'AttributeName=UserID,KeyType=HASH' \ 10 | --sse-specification 'Enabled=true,SSEType=KMS' \ 11 | --provisioned-throughput \ 12 | 'ReadCapacityUnits=1,WriteCapacityUnits=1' 13 | ``` 14 | 15 | ### Put a few records in the table: 16 | 17 | `aws ddb put AWSCookbook406 '[{UserID: value1}, {UserID: value2}]'` 18 | 19 | 20 | ## Clean up 21 | ### Delete the DynamoDB table: 22 | ``` 23 | aws dynamodb delete-table \ 24 | --table-name 'AWSCookbook406' 25 | ``` 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/optionfile.py: -------------------------------------------------------------------------------- 1 | from ._compat import PY2 2 | 3 | if PY2: 4 | import ConfigParser as configparser 5 | else: 6 | import configparser 7 | 8 | 9 | class Parser(configparser.RawConfigParser): 10 | def __init__(self, **kwargs): 11 | kwargs['allow_no_value'] = True 12 | configparser.RawConfigParser.__init__(self, **kwargs) 13 | 14 | def __remove_quotes(self, value): 15 | quotes = ["'", "\""] 16 | for quote in quotes: 17 | if len(value) >= 2 and value[0] == value[-1] == quote: 18 | return value[1:-1] 19 | return value 20 | 21 | def get(self, section, option): 22 | value = configparser.RawConfigParser.get(self, section, option) 23 | return self.__remove_quotes(value) 24 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/optionfile.py: -------------------------------------------------------------------------------- 1 | from ._compat import PY2 2 | 3 | if PY2: 4 | import ConfigParser as configparser 5 | else: 6 | import configparser 7 | 8 | 9 | class Parser(configparser.RawConfigParser): 10 | def __init__(self, **kwargs): 11 | kwargs['allow_no_value'] = True 12 | configparser.RawConfigParser.__init__(self, **kwargs) 13 | 14 | def __remove_quotes(self, value): 15 | quotes = ["'", "\""] 16 | for quote in quotes: 17 | if len(value) >= 2 and value[0] == value[-1] == quote: 18 | return value[1:-1] 19 | return value 20 | 21 | def get(self, section, option): 22 | value = configparser.RawConfigParser.get(self, section, option) 23 | return self.__remove_quotes(value) 24 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/optionfile.py: -------------------------------------------------------------------------------- 1 | from ._compat import PY2 2 | 3 | if PY2: 4 | import ConfigParser as configparser 5 | else: 6 | import configparser 7 | 8 | 9 | class Parser(configparser.RawConfigParser): 10 | def __init__(self, **kwargs): 11 | kwargs['allow_no_value'] = True 12 | configparser.RawConfigParser.__init__(self, **kwargs) 13 | 14 | def __remove_quotes(self, value): 15 | quotes = ["'", "\""] 16 | for quote in quotes: 17 | if len(value) >= 2 and value[0] == value[-1] == quote: 18 | return value[1:-1] 19 | return value 20 | 21 | def get(self, section, option): 22 | value = configparser.RawConfigParser.get(self, section, option) 23 | return self.__remove_quotes(value) 24 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/optionfile.py: -------------------------------------------------------------------------------- 1 | from ._compat import PY2 2 | 3 | if PY2: 4 | import ConfigParser as configparser 5 | else: 6 | import configparser 7 | 8 | 9 | class Parser(configparser.RawConfigParser): 10 | def __init__(self, **kwargs): 11 | kwargs['allow_no_value'] = True 12 | configparser.RawConfigParser.__init__(self, **kwargs) 13 | 14 | def __remove_quotes(self, value): 15 | quotes = ["'", "\""] 16 | for quote in quotes: 17 | if len(value) >= 2 and value[0] == value[-1] == quote: 18 | return value[1:-1] 19 | return value 20 | 21 | def get(self, section, option): 22 | value = configparser.RawConfigParser.get(self, section, option) 23 | return self.__remove_quotes(value) 24 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/constants/COMMAND.py: -------------------------------------------------------------------------------- 1 | 2 | COM_SLEEP = 0x00 3 | COM_QUIT = 0x01 4 | COM_INIT_DB = 0x02 5 | COM_QUERY = 0x03 6 | COM_FIELD_LIST = 0x04 7 | COM_CREATE_DB = 0x05 8 | COM_DROP_DB = 0x06 9 | COM_REFRESH = 0x07 10 | COM_SHUTDOWN = 0x08 11 | COM_STATISTICS = 0x09 12 | COM_PROCESS_INFO = 0x0a 13 | COM_CONNECT = 0x0b 14 | COM_PROCESS_KILL = 0x0c 15 | COM_DEBUG = 0x0d 16 | COM_PING = 0x0e 17 | COM_TIME = 0x0f 18 | COM_DELAYED_INSERT = 0x10 19 | COM_CHANGE_USER = 0x11 20 | COM_BINLOG_DUMP = 0x12 21 | COM_TABLE_DUMP = 0x13 22 | COM_CONNECT_OUT = 0x14 23 | COM_REGISTER_SLAVE = 0x15 24 | COM_STMT_PREPARE = 0x16 25 | COM_STMT_EXECUTE = 0x17 26 | COM_STMT_SEND_LONG_DATA = 0x18 27 | COM_STMT_CLOSE = 0x19 28 | COM_STMT_RESET = 0x1a 29 | COM_SET_OPTION = 0x1b 30 | COM_STMT_FETCH = 0x1c 31 | COM_DAEMON = 0x1d 32 | COM_BINLOG_DUMP_GTID = 0x1e 33 | COM_END = 0x1f 34 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/constants/COMMAND.py: -------------------------------------------------------------------------------- 1 | 2 | COM_SLEEP = 0x00 3 | COM_QUIT = 0x01 4 | COM_INIT_DB = 0x02 5 | COM_QUERY = 0x03 6 | COM_FIELD_LIST = 0x04 7 | COM_CREATE_DB = 0x05 8 | COM_DROP_DB = 0x06 9 | COM_REFRESH = 0x07 10 | COM_SHUTDOWN = 0x08 11 | COM_STATISTICS = 0x09 12 | COM_PROCESS_INFO = 0x0a 13 | COM_CONNECT = 0x0b 14 | COM_PROCESS_KILL = 0x0c 15 | COM_DEBUG = 0x0d 16 | COM_PING = 0x0e 17 | COM_TIME = 0x0f 18 | COM_DELAYED_INSERT = 0x10 19 | COM_CHANGE_USER = 0x11 20 | COM_BINLOG_DUMP = 0x12 21 | COM_TABLE_DUMP = 0x13 22 | COM_CONNECT_OUT = 0x14 23 | COM_REGISTER_SLAVE = 0x15 24 | COM_STMT_PREPARE = 0x16 25 | COM_STMT_EXECUTE = 0x17 26 | COM_STMT_SEND_LONG_DATA = 0x18 27 | COM_STMT_CLOSE = 0x19 28 | COM_STMT_RESET = 0x1a 29 | COM_SET_OPTION = 0x1b 30 | COM_STMT_FETCH = 0x1c 31 | COM_DAEMON = 0x1d 32 | COM_BINLOG_DUMP_GTID = 0x1e 33 | COM_END = 0x1f 34 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/constants/COMMAND.py: -------------------------------------------------------------------------------- 1 | 2 | COM_SLEEP = 0x00 3 | COM_QUIT = 0x01 4 | COM_INIT_DB = 0x02 5 | COM_QUERY = 0x03 6 | COM_FIELD_LIST = 0x04 7 | COM_CREATE_DB = 0x05 8 | COM_DROP_DB = 0x06 9 | COM_REFRESH = 0x07 10 | COM_SHUTDOWN = 0x08 11 | COM_STATISTICS = 0x09 12 | COM_PROCESS_INFO = 0x0a 13 | COM_CONNECT = 0x0b 14 | COM_PROCESS_KILL = 0x0c 15 | COM_DEBUG = 0x0d 16 | COM_PING = 0x0e 17 | COM_TIME = 0x0f 18 | COM_DELAYED_INSERT = 0x10 19 | COM_CHANGE_USER = 0x11 20 | COM_BINLOG_DUMP = 0x12 21 | COM_TABLE_DUMP = 0x13 22 | COM_CONNECT_OUT = 0x14 23 | COM_REGISTER_SLAVE = 0x15 24 | COM_STMT_PREPARE = 0x16 25 | COM_STMT_EXECUTE = 0x17 26 | COM_STMT_SEND_LONG_DATA = 0x18 27 | COM_STMT_CLOSE = 0x19 28 | COM_STMT_RESET = 0x1a 29 | COM_SET_OPTION = 0x1b 30 | COM_STMT_FETCH = 0x1c 31 | COM_DAEMON = 0x1d 32 | COM_BINLOG_DUMP_GTID = 0x1e 33 | COM_END = 0x1f 34 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/constants/COMMAND.py: -------------------------------------------------------------------------------- 1 | 2 | COM_SLEEP = 0x00 3 | COM_QUIT = 0x01 4 | COM_INIT_DB = 0x02 5 | COM_QUERY = 0x03 6 | COM_FIELD_LIST = 0x04 7 | COM_CREATE_DB = 0x05 8 | COM_DROP_DB = 0x06 9 | COM_REFRESH = 0x07 10 | COM_SHUTDOWN = 0x08 11 | COM_STATISTICS = 0x09 12 | COM_PROCESS_INFO = 0x0a 13 | COM_CONNECT = 0x0b 14 | COM_PROCESS_KILL = 0x0c 15 | COM_DEBUG = 0x0d 16 | COM_PING = 0x0e 17 | COM_TIME = 0x0f 18 | COM_DELAYED_INSERT = 0x10 19 | COM_CHANGE_USER = 0x11 20 | COM_BINLOG_DUMP = 0x12 21 | COM_TABLE_DUMP = 0x13 22 | COM_CONNECT_OUT = 0x14 23 | COM_REGISTER_SLAVE = 0x15 24 | COM_STMT_PREPARE = 0x16 25 | COM_STMT_EXECUTE = 0x17 26 | COM_STMT_SEND_LONG_DATA = 0x18 27 | COM_STMT_CLOSE = 0x19 28 | COM_STMT_RESET = 0x1a 29 | COM_SET_OPTION = 0x1b 30 | COM_STMT_FETCH = 0x1c 31 | COM_DAEMON = 0x1d 32 | COM_BINLOG_DUMP_GTID = 0x1e 33 | COM_END = 0x1f 34 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import pytest 3 | import unittest 4 | 5 | from smart_open.transport import register_transport, get_transport 6 | 7 | 8 | class TransportTest(unittest.TestCase): 9 | 10 | def test_registry_requires_declared_schemes(self): 11 | with pytest.raises(ValueError): 12 | register_transport('smart_open.tests.fixtures.no_schemes_transport') 13 | 14 | def test_registry_errors_on_double_register_scheme(self): 15 | register_transport('smart_open.tests.fixtures.good_transport') 16 | with pytest.raises(AssertionError): 17 | register_transport('smart_open.tests.fixtures.good_transport') 18 | 19 | def test_registry_errors_get_transport_for_module_with_missing_deps(self): 20 | register_transport('smart_open.tests.fixtures.missing_deps_transport') 21 | with pytest.raises(ImportError): 22 | get_transport("missing") 23 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import pytest 3 | import unittest 4 | 5 | from smart_open.transport import register_transport, get_transport 6 | 7 | 8 | class TransportTest(unittest.TestCase): 9 | 10 | def test_registry_requires_declared_schemes(self): 11 | with pytest.raises(ValueError): 12 | register_transport('smart_open.tests.fixtures.no_schemes_transport') 13 | 14 | def test_registry_errors_on_double_register_scheme(self): 15 | register_transport('smart_open.tests.fixtures.good_transport') 16 | with pytest.raises(AssertionError): 17 | register_transport('smart_open.tests.fixtures.good_transport') 18 | 19 | def test_registry_errors_get_transport_for_module_with_missing_deps(self): 20 | register_transport('smart_open.tests.fixtures.missing_deps_transport') 21 | with pytest.raises(ImportError): 22 | get_transport("missing") 23 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import pytest 3 | import unittest 4 | 5 | from smart_open.transport import register_transport, get_transport 6 | 7 | 8 | class TransportTest(unittest.TestCase): 9 | 10 | def test_registry_requires_declared_schemes(self): 11 | with pytest.raises(ValueError): 12 | register_transport('smart_open.tests.fixtures.no_schemes_transport') 13 | 14 | def test_registry_errors_on_double_register_scheme(self): 15 | register_transport('smart_open.tests.fixtures.good_transport') 16 | with pytest.raises(AssertionError): 17 | register_transport('smart_open.tests.fixtures.good_transport') 18 | 19 | def test_registry_errors_get_transport_for_module_with_missing_deps(self): 20 | register_transport('smart_open.tests.fixtures.missing_deps_transport') 21 | with pytest.raises(ImportError): 22 | get_transport("missing") 23 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_transport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import pytest 3 | import unittest 4 | 5 | from smart_open.transport import register_transport, get_transport 6 | 7 | 8 | class TransportTest(unittest.TestCase): 9 | 10 | def test_registry_requires_declared_schemes(self): 11 | with pytest.raises(ValueError): 12 | register_transport('smart_open.tests.fixtures.no_schemes_transport') 13 | 14 | def test_registry_errors_on_double_register_scheme(self): 15 | register_transport('smart_open.tests.fixtures.good_transport') 16 | with pytest.raises(AssertionError): 17 | register_transport('smart_open.tests.fixtures.good_transport') 18 | 19 | def test_registry_errors_get_transport_for_module_with_missing_deps(self): 20 | register_transport('smart_open.tests.fixtures.missing_deps_transport') 21 | with pytest.raises(ImportError): 22 | get_transport("missing") 23 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/pymysql/constants/CLIENT.py: -------------------------------------------------------------------------------- 1 | # https://dev.mysql.com/doc/internals/en/capability-flags.html#packet-Protocol::CapabilityFlags 2 | LONG_PASSWORD = 1 3 | FOUND_ROWS = 1 << 1 4 | LONG_FLAG = 1 << 2 5 | CONNECT_WITH_DB = 1 << 3 6 | NO_SCHEMA = 1 << 4 7 | COMPRESS = 1 << 5 8 | ODBC = 1 << 6 9 | LOCAL_FILES = 1 << 7 10 | IGNORE_SPACE = 1 << 8 11 | PROTOCOL_41 = 1 << 9 12 | INTERACTIVE = 1 << 10 13 | SSL = 1 << 11 14 | IGNORE_SIGPIPE = 1 << 12 15 | TRANSACTIONS = 1 << 13 16 | SECURE_CONNECTION = 1 << 15 17 | MULTI_STATEMENTS = 1 << 16 18 | MULTI_RESULTS = 1 << 17 19 | PS_MULTI_RESULTS = 1 << 18 20 | PLUGIN_AUTH = 1 << 19 21 | CONNECT_ATTRS = 1 << 20 22 | PLUGIN_AUTH_LENENC_CLIENT_DATA = 1 << 21 23 | CAPABILITIES = ( 24 | LONG_PASSWORD | LONG_FLAG | PROTOCOL_41 | TRANSACTIONS 25 | | SECURE_CONNECTION | MULTI_RESULTS 26 | | PLUGIN_AUTH | PLUGIN_AUTH_LENENC_CLIENT_DATA | CONNECT_ATTRS) 27 | 28 | # Not done yet 29 | HANDLE_EXPIRED_PASSWORDS = 1 << 22 30 | SESSION_TRACK = 1 << 23 31 | DEPRECATE_EOF = 1 << 24 32 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/pymysql/constants/CLIENT.py: -------------------------------------------------------------------------------- 1 | # https://dev.mysql.com/doc/internals/en/capability-flags.html#packet-Protocol::CapabilityFlags 2 | LONG_PASSWORD = 1 3 | FOUND_ROWS = 1 << 1 4 | LONG_FLAG = 1 << 2 5 | CONNECT_WITH_DB = 1 << 3 6 | NO_SCHEMA = 1 << 4 7 | COMPRESS = 1 << 5 8 | ODBC = 1 << 6 9 | LOCAL_FILES = 1 << 7 10 | IGNORE_SPACE = 1 << 8 11 | PROTOCOL_41 = 1 << 9 12 | INTERACTIVE = 1 << 10 13 | SSL = 1 << 11 14 | IGNORE_SIGPIPE = 1 << 12 15 | TRANSACTIONS = 1 << 13 16 | SECURE_CONNECTION = 1 << 15 17 | MULTI_STATEMENTS = 1 << 16 18 | MULTI_RESULTS = 1 << 17 19 | PS_MULTI_RESULTS = 1 << 18 20 | PLUGIN_AUTH = 1 << 19 21 | CONNECT_ATTRS = 1 << 20 22 | PLUGIN_AUTH_LENENC_CLIENT_DATA = 1 << 21 23 | CAPABILITIES = ( 24 | LONG_PASSWORD | LONG_FLAG | PROTOCOL_41 | TRANSACTIONS 25 | | SECURE_CONNECTION | MULTI_RESULTS 26 | | PLUGIN_AUTH | PLUGIN_AUTH_LENENC_CLIENT_DATA | CONNECT_ATTRS) 27 | 28 | # Not done yet 29 | HANDLE_EXPIRED_PASSWORDS = 1 << 22 30 | SESSION_TRACK = 1 << 23 31 | DEPRECATE_EOF = 1 << 24 32 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/pymysql/constants/CLIENT.py: -------------------------------------------------------------------------------- 1 | # https://dev.mysql.com/doc/internals/en/capability-flags.html#packet-Protocol::CapabilityFlags 2 | LONG_PASSWORD = 1 3 | FOUND_ROWS = 1 << 1 4 | LONG_FLAG = 1 << 2 5 | CONNECT_WITH_DB = 1 << 3 6 | NO_SCHEMA = 1 << 4 7 | COMPRESS = 1 << 5 8 | ODBC = 1 << 6 9 | LOCAL_FILES = 1 << 7 10 | IGNORE_SPACE = 1 << 8 11 | PROTOCOL_41 = 1 << 9 12 | INTERACTIVE = 1 << 10 13 | SSL = 1 << 11 14 | IGNORE_SIGPIPE = 1 << 12 15 | TRANSACTIONS = 1 << 13 16 | SECURE_CONNECTION = 1 << 15 17 | MULTI_STATEMENTS = 1 << 16 18 | MULTI_RESULTS = 1 << 17 19 | PS_MULTI_RESULTS = 1 << 18 20 | PLUGIN_AUTH = 1 << 19 21 | CONNECT_ATTRS = 1 << 20 22 | PLUGIN_AUTH_LENENC_CLIENT_DATA = 1 << 21 23 | CAPABILITIES = ( 24 | LONG_PASSWORD | LONG_FLAG | PROTOCOL_41 | TRANSACTIONS 25 | | SECURE_CONNECTION | MULTI_RESULTS 26 | | PLUGIN_AUTH | PLUGIN_AUTH_LENENC_CLIENT_DATA | CONNECT_ATTRS) 27 | 28 | # Not done yet 29 | HANDLE_EXPIRED_PASSWORDS = 1 << 22 30 | SESSION_TRACK = 1 << 23 31 | DEPRECATE_EOF = 1 << 24 32 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/pymysql/constants/CLIENT.py: -------------------------------------------------------------------------------- 1 | # https://dev.mysql.com/doc/internals/en/capability-flags.html#packet-Protocol::CapabilityFlags 2 | LONG_PASSWORD = 1 3 | FOUND_ROWS = 1 << 1 4 | LONG_FLAG = 1 << 2 5 | CONNECT_WITH_DB = 1 << 3 6 | NO_SCHEMA = 1 << 4 7 | COMPRESS = 1 << 5 8 | ODBC = 1 << 6 9 | LOCAL_FILES = 1 << 7 10 | IGNORE_SPACE = 1 << 8 11 | PROTOCOL_41 = 1 << 9 12 | INTERACTIVE = 1 << 10 13 | SSL = 1 << 11 14 | IGNORE_SIGPIPE = 1 << 12 15 | TRANSACTIONS = 1 << 13 16 | SECURE_CONNECTION = 1 << 15 17 | MULTI_STATEMENTS = 1 << 16 18 | MULTI_RESULTS = 1 << 17 19 | PS_MULTI_RESULTS = 1 << 18 20 | PLUGIN_AUTH = 1 << 19 21 | CONNECT_ATTRS = 1 << 20 22 | PLUGIN_AUTH_LENENC_CLIENT_DATA = 1 << 21 23 | CAPABILITIES = ( 24 | LONG_PASSWORD | LONG_FLAG | PROTOCOL_41 | TRANSACTIONS 25 | | SECURE_CONNECTION | MULTI_RESULTS 26 | | PLUGIN_AUTH | PLUGIN_AUTH_LENENC_CLIENT_DATA | CONNECT_ATTRS) 27 | 28 | # Not done yet 29 | HANDLE_EXPIRED_PASSWORDS = 1 << 22 30 | SESSION_TRACK = 1 << 23 31 | DEPRECATE_EOF = 1 << 24 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 John Culkin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_package.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os 3 | import unittest 4 | import pytest 5 | 6 | from smart_open import open 7 | 8 | skip_tests = "SMART_OPEN_TEST_MISSING_DEPS" not in os.environ 9 | 10 | 11 | class PackageTests(unittest.TestCase): 12 | 13 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 14 | def test_azure_raises_helpful_error_with_missing_deps(self): 15 | with pytest.raises(ImportError, match=r"pip install smart_open\[azure\]"): 16 | open("azure://foo/bar") 17 | 18 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 19 | def test_aws_raises_helpful_error_with_missing_deps(self): 20 | match = r"pip install smart_open\[s3\]" 21 | with pytest.raises(ImportError, match=match): 22 | open("s3://foo/bar") 23 | 24 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 25 | def test_gcs_raises_helpful_error_with_missing_deps(self): 26 | with pytest.raises(ImportError, match=r"pip install smart_open\[gcs\]"): 27 | open("gs://foo/bar") 28 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_package.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os 3 | import unittest 4 | import pytest 5 | 6 | from smart_open import open 7 | 8 | skip_tests = "SMART_OPEN_TEST_MISSING_DEPS" not in os.environ 9 | 10 | 11 | class PackageTests(unittest.TestCase): 12 | 13 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 14 | def test_azure_raises_helpful_error_with_missing_deps(self): 15 | with pytest.raises(ImportError, match=r"pip install smart_open\[azure\]"): 16 | open("azure://foo/bar") 17 | 18 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 19 | def test_aws_raises_helpful_error_with_missing_deps(self): 20 | match = r"pip install smart_open\[s3\]" 21 | with pytest.raises(ImportError, match=match): 22 | open("s3://foo/bar") 23 | 24 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 25 | def test_gcs_raises_helpful_error_with_missing_deps(self): 26 | with pytest.raises(ImportError, match=r"pip install smart_open\[gcs\]"): 27 | open("gs://foo/bar") 28 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_package.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os 3 | import unittest 4 | import pytest 5 | 6 | from smart_open import open 7 | 8 | skip_tests = "SMART_OPEN_TEST_MISSING_DEPS" not in os.environ 9 | 10 | 11 | class PackageTests(unittest.TestCase): 12 | 13 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 14 | def test_azure_raises_helpful_error_with_missing_deps(self): 15 | with pytest.raises(ImportError, match=r"pip install smart_open\[azure\]"): 16 | open("azure://foo/bar") 17 | 18 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 19 | def test_aws_raises_helpful_error_with_missing_deps(self): 20 | match = r"pip install smart_open\[s3\]" 21 | with pytest.raises(ImportError, match=match): 22 | open("s3://foo/bar") 23 | 24 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 25 | def test_gcs_raises_helpful_error_with_missing_deps(self): 26 | with pytest.raises(ImportError, match=r"pip install smart_open\[gcs\]"): 27 | open("gs://foo/bar") 28 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_package.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os 3 | import unittest 4 | import pytest 5 | 6 | from smart_open import open 7 | 8 | skip_tests = "SMART_OPEN_TEST_MISSING_DEPS" not in os.environ 9 | 10 | 11 | class PackageTests(unittest.TestCase): 12 | 13 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 14 | def test_azure_raises_helpful_error_with_missing_deps(self): 15 | with pytest.raises(ImportError, match=r"pip install smart_open\[azure\]"): 16 | open("azure://foo/bar") 17 | 18 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 19 | def test_aws_raises_helpful_error_with_missing_deps(self): 20 | match = r"pip install smart_open\[s3\]" 21 | with pytest.raises(ImportError, match=match): 22 | open("s3://foo/bar") 23 | 24 | @pytest.mark.skipif(skip_tests, reason="requires missing dependencies") 25 | def test_gcs_raises_helpful_error_with_missing_deps(self): 26 | with pytest.raises(ImportError, match=r"pip install smart_open\[gcs\]"): 27 | open("gs://foo/bar") 28 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_sanity.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import boto3 4 | import moto 5 | 6 | 7 | @moto.mock_s3() 8 | def setUpModule(): 9 | bucket = boto3.resource('s3').create_bucket(Bucket='mybucket') 10 | 11 | bucket.wait_until_exists() 12 | 13 | 14 | @moto.mock_s3() 15 | def tearDownModule(): 16 | resource = boto3.resource('s3') 17 | bucket = resource.Bucket('mybucket') 18 | try: 19 | bucket.delete() 20 | except resource.meta.client.exceptions.NoSuchBucket: 21 | pass 22 | bucket.wait_until_not_exists() 23 | 24 | 25 | @moto.mock_s3() 26 | class Test(unittest.TestCase): 27 | 28 | def test(self): 29 | resource = boto3.resource('s3') 30 | 31 | bucket = resource.Bucket('mybucket') 32 | self.assertEqual(bucket.name, 'mybucket') 33 | 34 | expected = b'hello' 35 | resource.Object('mybucket', 'mykey').put(Body=expected) 36 | 37 | actual = resource.Object('mybucket', 'mykey').get()['Body'].read() 38 | self.assertEqual(expected, actual) 39 | 40 | def tearDown(self): 41 | boto3.resource('s3').Object('mybucket', 'mykey').delete() 42 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_sanity.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import boto3 4 | import moto 5 | 6 | 7 | @moto.mock_s3() 8 | def setUpModule(): 9 | bucket = boto3.resource('s3').create_bucket(Bucket='mybucket') 10 | 11 | bucket.wait_until_exists() 12 | 13 | 14 | @moto.mock_s3() 15 | def tearDownModule(): 16 | resource = boto3.resource('s3') 17 | bucket = resource.Bucket('mybucket') 18 | try: 19 | bucket.delete() 20 | except resource.meta.client.exceptions.NoSuchBucket: 21 | pass 22 | bucket.wait_until_not_exists() 23 | 24 | 25 | @moto.mock_s3() 26 | class Test(unittest.TestCase): 27 | 28 | def test(self): 29 | resource = boto3.resource('s3') 30 | 31 | bucket = resource.Bucket('mybucket') 32 | self.assertEqual(bucket.name, 'mybucket') 33 | 34 | expected = b'hello' 35 | resource.Object('mybucket', 'mykey').put(Body=expected) 36 | 37 | actual = resource.Object('mybucket', 'mykey').get()['Body'].read() 38 | self.assertEqual(expected, actual) 39 | 40 | def tearDown(self): 41 | boto3.resource('s3').Object('mybucket', 'mykey').delete() 42 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_sanity.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import boto3 4 | import moto 5 | 6 | 7 | @moto.mock_s3() 8 | def setUpModule(): 9 | bucket = boto3.resource('s3').create_bucket(Bucket='mybucket') 10 | 11 | bucket.wait_until_exists() 12 | 13 | 14 | @moto.mock_s3() 15 | def tearDownModule(): 16 | resource = boto3.resource('s3') 17 | bucket = resource.Bucket('mybucket') 18 | try: 19 | bucket.delete() 20 | except resource.meta.client.exceptions.NoSuchBucket: 21 | pass 22 | bucket.wait_until_not_exists() 23 | 24 | 25 | @moto.mock_s3() 26 | class Test(unittest.TestCase): 27 | 28 | def test(self): 29 | resource = boto3.resource('s3') 30 | 31 | bucket = resource.Bucket('mybucket') 32 | self.assertEqual(bucket.name, 'mybucket') 33 | 34 | expected = b'hello' 35 | resource.Object('mybucket', 'mykey').put(Body=expected) 36 | 37 | actual = resource.Object('mybucket', 'mykey').get()['Body'].read() 38 | self.assertEqual(expected, actual) 39 | 40 | def tearDown(self): 41 | boto3.resource('s3').Object('mybucket', 'mykey').delete() 42 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_sanity.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import boto3 4 | import moto 5 | 6 | 7 | @moto.mock_s3() 8 | def setUpModule(): 9 | bucket = boto3.resource('s3').create_bucket(Bucket='mybucket') 10 | 11 | bucket.wait_until_exists() 12 | 13 | 14 | @moto.mock_s3() 15 | def tearDownModule(): 16 | resource = boto3.resource('s3') 17 | bucket = resource.Bucket('mybucket') 18 | try: 19 | bucket.delete() 20 | except resource.meta.client.exceptions.NoSuchBucket: 21 | pass 22 | bucket.wait_until_not_exists() 23 | 24 | 25 | @moto.mock_s3() 26 | class Test(unittest.TestCase): 27 | 28 | def test(self): 29 | resource = boto3.resource('s3') 30 | 31 | bucket = resource.Bucket('mybucket') 32 | self.assertEqual(bucket.name, 'mybucket') 33 | 34 | expected = b'hello' 35 | resource.Object('mybucket', 'mykey').put(Body=expected) 36 | 37 | actual = resource.Object('mybucket', 'mykey').get()['Body'].read() 38 | self.assertEqual(expected, actual) 39 | 40 | def tearDown(self): 41 | boto3.resource('s3').Object('mybucket', 'mykey').delete() 42 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, 2013 PyMySQL contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, 2013 PyMySQL contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, 2013 PyMySQL contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/pymysql/python/PyMySQL-0.10.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, 2013 PyMySQL contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Radim Řehůřek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Radim Řehůřek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Radim Řehůřek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open-4.1.0.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Radim Řehůřek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/local_file.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2020 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | """Implements the transport for the file:// schema.""" 9 | import io 10 | import os.path 11 | 12 | SCHEME = 'file' 13 | 14 | URI_EXAMPLES = ( 15 | './local/path/file', 16 | '~/local/path/file', 17 | 'local/path/file', 18 | './local/path/file.gz', 19 | 'file:///home/user/file', 20 | 'file:///home/user/file.bz2', 21 | ) 22 | 23 | 24 | open = io.open 25 | 26 | 27 | def parse_uri(uri_as_string): 28 | local_path = extract_local_path(uri_as_string) 29 | return dict(scheme=SCHEME, uri_path=local_path) 30 | 31 | 32 | def open_uri(uri_as_string, mode, transport_params): 33 | parsed_uri = parse_uri(uri_as_string) 34 | fobj = io.open(parsed_uri['uri_path'], mode) 35 | return fobj 36 | 37 | 38 | def extract_local_path(uri_as_string): 39 | if uri_as_string.startswith('file://'): 40 | local_path = uri_as_string.replace('file://', '', 1) 41 | else: 42 | local_path = uri_as_string 43 | return os.path.expanduser(local_path) 44 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/local_file.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2020 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | """Implements the transport for the file:// schema.""" 9 | import io 10 | import os.path 11 | 12 | SCHEME = 'file' 13 | 14 | URI_EXAMPLES = ( 15 | './local/path/file', 16 | '~/local/path/file', 17 | 'local/path/file', 18 | './local/path/file.gz', 19 | 'file:///home/user/file', 20 | 'file:///home/user/file.bz2', 21 | ) 22 | 23 | 24 | open = io.open 25 | 26 | 27 | def parse_uri(uri_as_string): 28 | local_path = extract_local_path(uri_as_string) 29 | return dict(scheme=SCHEME, uri_path=local_path) 30 | 31 | 32 | def open_uri(uri_as_string, mode, transport_params): 33 | parsed_uri = parse_uri(uri_as_string) 34 | fobj = io.open(parsed_uri['uri_path'], mode) 35 | return fobj 36 | 37 | 38 | def extract_local_path(uri_as_string): 39 | if uri_as_string.startswith('file://'): 40 | local_path = uri_as_string.replace('file://', '', 1) 41 | else: 42 | local_path = uri_as_string 43 | return os.path.expanduser(local_path) 44 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/local_file.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2020 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | """Implements the transport for the file:// schema.""" 9 | import io 10 | import os.path 11 | 12 | SCHEME = 'file' 13 | 14 | URI_EXAMPLES = ( 15 | './local/path/file', 16 | '~/local/path/file', 17 | 'local/path/file', 18 | './local/path/file.gz', 19 | 'file:///home/user/file', 20 | 'file:///home/user/file.bz2', 21 | ) 22 | 23 | 24 | open = io.open 25 | 26 | 27 | def parse_uri(uri_as_string): 28 | local_path = extract_local_path(uri_as_string) 29 | return dict(scheme=SCHEME, uri_path=local_path) 30 | 31 | 32 | def open_uri(uri_as_string, mode, transport_params): 33 | parsed_uri = parse_uri(uri_as_string) 34 | fobj = io.open(parsed_uri['uri_path'], mode) 35 | return fobj 36 | 37 | 38 | def extract_local_path(uri_as_string): 39 | if uri_as_string.startswith('file://'): 40 | local_path = uri_as_string.replace('file://', '', 1) 41 | else: 42 | local_path = uri_as_string 43 | return os.path.expanduser(local_path) 44 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/local_file.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2020 Radim Rehurek 4 | # 5 | # This code is distributed under the terms and conditions 6 | # from the MIT License (MIT). 7 | # 8 | """Implements the transport for the file:// schema.""" 9 | import io 10 | import os.path 11 | 12 | SCHEME = 'file' 13 | 14 | URI_EXAMPLES = ( 15 | './local/path/file', 16 | '~/local/path/file', 17 | 'local/path/file', 18 | './local/path/file.gz', 19 | 'file:///home/user/file', 20 | 'file:///home/user/file.bz2', 21 | ) 22 | 23 | 24 | open = io.open 25 | 26 | 27 | def parse_uri(uri_as_string): 28 | local_path = extract_local_path(uri_as_string) 29 | return dict(scheme=SCHEME, uri_path=local_path) 30 | 31 | 32 | def open_uri(uri_as_string, mode, transport_params): 33 | parsed_uri = parse_uri(uri_as_string) 34 | fobj = io.open(parsed_uri['uri_path'], mode) 35 | return fobj 36 | 37 | 38 | def extract_local_path(uri_as_string): 39 | if uri_as_string.startswith('file://'): 40 | local_path = uri_as_string.replace('file://', '', 1) 41 | else: 42 | local_path = uri_as_string 43 | return os.path.expanduser(local_path) 44 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/db-app-lambda/lambda_function.py: -------------------------------------------------------------------------------- 1 | import boto3 2 | import botocore 3 | import sys 4 | import pymysql 5 | import logging 6 | import os 7 | 8 | 9 | logger = logging.getLogger() 10 | logger.setLevel(logging.INFO) 11 | session = boto3.session.Session() 12 | 13 | 14 | def lambda_handler(event, context): 15 | 16 | rds_host = os.environ["DB_HOST"] 17 | username = "admin" 18 | ssl = {'ca': '/opt/python/AmazonRootCA1.pem'} 19 | 20 | rds_client = session.client( 21 | service_name='rds', 22 | region_name=os.environ["AWS_REGION"] 23 | ) 24 | 25 | try: 26 | auth_token = rds_client.generate_db_auth_token(rds_host, 3306, username) 27 | except botocore.exceptions.ClientError as e: 28 | logger.error("ERROR: Could not get auth token!") 29 | logger.error(e) 30 | sys.exit(e) 31 | 32 | try: 33 | pymysql.connect(rds_host, user=username, passwd=auth_token, connect_timeout=5, ssl=ssl) 34 | logger.info("SUCCESS: Connected to the MySQL RDS Database!") 35 | except pymysql.MySQLError as e: 36 | logger.error("ERROR: Could not connect to MySQL RDS Database!") 37 | logger.error(e) 38 | sys.exit(e) 39 | 40 | return("Successfully connected to RDS via RDS Proxy!") 41 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="cdk_aws_cookbook_404", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "cdk_aws_cookbook_404"}, 19 | packages=setuptools.find_packages(where="cdk_aws_cookbook_404"), 20 | 21 | install_requires=[ 22 | "aws-cdk-lib>=2.0.0rc1", 23 | "constructs>=10.0.0", 24 | ], 25 | 26 | python_requires=">=3.6", 27 | 28 | classifiers=[ 29 | "Development Status :: 4 - Beta", 30 | 31 | "Intended Audience :: Developers", 32 | 33 | "License :: OSI Approved :: Apache Software License", 34 | 35 | "Programming Language :: JavaScript", 36 | "Programming Language :: Python :: 3 :: Only", 37 | "Programming Language :: Python :: 3.6", 38 | "Programming Language :: Python :: 3.7", 39 | "Programming Language :: Python :: 3.8", 40 | 41 | "Topic :: Software Development :: Code Generators", 42 | "Topic :: Utilities", 43 | 44 | "Typing :: Typed", 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="cdk_aws_cookbook_401", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "cdk_aws_cookbook_401"}, 19 | packages=setuptools.find_packages(where="cdk_aws_cookbook_401"), 20 | 21 | install_requires=[ 22 | "aws-cdk-lib>=2.0.0rc1", 23 | "constructs>=10.0.0", 24 | ], 25 | 26 | python_requires=">=3.6", 27 | 28 | classifiers=[ 29 | "Development Status :: 4 - Beta", 30 | 31 | "Intended Audience :: Developers", 32 | 33 | "License :: OSI Approved :: Apache Software License", 34 | 35 | "Programming Language :: JavaScript", 36 | "Programming Language :: Python :: 3 :: Only", 37 | "Programming Language :: Python :: 3.6", 38 | "Programming Language :: Python :: 3.7", 39 | "Programming Language :: Python :: 3.8", 40 | 41 | "Topic :: Software Development :: Code Generators", 42 | "Topic :: Utilities", 43 | 44 | "Typing :: Typed", 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="cdk_aws_cookbook_402", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "cdk_aws_cookbook_402"}, 19 | packages=setuptools.find_packages(where="cdk_aws_cookbook_402"), 20 | 21 | install_requires=[ 22 | "aws-cdk-lib>=2.0.0rc1", 23 | "constructs>=10.0.0", 24 | ], 25 | 26 | python_requires=">=3.6", 27 | 28 | classifiers=[ 29 | "Development Status :: 4 - Beta", 30 | 31 | "Intended Audience :: Developers", 32 | 33 | "License :: OSI Approved :: Apache Software License", 34 | 35 | "Programming Language :: JavaScript", 36 | "Programming Language :: Python :: 3 :: Only", 37 | "Programming Language :: Python :: 3.6", 38 | "Programming Language :: Python :: 3.7", 39 | "Programming Language :: Python :: 3.8", 40 | 41 | "Topic :: Software Development :: Code Generators", 42 | "Topic :: Utilities", 43 | 44 | "Typing :: Typed", 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/pymysql/python/AmazonRootCA1.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF 3 | ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 4 | b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL 5 | MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv 6 | b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj 7 | ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM 8 | 9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw 9 | IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6 10 | VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L 11 | 93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm 12 | jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC 13 | AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA 14 | A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI 15 | U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs 16 | N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv 17 | o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU 18 | 5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy 19 | rqXRfboQnoZsG4q5WTP468SQvvG5 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="cdk_aws_cookbook_403", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "cdk_aws_cookbook_403"}, 19 | packages=setuptools.find_packages(where="cdk_aws_cookbook_403"), 20 | 21 | install_requires=[ 22 | "aws-cdk-lib>=2.0.0rc1", 23 | "constructs>=10.0.0", 24 | ], 25 | 26 | python_requires=">=3.6", 27 | 28 | classifiers=[ 29 | "Development Status :: 4 - Beta", 30 | 31 | "Intended Audience :: Developers", 32 | 33 | "License :: OSI Approved :: Apache Software License", 34 | 35 | "Programming Language :: JavaScript", 36 | "Programming Language :: Python :: 3 :: Only", 37 | "Programming Language :: Python :: 3.6", 38 | "Programming Language :: Python :: 3.7", 39 | "Programming Language :: Python :: 3.8", 40 | 41 | "Topic :: Software Development :: Code Generators", 42 | "Topic :: Utilities", 43 | 44 | "Typing :: Typed", 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="cdk_aws_cookbook_405", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "cdk_aws_cookbook_405"}, 19 | packages=setuptools.find_packages(where="cdk_aws_cookbook_405"), 20 | 21 | install_requires=[ 22 | "aws-cdk-lib>=2.0.0rc1", 23 | "constructs>=10.0.0", 24 | ], 25 | 26 | python_requires=">=3.6", 27 | 28 | classifiers=[ 29 | "Development Status :: 4 - Beta", 30 | 31 | "Intended Audience :: Developers", 32 | 33 | "License :: OSI Approved :: Apache Software License", 34 | 35 | "Programming Language :: JavaScript", 36 | "Programming Language :: Python :: 3 :: Only", 37 | "Programming Language :: Python :: 3.6", 38 | "Programming Language :: Python :: 3.7", 39 | "Programming Language :: Python :: 3.8", 40 | 41 | "Topic :: Software Development :: Code Generators", 42 | "Topic :: Utilities", 43 | 44 | "Typing :: Typed", 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="cdk_aws_cookbook_407", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "cdk_aws_cookbook_407"}, 19 | packages=setuptools.find_packages(where="cdk_aws_cookbook_407"), 20 | 21 | install_requires=[ 22 | "aws-cdk-lib>=2.0.0rc1", 23 | "constructs>=10.0.0", 24 | ], 25 | 26 | python_requires=">=3.6", 27 | 28 | classifiers=[ 29 | "Development Status :: 4 - Beta", 30 | 31 | "Intended Audience :: Developers", 32 | 33 | "License :: OSI Approved :: Apache Software License", 34 | 35 | "Programming Language :: JavaScript", 36 | "Programming Language :: Python :: 3 :: Only", 37 | "Programming Language :: Python :: 3.6", 38 | "Programming Language :: Python :: 3.7", 39 | "Programming Language :: Python :: 3.8", 40 | 41 | "Topic :: Software Development :: Code Generators", 42 | "Topic :: Utilities", 43 | 44 | "Typing :: Typed", 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/cdk-AWS-Cookbook-408/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="cdk_aws_cookbook_408", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "cdk_aws_cookbook_408"}, 19 | packages=setuptools.find_packages(where="cdk_aws_cookbook_408"), 20 | 21 | install_requires=[ 22 | "aws-cdk-lib>=2.0.0rc1", 23 | "constructs>=10.0.0", 24 | ], 25 | 26 | python_requires=">=3.6", 27 | 28 | classifiers=[ 29 | "Development Status :: 4 - Beta", 30 | 31 | "Intended Audience :: Developers", 32 | 33 | "License :: OSI Approved :: Apache Software License", 34 | 35 | "Programming Language :: JavaScript", 36 | "Programming Language :: Python :: 3 :: Only", 37 | "Programming Language :: Python :: 3.6", 38 | "Programming Language :: Python :: 3.7", 39 | "Programming Language :: Python :: 3.8", 40 | 41 | "Topic :: Software Development :: Code Generators", 42 | "Topic :: Utilities", 43 | 44 | "Typing :: Typed", 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/lambda_function.py: -------------------------------------------------------------------------------- 1 | import boto3 2 | import botocore 3 | import sys 4 | import pymysql 5 | import logging 6 | import os 7 | 8 | 9 | logger = logging.getLogger() 10 | logger.setLevel(logging.INFO) 11 | s3 = boto3.resource('s3') 12 | session = boto3.session.Session() 13 | 14 | 15 | def lambda_handler(event, context): 16 | 17 | rds_host = os.environ["DB_HOST"] 18 | username = "db_user" 19 | ssl = {'ca': '/opt/python/rds-combined-ca-bundle.pem'} 20 | 21 | rds_client = session.client( 22 | service_name='rds', 23 | region_name=os.environ["AWS_REGION"] 24 | ) 25 | 26 | try: 27 | auth_token = rds_client.generate_db_auth_token(rds_host, 3306, username) 28 | logger.info("Got auth token!") 29 | except botocore.exceptions.ClientError as e: 30 | logger.error("ERROR: Could not get auth token!") 31 | logger.error(e) 32 | sys.exit(e) 33 | 34 | try: 35 | pymysql.connect(rds_host, user=username, passwd=auth_token, connect_timeout=5, ssl=ssl) 36 | logger.info("SUCCESS: Connected to the MySQL RDS Database!") 37 | except pymysql.MySQLError as e: 38 | logger.error("ERROR: Could not connect to MySQL RDS Database!") 39 | logger.error(e) 40 | sys.exit(e) 41 | 42 | return("Successfully connected to RDS with IAM!") 43 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2009-2018 the sqlparse authors and contributors 4 | # 5 | # 6 | # This module is part of python-sqlparse and is released under 7 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 8 | 9 | """Python 2/3 compatibility. 10 | 11 | This module only exists to avoid a dependency on six 12 | for very trivial stuff. We only need to take care of 13 | string types, buffers and metaclasses. 14 | 15 | Parts of the code is copied directly from six: 16 | https://bitbucket.org/gutworth/six 17 | """ 18 | 19 | import sys 20 | from io import TextIOBase 21 | 22 | PY2 = sys.version_info[0] == 2 23 | PY3 = sys.version_info[0] == 3 24 | 25 | 26 | if PY3: 27 | def unicode_compatible(cls): 28 | return cls 29 | 30 | text_type = str 31 | string_types = (str,) 32 | from io import StringIO 33 | file_types = (StringIO, TextIOBase) 34 | 35 | 36 | elif PY2: 37 | def unicode_compatible(cls): 38 | cls.__unicode__ = cls.__str__ 39 | cls.__str__ = lambda x: x.__unicode__().encode('utf-8') 40 | return cls 41 | 42 | text_type = unicode 43 | string_types = (str, unicode,) 44 | from StringIO import StringIO 45 | file_types = (file, StringIO, TextIOBase) 46 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2009-2018 the sqlparse authors and contributors 4 | # 5 | # 6 | # This module is part of python-sqlparse and is released under 7 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 8 | 9 | """Python 2/3 compatibility. 10 | 11 | This module only exists to avoid a dependency on six 12 | for very trivial stuff. We only need to take care of 13 | string types, buffers and metaclasses. 14 | 15 | Parts of the code is copied directly from six: 16 | https://bitbucket.org/gutworth/six 17 | """ 18 | 19 | import sys 20 | from io import TextIOBase 21 | 22 | PY2 = sys.version_info[0] == 2 23 | PY3 = sys.version_info[0] == 3 24 | 25 | 26 | if PY3: 27 | def unicode_compatible(cls): 28 | return cls 29 | 30 | text_type = str 31 | string_types = (str,) 32 | from io import StringIO 33 | file_types = (StringIO, TextIOBase) 34 | 35 | 36 | elif PY2: 37 | def unicode_compatible(cls): 38 | cls.__unicode__ = cls.__str__ 39 | cls.__str__ = lambda x: x.__unicode__().encode('utf-8') 40 | return cls 41 | 42 | text_type = unicode 43 | string_types = (str, unicode,) 44 | from StringIO import StringIO 45 | file_types = (file, StringIO, TextIOBase) 46 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2009-2018 the sqlparse authors and contributors 4 | # 5 | # 6 | # This module is part of python-sqlparse and is released under 7 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 8 | 9 | """Python 2/3 compatibility. 10 | 11 | This module only exists to avoid a dependency on six 12 | for very trivial stuff. We only need to take care of 13 | string types, buffers and metaclasses. 14 | 15 | Parts of the code is copied directly from six: 16 | https://bitbucket.org/gutworth/six 17 | """ 18 | 19 | import sys 20 | from io import TextIOBase 21 | 22 | PY2 = sys.version_info[0] == 2 23 | PY3 = sys.version_info[0] == 3 24 | 25 | 26 | if PY3: 27 | def unicode_compatible(cls): 28 | return cls 29 | 30 | text_type = str 31 | string_types = (str,) 32 | from io import StringIO 33 | file_types = (StringIO, TextIOBase) 34 | 35 | 36 | elif PY2: 37 | def unicode_compatible(cls): 38 | cls.__unicode__ = cls.__str__ 39 | cls.__str__ = lambda x: x.__unicode__().encode('utf-8') 40 | return cls 41 | 42 | text_type = unicode 43 | string_types = (str, unicode,) 44 | from StringIO import StringIO 45 | file_types = (file, StringIO, TextIOBase) 46 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2009-2018 the sqlparse authors and contributors 4 | # 5 | # 6 | # This module is part of python-sqlparse and is released under 7 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 8 | 9 | """Python 2/3 compatibility. 10 | 11 | This module only exists to avoid a dependency on six 12 | for very trivial stuff. We only need to take care of 13 | string types, buffers and metaclasses. 14 | 15 | Parts of the code is copied directly from six: 16 | https://bitbucket.org/gutworth/six 17 | """ 18 | 19 | import sys 20 | from io import TextIOBase 21 | 22 | PY2 = sys.version_info[0] == 2 23 | PY3 = sys.version_info[0] == 3 24 | 25 | 26 | if PY3: 27 | def unicode_compatible(cls): 28 | return cls 29 | 30 | text_type = str 31 | string_types = (str,) 32 | from io import StringIO 33 | file_types = (StringIO, TextIOBase) 34 | 35 | 36 | elif PY2: 37 | def unicode_compatible(cls): 38 | cls.__unicode__ = cls.__str__ 39 | cls.__str__ = lambda x: x.__unicode__().encode('utf-8') 40 | return cls 41 | 42 | text_type = unicode 43 | string_types = (str, unicode,) 44 | from StringIO import StringIO 45 | file_types = (file, StringIO, TextIOBase) 46 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse/engine/filter_stack.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | """filter""" 9 | 10 | from sqlparse import lexer 11 | from sqlparse.engine import grouping 12 | from sqlparse.engine.statement_splitter import StatementSplitter 13 | 14 | 15 | class FilterStack: 16 | def __init__(self): 17 | self.preprocess = [] 18 | self.stmtprocess = [] 19 | self.postprocess = [] 20 | self._grouping = False 21 | 22 | def enable_grouping(self): 23 | self._grouping = True 24 | 25 | def run(self, sql, encoding=None): 26 | stream = lexer.tokenize(sql, encoding) 27 | # Process token stream 28 | for filter_ in self.preprocess: 29 | stream = filter_.process(stream) 30 | 31 | stream = StatementSplitter().process(stream) 32 | 33 | # Output: Stream processed Statements 34 | for stmt in stream: 35 | if self._grouping: 36 | stmt = grouping.group(stmt) 37 | 38 | for filter_ in self.stmtprocess: 39 | filter_.process(stmt) 40 | 41 | for filter_ in self.postprocess: 42 | stmt = filter_.process(stmt) 43 | 44 | yield stmt 45 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse/engine/filter_stack.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | """filter""" 9 | 10 | from sqlparse import lexer 11 | from sqlparse.engine import grouping 12 | from sqlparse.engine.statement_splitter import StatementSplitter 13 | 14 | 15 | class FilterStack: 16 | def __init__(self): 17 | self.preprocess = [] 18 | self.stmtprocess = [] 19 | self.postprocess = [] 20 | self._grouping = False 21 | 22 | def enable_grouping(self): 23 | self._grouping = True 24 | 25 | def run(self, sql, encoding=None): 26 | stream = lexer.tokenize(sql, encoding) 27 | # Process token stream 28 | for filter_ in self.preprocess: 29 | stream = filter_.process(stream) 30 | 31 | stream = StatementSplitter().process(stream) 32 | 33 | # Output: Stream processed Statements 34 | for stmt in stream: 35 | if self._grouping: 36 | stmt = grouping.group(stmt) 37 | 38 | for filter_ in self.stmtprocess: 39 | filter_.process(stmt) 40 | 41 | for filter_ in self.postprocess: 42 | stmt = filter_.process(stmt) 43 | 44 | yield stmt 45 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse/engine/filter_stack.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | """filter""" 9 | 10 | from sqlparse import lexer 11 | from sqlparse.engine import grouping 12 | from sqlparse.engine.statement_splitter import StatementSplitter 13 | 14 | 15 | class FilterStack: 16 | def __init__(self): 17 | self.preprocess = [] 18 | self.stmtprocess = [] 19 | self.postprocess = [] 20 | self._grouping = False 21 | 22 | def enable_grouping(self): 23 | self._grouping = True 24 | 25 | def run(self, sql, encoding=None): 26 | stream = lexer.tokenize(sql, encoding) 27 | # Process token stream 28 | for filter_ in self.preprocess: 29 | stream = filter_.process(stream) 30 | 31 | stream = StatementSplitter().process(stream) 32 | 33 | # Output: Stream processed Statements 34 | for stmt in stream: 35 | if self._grouping: 36 | stmt = grouping.group(stmt) 37 | 38 | for filter_ in self.stmtprocess: 39 | filter_.process(stmt) 40 | 41 | for filter_ in self.postprocess: 42 | stmt = filter_.process(stmt) 43 | 44 | yield stmt 45 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse/engine/filter_stack.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | """filter""" 9 | 10 | from sqlparse import lexer 11 | from sqlparse.engine import grouping 12 | from sqlparse.engine.statement_splitter import StatementSplitter 13 | 14 | 15 | class FilterStack: 16 | def __init__(self): 17 | self.preprocess = [] 18 | self.stmtprocess = [] 19 | self.postprocess = [] 20 | self._grouping = False 21 | 22 | def enable_grouping(self): 23 | self._grouping = True 24 | 25 | def run(self, sql, encoding=None): 26 | stream = lexer.tokenize(sql, encoding) 27 | # Process token stream 28 | for filter_ in self.preprocess: 29 | stream = filter_.process(stream) 30 | 31 | stream = StatementSplitter().process(stream) 32 | 33 | # Output: Stream processed Statements 34 | for stmt in stream: 35 | if self._grouping: 36 | stmt = grouping.group(stmt) 37 | 38 | for filter_ in self.stmtprocess: 39 | filter_.process(stmt) 40 | 41 | for filter_ in self.postprocess: 42 | stmt = filter_.process(stmt) 43 | 44 | yield stmt 45 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse/filters/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse.filters.others import SerializerUnicode 9 | from sqlparse.filters.others import StripCommentsFilter 10 | from sqlparse.filters.others import StripWhitespaceFilter 11 | from sqlparse.filters.others import SpacesAroundOperatorsFilter 12 | 13 | from sqlparse.filters.output import OutputPHPFilter 14 | from sqlparse.filters.output import OutputPythonFilter 15 | 16 | from sqlparse.filters.tokens import KeywordCaseFilter 17 | from sqlparse.filters.tokens import IdentifierCaseFilter 18 | from sqlparse.filters.tokens import TruncateStringFilter 19 | 20 | from sqlparse.filters.reindent import ReindentFilter 21 | from sqlparse.filters.right_margin import RightMarginFilter 22 | from sqlparse.filters.aligned_indent import AlignedIndentFilter 23 | 24 | __all__ = [ 25 | 'SerializerUnicode', 26 | 'StripCommentsFilter', 27 | 'StripWhitespaceFilter', 28 | 'SpacesAroundOperatorsFilter', 29 | 30 | 'OutputPHPFilter', 31 | 'OutputPythonFilter', 32 | 33 | 'KeywordCaseFilter', 34 | 'IdentifierCaseFilter', 35 | 'TruncateStringFilter', 36 | 37 | 'ReindentFilter', 38 | 'RightMarginFilter', 39 | 'AlignedIndentFilter', 40 | ] 41 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse/filters/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse.filters.others import SerializerUnicode 9 | from sqlparse.filters.others import StripCommentsFilter 10 | from sqlparse.filters.others import StripWhitespaceFilter 11 | from sqlparse.filters.others import SpacesAroundOperatorsFilter 12 | 13 | from sqlparse.filters.output import OutputPHPFilter 14 | from sqlparse.filters.output import OutputPythonFilter 15 | 16 | from sqlparse.filters.tokens import KeywordCaseFilter 17 | from sqlparse.filters.tokens import IdentifierCaseFilter 18 | from sqlparse.filters.tokens import TruncateStringFilter 19 | 20 | from sqlparse.filters.reindent import ReindentFilter 21 | from sqlparse.filters.right_margin import RightMarginFilter 22 | from sqlparse.filters.aligned_indent import AlignedIndentFilter 23 | 24 | __all__ = [ 25 | 'SerializerUnicode', 26 | 'StripCommentsFilter', 27 | 'StripWhitespaceFilter', 28 | 'SpacesAroundOperatorsFilter', 29 | 30 | 'OutputPHPFilter', 31 | 'OutputPythonFilter', 32 | 33 | 'KeywordCaseFilter', 34 | 'IdentifierCaseFilter', 35 | 'TruncateStringFilter', 36 | 37 | 'ReindentFilter', 38 | 'RightMarginFilter', 39 | 'AlignedIndentFilter', 40 | ] 41 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse/filters/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse.filters.others import SerializerUnicode 9 | from sqlparse.filters.others import StripCommentsFilter 10 | from sqlparse.filters.others import StripWhitespaceFilter 11 | from sqlparse.filters.others import SpacesAroundOperatorsFilter 12 | 13 | from sqlparse.filters.output import OutputPHPFilter 14 | from sqlparse.filters.output import OutputPythonFilter 15 | 16 | from sqlparse.filters.tokens import KeywordCaseFilter 17 | from sqlparse.filters.tokens import IdentifierCaseFilter 18 | from sqlparse.filters.tokens import TruncateStringFilter 19 | 20 | from sqlparse.filters.reindent import ReindentFilter 21 | from sqlparse.filters.right_margin import RightMarginFilter 22 | from sqlparse.filters.aligned_indent import AlignedIndentFilter 23 | 24 | __all__ = [ 25 | 'SerializerUnicode', 26 | 'StripCommentsFilter', 27 | 'StripWhitespaceFilter', 28 | 'SpacesAroundOperatorsFilter', 29 | 30 | 'OutputPHPFilter', 31 | 'OutputPythonFilter', 32 | 33 | 'KeywordCaseFilter', 34 | 'IdentifierCaseFilter', 35 | 'TruncateStringFilter', 36 | 37 | 'ReindentFilter', 38 | 'RightMarginFilter', 39 | 'AlignedIndentFilter', 40 | ] 41 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse/filters/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse.filters.others import SerializerUnicode 9 | from sqlparse.filters.others import StripCommentsFilter 10 | from sqlparse.filters.others import StripWhitespaceFilter 11 | from sqlparse.filters.others import SpacesAroundOperatorsFilter 12 | 13 | from sqlparse.filters.output import OutputPHPFilter 14 | from sqlparse.filters.output import OutputPythonFilter 15 | 16 | from sqlparse.filters.tokens import KeywordCaseFilter 17 | from sqlparse.filters.tokens import IdentifierCaseFilter 18 | from sqlparse.filters.tokens import TruncateStringFilter 19 | 20 | from sqlparse.filters.reindent import ReindentFilter 21 | from sqlparse.filters.right_margin import RightMarginFilter 22 | from sqlparse.filters.aligned_indent import AlignedIndentFilter 23 | 24 | __all__ = [ 25 | 'SerializerUnicode', 26 | 'StripCommentsFilter', 27 | 'StripWhitespaceFilter', 28 | 'SpacesAroundOperatorsFilter', 29 | 30 | 'OutputPHPFilter', 31 | 'OutputPythonFilter', 32 | 33 | 'KeywordCaseFilter', 34 | 'IdentifierCaseFilter', 35 | 'TruncateStringFilter', 36 | 37 | 'ReindentFilter', 38 | 'RightMarginFilter', 39 | 'AlignedIndentFilter', 40 | ] 41 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/helper.py: -------------------------------------------------------------------------------- 1 | import os 2 | import boto3 3 | import argparse 4 | 5 | 6 | def change_case(str): 7 | res = [str[0]] 8 | for c in str[1:]: 9 | if c in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): 10 | res.append('_') 11 | res.append(c) 12 | elif c in ('123456789'): 13 | res.append('_') 14 | res.append(c) 15 | else: 16 | res.append(c.upper()) 17 | 18 | return ''.join(res) 19 | 20 | 21 | parser = argparse.ArgumentParser(description="Generate commands to set and unset environment variables") 22 | parser.add_argument('--unset', action='store_true', help="Generate commands to unset environment variables by setting this flag") 23 | 24 | args = parser.parse_args() 25 | 26 | os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_REGION') 27 | 28 | cfn = boto3.client('cloudformation') 29 | stackname = os.path.basename(os.getcwd()).lower() 30 | response = cfn.describe_stacks(StackName=stackname) 31 | unsets = [] 32 | sets = [] 33 | 34 | outputs = response["Stacks"][0]["Outputs"] 35 | print("Copy and paste the commands below into your terminal") 36 | print("") 37 | for output in outputs: 38 | if ', ' in output["OutputValue"]: 39 | sets.append(change_case(output["OutputKey"]) + "='" + ', '.join('"{}"'.format(word) for word in output["OutputValue"].split(", ")) + "'") 40 | else: 41 | sets.append(change_case(output["OutputKey"]) + "='" + output["OutputValue"] + "'") 42 | unsets.append("unset " + change_case(output["OutputKey"])) 43 | 44 | if (args.unset): 45 | print('\n'.join(map(str, unsets))) 46 | else: 47 | print('\n'.join(map(str, sets))) 48 | 49 | print("") 50 | -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/helper.py: -------------------------------------------------------------------------------- 1 | import os 2 | import boto3 3 | import argparse 4 | 5 | 6 | def change_case(str): 7 | res = [str[0]] 8 | for c in str[1:]: 9 | if c in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): 10 | res.append('_') 11 | res.append(c) 12 | elif c in ('123456789'): 13 | res.append('_') 14 | res.append(c) 15 | else: 16 | res.append(c.upper()) 17 | 18 | return ''.join(res) 19 | 20 | 21 | parser = argparse.ArgumentParser(description="Generate commands to set and unset environment variables") 22 | parser.add_argument('--unset', action='store_true', help="Generate commands to unset environment variables by setting this flag") 23 | 24 | args = parser.parse_args() 25 | 26 | os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_REGION') 27 | 28 | cfn = boto3.client('cloudformation') 29 | stackname = os.path.basename(os.getcwd()).lower() 30 | response = cfn.describe_stacks(StackName=stackname) 31 | unsets = [] 32 | sets = [] 33 | 34 | outputs = response["Stacks"][0]["Outputs"] 35 | print("Copy and paste the commands below into your terminal") 36 | print("") 37 | for output in outputs: 38 | if ', ' in output["OutputValue"]: 39 | sets.append(change_case(output["OutputKey"]) + "='" + ', '.join('"{}"'.format(word) for word in output["OutputValue"].split(", ")) + "'") 40 | else: 41 | sets.append(change_case(output["OutputKey"]) + "='" + output["OutputValue"] + "'") 42 | unsets.append("unset " + change_case(output["OutputKey"])) 43 | 44 | if (args.unset): 45 | print('\n'.join(map(str, unsets))) 46 | else: 47 | print('\n'.join(map(str, sets))) 48 | 49 | print("") 50 | -------------------------------------------------------------------------------- /402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/helper.py: -------------------------------------------------------------------------------- 1 | import os 2 | import boto3 3 | import argparse 4 | 5 | 6 | def change_case(str): 7 | res = [str[0]] 8 | for c in str[1:]: 9 | if c in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): 10 | res.append('_') 11 | res.append(c) 12 | elif c in ('123456789'): 13 | res.append('_') 14 | res.append(c) 15 | else: 16 | res.append(c.upper()) 17 | 18 | return ''.join(res) 19 | 20 | 21 | parser = argparse.ArgumentParser(description="Generate commands to set and unset environment variables") 22 | parser.add_argument('--unset', action='store_true', help="Generate commands to unset environment variables by setting this flag") 23 | 24 | args = parser.parse_args() 25 | 26 | os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_REGION') 27 | 28 | cfn = boto3.client('cloudformation') 29 | stackname = os.path.basename(os.getcwd()).lower() 30 | response = cfn.describe_stacks(StackName=stackname) 31 | unsets = [] 32 | sets = [] 33 | 34 | outputs = response["Stacks"][0]["Outputs"] 35 | print("Copy and paste the commands below into your terminal") 36 | print("") 37 | for output in outputs: 38 | if ', ' in output["OutputValue"]: 39 | sets.append(change_case(output["OutputKey"]) + "='" + ', '.join('"{}"'.format(word) for word in output["OutputValue"].split(", ")) + "'") 40 | else: 41 | sets.append(change_case(output["OutputKey"]) + "='" + output["OutputValue"] + "'") 42 | unsets.append("unset " + change_case(output["OutputKey"])) 43 | 44 | if (args.unset): 45 | print('\n'.join(map(str, unsets))) 46 | else: 47 | print('\n'.join(map(str, sets))) 48 | 49 | print("") 50 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/helper.py: -------------------------------------------------------------------------------- 1 | import os 2 | import boto3 3 | import argparse 4 | 5 | 6 | def change_case(str): 7 | res = [str[0]] 8 | for c in str[1:]: 9 | if c in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): 10 | res.append('_') 11 | res.append(c) 12 | elif c in ('123456789'): 13 | res.append('_') 14 | res.append(c) 15 | else: 16 | res.append(c.upper()) 17 | 18 | return ''.join(res) 19 | 20 | 21 | parser = argparse.ArgumentParser(description="Generate commands to set and unset environment variables") 22 | parser.add_argument('--unset', action='store_true', help="Generate commands to unset environment variables by setting this flag") 23 | 24 | args = parser.parse_args() 25 | 26 | os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_REGION') 27 | 28 | cfn = boto3.client('cloudformation') 29 | stackname = os.path.basename(os.getcwd()).lower() 30 | response = cfn.describe_stacks(StackName=stackname) 31 | unsets = [] 32 | sets = [] 33 | 34 | outputs = response["Stacks"][0]["Outputs"] 35 | print("Copy and paste the commands below into your terminal") 36 | print("") 37 | for output in outputs: 38 | if ', ' in output["OutputValue"]: 39 | sets.append(change_case(output["OutputKey"]) + "='" + ', '.join('"{}"'.format(word) for word in output["OutputValue"].split(", ")) + "'") 40 | else: 41 | sets.append(change_case(output["OutputKey"]) + "='" + output["OutputValue"] + "'") 42 | unsets.append("unset " + change_case(output["OutputKey"])) 43 | 44 | if (args.unset): 45 | print('\n'.join(map(str, unsets))) 46 | else: 47 | print('\n'.join(map(str, sets))) 48 | 49 | print("") 50 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/helper.py: -------------------------------------------------------------------------------- 1 | import os 2 | import boto3 3 | import argparse 4 | 5 | 6 | def change_case(str): 7 | res = [str[0]] 8 | for c in str[1:]: 9 | if c in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): 10 | res.append('_') 11 | res.append(c) 12 | elif c in ('123456789'): 13 | res.append('_') 14 | res.append(c) 15 | else: 16 | res.append(c.upper()) 17 | 18 | return ''.join(res) 19 | 20 | 21 | parser = argparse.ArgumentParser(description="Generate commands to set and unset environment variables") 22 | parser.add_argument('--unset', action='store_true', help="Generate commands to unset environment variables by setting this flag") 23 | 24 | args = parser.parse_args() 25 | 26 | os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_REGION') 27 | 28 | cfn = boto3.client('cloudformation') 29 | stackname = os.path.basename(os.getcwd()).lower() 30 | response = cfn.describe_stacks(StackName=stackname) 31 | unsets = [] 32 | sets = [] 33 | 34 | outputs = response["Stacks"][0]["Outputs"] 35 | print("Copy and paste the commands below into your terminal") 36 | print("") 37 | for output in outputs: 38 | if ', ' in output["OutputValue"]: 39 | sets.append(change_case(output["OutputKey"]) + "='" + ', '.join('"{}"'.format(word) for word in output["OutputValue"].split(", ")) + "'") 40 | else: 41 | sets.append(change_case(output["OutputKey"]) + "='" + output["OutputValue"] + "'") 42 | unsets.append("unset " + change_case(output["OutputKey"])) 43 | 44 | if (args.unset): 45 | print('\n'.join(map(str, unsets))) 46 | else: 47 | print('\n'.join(map(str, sets))) 48 | 49 | print("") 50 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/helper.py: -------------------------------------------------------------------------------- 1 | import os 2 | import boto3 3 | import argparse 4 | 5 | 6 | def change_case(str): 7 | res = [str[0]] 8 | for c in str[1:]: 9 | if c in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): 10 | res.append('_') 11 | res.append(c) 12 | elif c in ('123456789'): 13 | res.append('_') 14 | res.append(c) 15 | else: 16 | res.append(c.upper()) 17 | 18 | return ''.join(res) 19 | 20 | 21 | parser = argparse.ArgumentParser(description="Generate commands to set and unset environment variables") 22 | parser.add_argument('--unset', action='store_true', help="Generate commands to unset environment variables by setting this flag") 23 | 24 | args = parser.parse_args() 25 | 26 | os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_REGION') 27 | 28 | cfn = boto3.client('cloudformation') 29 | stackname = os.path.basename(os.getcwd()).lower() 30 | response = cfn.describe_stacks(StackName=stackname) 31 | unsets = [] 32 | sets = [] 33 | 34 | outputs = response["Stacks"][0]["Outputs"] 35 | print("Copy and paste the commands below into your terminal") 36 | print("") 37 | for output in outputs: 38 | if ', ' in output["OutputValue"]: 39 | sets.append(change_case(output["OutputKey"]) + "='" + ', '.join('"{}"'.format(word) for word in output["OutputValue"].split(", ")) + "'") 40 | else: 41 | sets.append(change_case(output["OutputKey"]) + "='" + output["OutputValue"] + "'") 42 | unsets.append("unset " + change_case(output["OutputKey"])) 43 | 44 | if (args.unset): 45 | print('\n'.join(map(str, unsets))) 46 | else: 47 | print('\n'.join(map(str, sets))) 48 | 49 | print("") 50 | -------------------------------------------------------------------------------- /408-Working-with-Aurora-and-Data-APIs/cdk-AWS-Cookbook-408/helper.py: -------------------------------------------------------------------------------- 1 | import os 2 | import boto3 3 | import argparse 4 | 5 | 6 | def change_case(str): 7 | res = [str[0]] 8 | for c in str[1:]: 9 | if c in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): 10 | res.append('_') 11 | res.append(c) 12 | elif c in ('123456789'): 13 | res.append('_') 14 | res.append(c) 15 | else: 16 | res.append(c.upper()) 17 | 18 | return ''.join(res) 19 | 20 | 21 | parser = argparse.ArgumentParser(description="Generate commands to set and unset environment variables") 22 | parser.add_argument('--unset', action='store_true', help="Generate commands to unset environment variables by setting this flag") 23 | 24 | args = parser.parse_args() 25 | 26 | os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_REGION') 27 | 28 | cfn = boto3.client('cloudformation') 29 | stackname = os.path.basename(os.getcwd()).lower() 30 | response = cfn.describe_stacks(StackName=stackname) 31 | unsets = [] 32 | sets = [] 33 | 34 | outputs = response["Stacks"][0]["Outputs"] 35 | print("Copy and paste the commands below into your terminal") 36 | print("") 37 | for output in outputs: 38 | if ', ' in output["OutputValue"]: 39 | sets.append(change_case(output["OutputKey"]) + "='" + ', '.join('"{}"'.format(word) for word in output["OutputValue"].split(", ")) + "'") 40 | else: 41 | sets.append(change_case(output["OutputKey"]) + "='" + output["OutputValue"] + "'") 42 | unsets.append("unset " + change_case(output["OutputKey"])) 43 | 44 | if (args.unset): 45 | print('\n'.join(map(str, unsets))) 46 | else: 47 | print('\n'.join(map(str, sets))) 48 | 49 | print("") 50 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Andi Albrecht 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of the authors nor the names of its contributors may be 13 | used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Andi Albrecht 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of the authors nor the names of its contributors may be 13 | used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Andi Albrecht 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of the authors nor the names of its contributors may be 13 | used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse-0.4.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Andi Albrecht 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of the authors nor the names of its contributors may be 13 | used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt: -------------------------------------------------------------------------------- 1 | В начале июля, в чрезвычайно жаркое время, под вечер, один молодой человек вышел из своей каморки, которую нанимал от жильцов в С -- м переулке, на улицу и медленно, как бы в нерешимости, отправился к К -- ну мосту. 2 | Он благополучно избегнул встречи с своею хозяйкой на лестнице. Каморка его приходилась под самою кровлей высокого пятиэтажного дома и походила более на шкаф, чем на квартиру. Квартирная же хозяйка его, у которой он нанимал эту каморку с обедом и прислугой, помещалась одною лестницей ниже, в отдельной квартире, и каждый раз, при выходе на улицу, ему непременно надо было проходить мимо хозяйкиной кухни, почти всегда настежь отворенной на лестницу. И каждый раз молодой человек, проходя мимо, чувствовал какое-то болезненное и трусливое ощущение, которого стыдился и от которого морщился. Он был должен кругом хозяйке и боялся с нею встретиться. 3 | Не то чтоб он был так труслив и забит, совсем даже напротив; но с некоторого времени он был в раздражительном и напряженном состоянии, похожем на ипохондрию. Он до того углубился в себя и уединился от всех, что боялся даже всякой встречи, не только встречи с хозяйкой. Он был задавлен бедностью; но даже стесненное положение перестало в последнее время тяготить его. Насущными делами своими он совсем перестал и не хотел заниматься. Никакой хозяйки, в сущности, он не боялся, что бы та ни замышляла против него. Но останавливаться на лестнице, слушать всякий вздор про всю эту обыденную дребедень, до которой ему нет никакого дела, все эти приставания о платеже, угрозы, жалобы, и при этом самому изворачиваться, извиняться, лгать, -- нет уж, лучше проскользнуть как-нибудь кошкой по лестнице и улизнуть, чтобы никто не видал. 4 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt: -------------------------------------------------------------------------------- 1 | В начале июля, в чрезвычайно жаркое время, под вечер, один молодой человек вышел из своей каморки, которую нанимал от жильцов в С -- м переулке, на улицу и медленно, как бы в нерешимости, отправился к К -- ну мосту. 2 | Он благополучно избегнул встречи с своею хозяйкой на лестнице. Каморка его приходилась под самою кровлей высокого пятиэтажного дома и походила более на шкаф, чем на квартиру. Квартирная же хозяйка его, у которой он нанимал эту каморку с обедом и прислугой, помещалась одною лестницей ниже, в отдельной квартире, и каждый раз, при выходе на улицу, ему непременно надо было проходить мимо хозяйкиной кухни, почти всегда настежь отворенной на лестницу. И каждый раз молодой человек, проходя мимо, чувствовал какое-то болезненное и трусливое ощущение, которого стыдился и от которого морщился. Он был должен кругом хозяйке и боялся с нею встретиться. 3 | Не то чтоб он был так труслив и забит, совсем даже напротив; но с некоторого времени он был в раздражительном и напряженном состоянии, похожем на ипохондрию. Он до того углубился в себя и уединился от всех, что боялся даже всякой встречи, не только встречи с хозяйкой. Он был задавлен бедностью; но даже стесненное положение перестало в последнее время тяготить его. Насущными делами своими он совсем перестал и не хотел заниматься. Никакой хозяйки, в сущности, он не боялся, что бы та ни замышляла против него. Но останавливаться на лестнице, слушать всякий вздор про всю эту обыденную дребедень, до которой ему нет никакого дела, все эти приставания о платеже, угрозы, жалобы, и при этом самому изворачиваться, извиняться, лгать, -- нет уж, лучше проскользнуть как-нибудь кошкой по лестнице и улизнуть, чтобы никто не видал. 4 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt: -------------------------------------------------------------------------------- 1 | В начале июля, в чрезвычайно жаркое время, под вечер, один молодой человек вышел из своей каморки, которую нанимал от жильцов в С -- м переулке, на улицу и медленно, как бы в нерешимости, отправился к К -- ну мосту. 2 | Он благополучно избегнул встречи с своею хозяйкой на лестнице. Каморка его приходилась под самою кровлей высокого пятиэтажного дома и походила более на шкаф, чем на квартиру. Квартирная же хозяйка его, у которой он нанимал эту каморку с обедом и прислугой, помещалась одною лестницей ниже, в отдельной квартире, и каждый раз, при выходе на улицу, ему непременно надо было проходить мимо хозяйкиной кухни, почти всегда настежь отворенной на лестницу. И каждый раз молодой человек, проходя мимо, чувствовал какое-то болезненное и трусливое ощущение, которого стыдился и от которого морщился. Он был должен кругом хозяйке и боялся с нею встретиться. 3 | Не то чтоб он был так труслив и забит, совсем даже напротив; но с некоторого времени он был в раздражительном и напряженном состоянии, похожем на ипохондрию. Он до того углубился в себя и уединился от всех, что боялся даже всякой встречи, не только встречи с хозяйкой. Он был задавлен бедностью; но даже стесненное положение перестало в последнее время тяготить его. Насущными делами своими он совсем перестал и не хотел заниматься. Никакой хозяйки, в сущности, он не боялся, что бы та ни замышляла против него. Но останавливаться на лестнице, слушать всякий вздор про всю эту обыденную дребедень, до которой ему нет никакого дела, все эти приставания о платеже, угрозы, жалобы, и при этом самому изворачиваться, извиняться, лгать, -- нет уж, лучше проскользнуть как-нибудь кошкой по лестнице и улизнуть, чтобы никто не видал. 4 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/smart_open/python/smart_open/tests/test_data/crime-and-punishment.txt: -------------------------------------------------------------------------------- 1 | В начале июля, в чрезвычайно жаркое время, под вечер, один молодой человек вышел из своей каморки, которую нанимал от жильцов в С -- м переулке, на улицу и медленно, как бы в нерешимости, отправился к К -- ну мосту. 2 | Он благополучно избегнул встречи с своею хозяйкой на лестнице. Каморка его приходилась под самою кровлей высокого пятиэтажного дома и походила более на шкаф, чем на квартиру. Квартирная же хозяйка его, у которой он нанимал эту каморку с обедом и прислугой, помещалась одною лестницей ниже, в отдельной квартире, и каждый раз, при выходе на улицу, ему непременно надо было проходить мимо хозяйкиной кухни, почти всегда настежь отворенной на лестницу. И каждый раз молодой человек, проходя мимо, чувствовал какое-то болезненное и трусливое ощущение, которого стыдился и от которого морщился. Он был должен кругом хозяйке и боялся с нею встретиться. 3 | Не то чтоб он был так труслив и забит, совсем даже напротив; но с некоторого времени он был в раздражительном и напряженном состоянии, похожем на ипохондрию. Он до того углубился в себя и уединился от всех, что боялся даже всякой встречи, не только встречи с хозяйкой. Он был задавлен бедностью; но даже стесненное положение перестало в последнее время тяготить его. Насущными делами своими он совсем перестал и не хотел заниматься. Никакой хозяйки, в сущности, он не боялся, что бы та ни замышляла против него. Но останавливаться на лестнице, слушать всякий вздор про всю эту обыденную дребедень, до которой ему нет никакого дела, все эти приставания о платеже, угрозы, жалобы, и при этом самому изворачиваться, извиняться, лгать, -- нет уж, лучше проскользнуть как-нибудь кошкой по лестнице и улизнуть, чтобы никто не видал. 4 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse/filters/right_margin.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | import re 9 | 10 | from sqlparse import sql, tokens as T 11 | 12 | 13 | # FIXME: Doesn't work 14 | class RightMarginFilter: 15 | keep_together = ( 16 | # sql.TypeCast, sql.Identifier, sql.Alias, 17 | ) 18 | 19 | def __init__(self, width=79): 20 | self.width = width 21 | self.line = '' 22 | 23 | def _process(self, group, stream): 24 | for token in stream: 25 | if token.is_whitespace and '\n' in token.value: 26 | if token.value.endswith('\n'): 27 | self.line = '' 28 | else: 29 | self.line = token.value.splitlines()[-1] 30 | elif token.is_group and type(token) not in self.keep_together: 31 | token.tokens = self._process(token, token.tokens) 32 | else: 33 | val = str(token) 34 | if len(self.line) + len(val) > self.width: 35 | match = re.search(r'^ +', self.line) 36 | if match is not None: 37 | indent = match.group() 38 | else: 39 | indent = '' 40 | yield sql.Token(T.Whitespace, '\n{}'.format(indent)) 41 | self.line = indent 42 | self.line += val 43 | yield token 44 | 45 | def process(self, group): 46 | # return 47 | # group.tokens = self._process(group, group.tokens) 48 | raise NotImplementedError 49 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse/filters/right_margin.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | import re 9 | 10 | from sqlparse import sql, tokens as T 11 | 12 | 13 | # FIXME: Doesn't work 14 | class RightMarginFilter: 15 | keep_together = ( 16 | # sql.TypeCast, sql.Identifier, sql.Alias, 17 | ) 18 | 19 | def __init__(self, width=79): 20 | self.width = width 21 | self.line = '' 22 | 23 | def _process(self, group, stream): 24 | for token in stream: 25 | if token.is_whitespace and '\n' in token.value: 26 | if token.value.endswith('\n'): 27 | self.line = '' 28 | else: 29 | self.line = token.value.splitlines()[-1] 30 | elif token.is_group and type(token) not in self.keep_together: 31 | token.tokens = self._process(token, token.tokens) 32 | else: 33 | val = str(token) 34 | if len(self.line) + len(val) > self.width: 35 | match = re.search(r'^ +', self.line) 36 | if match is not None: 37 | indent = match.group() 38 | else: 39 | indent = '' 40 | yield sql.Token(T.Whitespace, '\n{}'.format(indent)) 41 | self.line = indent 42 | self.line += val 43 | yield token 44 | 45 | def process(self, group): 46 | # return 47 | # group.tokens = self._process(group, group.tokens) 48 | raise NotImplementedError 49 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse/filters/right_margin.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | import re 9 | 10 | from sqlparse import sql, tokens as T 11 | 12 | 13 | # FIXME: Doesn't work 14 | class RightMarginFilter: 15 | keep_together = ( 16 | # sql.TypeCast, sql.Identifier, sql.Alias, 17 | ) 18 | 19 | def __init__(self, width=79): 20 | self.width = width 21 | self.line = '' 22 | 23 | def _process(self, group, stream): 24 | for token in stream: 25 | if token.is_whitespace and '\n' in token.value: 26 | if token.value.endswith('\n'): 27 | self.line = '' 28 | else: 29 | self.line = token.value.splitlines()[-1] 30 | elif token.is_group and type(token) not in self.keep_together: 31 | token.tokens = self._process(token, token.tokens) 32 | else: 33 | val = str(token) 34 | if len(self.line) + len(val) > self.width: 35 | match = re.search(r'^ +', self.line) 36 | if match is not None: 37 | indent = match.group() 38 | else: 39 | indent = '' 40 | yield sql.Token(T.Whitespace, '\n{}'.format(indent)) 41 | self.line = indent 42 | self.line += val 43 | yield token 44 | 45 | def process(self, group): 46 | # return 47 | # group.tokens = self._process(group, group.tokens) 48 | raise NotImplementedError 49 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse/filters/right_margin.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | import re 9 | 10 | from sqlparse import sql, tokens as T 11 | 12 | 13 | # FIXME: Doesn't work 14 | class RightMarginFilter: 15 | keep_together = ( 16 | # sql.TypeCast, sql.Identifier, sql.Alias, 17 | ) 18 | 19 | def __init__(self, width=79): 20 | self.width = width 21 | self.line = '' 22 | 23 | def _process(self, group, stream): 24 | for token in stream: 25 | if token.is_whitespace and '\n' in token.value: 26 | if token.value.endswith('\n'): 27 | self.line = '' 28 | else: 29 | self.line = token.value.splitlines()[-1] 30 | elif token.is_group and type(token) not in self.keep_together: 31 | token.tokens = self._process(token, token.tokens) 32 | else: 33 | val = str(token) 34 | if len(self.line) + len(val) > self.width: 35 | match = re.search(r'^ +', self.line) 36 | if match is not None: 37 | indent = match.group() 38 | else: 39 | indent = '' 40 | yield sql.Token(T.Whitespace, '\n{}'.format(indent)) 41 | self.line = indent 42 | self.line += val 43 | yield token 44 | 45 | def process(self, group): 46 | # return 47 | # group.tokens = self._process(group, group.tokens) 48 | raise NotImplementedError 49 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/lambda-layers/sqlparse/python/sqlparse/filters/tokens.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse import tokens as T 9 | 10 | 11 | class _CaseFilter: 12 | ttype = None 13 | 14 | def __init__(self, case=None): 15 | case = case or 'upper' 16 | self.convert = getattr(str, case) 17 | 18 | def process(self, stream): 19 | for ttype, value in stream: 20 | if ttype in self.ttype: 21 | value = self.convert(value) 22 | yield ttype, value 23 | 24 | 25 | class KeywordCaseFilter(_CaseFilter): 26 | ttype = T.Keyword 27 | 28 | 29 | class IdentifierCaseFilter(_CaseFilter): 30 | ttype = T.Name, T.String.Symbol 31 | 32 | def process(self, stream): 33 | for ttype, value in stream: 34 | if ttype in self.ttype and value.strip()[0] != '"': 35 | value = self.convert(value) 36 | yield ttype, value 37 | 38 | 39 | class TruncateStringFilter: 40 | def __init__(self, width, char): 41 | self.width = width 42 | self.char = char 43 | 44 | def process(self, stream): 45 | for ttype, value in stream: 46 | if ttype != T.Literal.String.Single: 47 | yield ttype, value 48 | continue 49 | 50 | if value[:2] == "''": 51 | inner = value[2:-2] 52 | quote = "''" 53 | else: 54 | inner = value[1:-1] 55 | quote = "'" 56 | 57 | if len(inner) > self.width: 58 | value = ''.join((quote, inner[:self.width], self.char, quote)) 59 | yield ttype, value 60 | -------------------------------------------------------------------------------- /403-Leveraging-RDS-Proxy-For-Db-Conns/cdk-AWS-Cookbook-403/lambda-layers/sqlparse/python/sqlparse/filters/tokens.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse import tokens as T 9 | 10 | 11 | class _CaseFilter: 12 | ttype = None 13 | 14 | def __init__(self, case=None): 15 | case = case or 'upper' 16 | self.convert = getattr(str, case) 17 | 18 | def process(self, stream): 19 | for ttype, value in stream: 20 | if ttype in self.ttype: 21 | value = self.convert(value) 22 | yield ttype, value 23 | 24 | 25 | class KeywordCaseFilter(_CaseFilter): 26 | ttype = T.Keyword 27 | 28 | 29 | class IdentifierCaseFilter(_CaseFilter): 30 | ttype = T.Name, T.String.Symbol 31 | 32 | def process(self, stream): 33 | for ttype, value in stream: 34 | if ttype in self.ttype and value.strip()[0] != '"': 35 | value = self.convert(value) 36 | yield ttype, value 37 | 38 | 39 | class TruncateStringFilter: 40 | def __init__(self, width, char): 41 | self.width = width 42 | self.char = char 43 | 44 | def process(self, stream): 45 | for ttype, value in stream: 46 | if ttype != T.Literal.String.Single: 47 | yield ttype, value 48 | continue 49 | 50 | if value[:2] == "''": 51 | inner = value[2:-2] 52 | quote = "''" 53 | else: 54 | inner = value[1:-1] 55 | quote = "'" 56 | 57 | if len(inner) > self.width: 58 | value = ''.join((quote, inner[:self.width], self.char, quote)) 59 | yield ttype, value 60 | -------------------------------------------------------------------------------- /405-Rotating-Database-Passwords-in-RDS/cdk-AWS-Cookbook-405/lambda-layers/sqlparse/python/sqlparse/filters/tokens.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse import tokens as T 9 | 10 | 11 | class _CaseFilter: 12 | ttype = None 13 | 14 | def __init__(self, case=None): 15 | case = case or 'upper' 16 | self.convert = getattr(str, case) 17 | 18 | def process(self, stream): 19 | for ttype, value in stream: 20 | if ttype in self.ttype: 21 | value = self.convert(value) 22 | yield ttype, value 23 | 24 | 25 | class KeywordCaseFilter(_CaseFilter): 26 | ttype = T.Keyword 27 | 28 | 29 | class IdentifierCaseFilter(_CaseFilter): 30 | ttype = T.Name, T.String.Symbol 31 | 32 | def process(self, stream): 33 | for ttype, value in stream: 34 | if ttype in self.ttype and value.strip()[0] != '"': 35 | value = self.convert(value) 36 | yield ttype, value 37 | 38 | 39 | class TruncateStringFilter: 40 | def __init__(self, width, char): 41 | self.width = width 42 | self.char = char 43 | 44 | def process(self, stream): 45 | for ttype, value in stream: 46 | if ttype != T.Literal.String.Single: 47 | yield ttype, value 48 | continue 49 | 50 | if value[:2] == "''": 51 | inner = value[2:-2] 52 | quote = "''" 53 | else: 54 | inner = value[1:-1] 55 | quote = "'" 56 | 57 | if len(inner) > self.width: 58 | value = ''.join((quote, inner[:self.width], self.char, quote)) 59 | yield ttype, value 60 | -------------------------------------------------------------------------------- /407-Migrating-Databases-to-Amazon-RDS/cdk-AWS-Cookbook-407/lambda-layers/sqlparse/python/sqlparse/filters/tokens.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2020 the sqlparse authors and contributors 3 | # 4 | # 5 | # This module is part of python-sqlparse and is released under 6 | # the BSD License: https://opensource.org/licenses/BSD-3-Clause 7 | 8 | from sqlparse import tokens as T 9 | 10 | 11 | class _CaseFilter: 12 | ttype = None 13 | 14 | def __init__(self, case=None): 15 | case = case or 'upper' 16 | self.convert = getattr(str, case) 17 | 18 | def process(self, stream): 19 | for ttype, value in stream: 20 | if ttype in self.ttype: 21 | value = self.convert(value) 22 | yield ttype, value 23 | 24 | 25 | class KeywordCaseFilter(_CaseFilter): 26 | ttype = T.Keyword 27 | 28 | 29 | class IdentifierCaseFilter(_CaseFilter): 30 | ttype = T.Name, T.String.Symbol 31 | 32 | def process(self, stream): 33 | for ttype, value in stream: 34 | if ttype in self.ttype and value.strip()[0] != '"': 35 | value = self.convert(value) 36 | yield ttype, value 37 | 38 | 39 | class TruncateStringFilter: 40 | def __init__(self, width, char): 41 | self.width = width 42 | self.char = char 43 | 44 | def process(self, stream): 45 | for ttype, value in stream: 46 | if ttype != T.Literal.String.Single: 47 | yield ttype, value 48 | continue 49 | 50 | if value[:2] == "''": 51 | inner = value[2:-2] 52 | quote = "''" 53 | else: 54 | inner = value[1:-1] 55 | quote = "'" 56 | 57 | if len(inner) > self.width: 58 | value = ''.join((quote, inner[:self.width], self.char, quote)) 59 | yield ttype, value 60 | -------------------------------------------------------------------------------- /404-Encrypt-Existing-RDS-MySQL-DB/cdk-AWS-Cookbook-404/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Welcome to your CDK Python project! 3 | 4 | This is a blank project for Python development with CDK. 5 | 6 | The `cdk.json` file tells the CDK Toolkit how to execute your app. 7 | 8 | This project is set up like a standard Python project. The initialization 9 | process also creates a virtualenv within this project, stored under the `.venv` 10 | directory. To create the virtualenv it assumes that there is a `python3` 11 | (or `python` for Windows) executable in your path with access to the `venv` 12 | package. If for any reason the automatic creation of the virtualenv fails, 13 | you can create the virtualenv manually. 14 | 15 | To manually create a virtualenv on MacOS and Linux: 16 | 17 | ``` 18 | $ python3 -m venv .venv 19 | ``` 20 | 21 | After the init process completes and the virtualenv is created, you can use the following 22 | step to activate your virtualenv. 23 | 24 | ``` 25 | $ source .venv/bin/activate 26 | ``` 27 | 28 | If you are a Windows platform, you would activate the virtualenv like this: 29 | 30 | ``` 31 | % .venv\Scripts\activate.bat 32 | ``` 33 | 34 | Once the virtualenv is activated, you can install the required dependencies. 35 | 36 | ``` 37 | $ pip install -r requirements.txt 38 | ``` 39 | 40 | At this point you can now synthesize the CloudFormation template for this code. 41 | 42 | ``` 43 | $ cdk synth 44 | ``` 45 | 46 | To add additional dependencies, for example other CDK libraries, just add 47 | them to your `setup.py` file and rerun the `pip install -r requirements.txt` 48 | command. 49 | 50 | ## Useful commands 51 | 52 | * `cdk ls` list all stacks in the app 53 | * `cdk synth` emits the synthesized CloudFormation template 54 | * `cdk deploy` deploy this stack to your default AWS account/region 55 | * `cdk diff` compare deployed stack with current state 56 | * `cdk docs` open CDK documentation 57 | 58 | Enjoy! 59 | -------------------------------------------------------------------------------- /401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Welcome to your CDK Python project! 3 | 4 | This is a blank project for Python development with CDK. 5 | 6 | The `cdk.json` file tells the CDK Toolkit how to execute your app. 7 | 8 | This project is set up like a standard Python project. The initialization 9 | process also creates a virtualenv within this project, stored under the `.venv` 10 | directory. To create the virtualenv it assumes that there is a `python3` 11 | (or `python` for Windows) executable in your path with access to the `venv` 12 | package. If for any reason the automatic creation of the virtualenv fails, 13 | you can create the virtualenv manually. 14 | 15 | To manually create a virtualenv on MacOS and Linux: 16 | 17 | ``` 18 | $ python3 -m venv .venv 19 | ``` 20 | 21 | After the init process completes and the virtualenv is created, you can use the following 22 | step to activate your virtualenv. 23 | 24 | ``` 25 | $ source .venv/bin/activate 26 | ``` 27 | 28 | If you are a Windows platform, you would activate the virtualenv like this: 29 | 30 | ``` 31 | % .venv\Scripts\activate.bat 32 | ``` 33 | 34 | Once the virtualenv is activated, you can install the required dependencies. 35 | 36 | ``` 37 | $ pip install -r requirements.txt 38 | ``` 39 | 40 | At this point you can now synthesize the CloudFormation template for this code. 41 | 42 | ``` 43 | $ cdk synth 44 | ``` 45 | 46 | To add additional dependencies, for example other CDK libraries, just add 47 | them to your `setup.py` file and rerun the `pip install -r requirements.txt` 48 | command. 49 | 50 | ## Useful commands 51 | 52 | * `cdk ls` list all stacks in the app 53 | * `cdk synth` emits the synthesized CloudFormation template 54 | * `cdk deploy` deploy this stack to your default AWS account/region 55 | * `cdk diff` compare deployed stack with current state 56 | * `cdk docs` open CDK documentation 57 | 58 | Enjoy! 59 | --------------------------------------------------------------------------------