From c58022ecbed0d67ff91402bdbc0ba492a47e59b3 Mon Sep 17 00:00:00 2001 From: Esteban Serna Date: Mon, 24 Nov 2025 18:12:59 -0500 Subject: [PATCH] Bugfix: mysql imdb files, source db not binding ip and docker --- design-patterns/cloudformation/vscode.yaml | 33 +++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/design-patterns/cloudformation/vscode.yaml b/design-patterns/cloudformation/vscode.yaml index 2c2b237..c86da3e 100644 --- a/design-patterns/cloudformation/vscode.yaml +++ b/design-patterns/cloudformation/vscode.yaml @@ -11,10 +11,6 @@ Parameters: Type: String Description: Location of LADV code ZIP Default: https://amazon-dynamodb-labs.com/assets/workshop.zip - LBEDZIP: - Type: String - Description: Location of LBED code ZIP - Default: https://amazon-dynamodb-labs.com/assets/OpenSearchPipeline.zip DBLatestAmiId: Type: 'AWS::SSM::Parameter::Value' Default: '/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64' @@ -1640,8 +1636,6 @@ Resources: - mkdir -p /tmp - !Sub curl -o /tmp/workshop.zip "${WorkshopZIP}" - !Sub unzip -o /tmp/workshop.zip -d ${VSCodeHomeFolder}/LADV - - !Sub curl -o /tmp/lbed.zip "${LBEDZIP}" - - !Sub unzip -jo /tmp/lbed.zip unzip -jo /tmp/lbed.zip "OpenSearchPipeline/*" -d ${VSCodeHomeFolder}/LBED - rm /tmp/workshop.zip - !Sub echo "${DDBReplicationRole.Arn}" > ${VSCodeHomeFolder}/ddb-replication-role-arn.txt - !Sub chown -R ${VSCodeUser}:${VSCodeUser} ${VSCodeHomeFolder} @@ -1783,10 +1777,10 @@ Resources: UPDATE mysql.user SET host='%' WHERE user='${DbMasterUsername}'; FLUSH PRIVILEGES; " - - echo "Configuring MySQL settings for remote access and performance logging..." + - echo "Creating MySQL configuration file for remote access..." - !Sub | - cat >> /etc/mysql/mysql.conf.d/mysqld.cnf </dev/null || { - echo "Warning: Could not copy TSV files to MySQL secure directory" - # Try alternative approach - load from tmp directory with LOCAL INFILE - mysql -u ${DbMasterUsername} -p"${DbMasterPassword}" -e "SET GLOBAL local_infile=1;" - } + # Copy files to MySQL secure file directory with proper permissions + sudo cp /tmp/imdb-data/*.tsv /var/lib/mysql-files/ + sudo chown mysql:mysql /var/lib/mysql-files/*.tsv + sudo chmod 644 /var/lib/mysql-files/*.tsv - !Sub | # Function to load data with error handling load_imdb_data() { @@ -3029,4 +3030,4 @@ Outputs: Value: !Sub "Username: ${DbMasterUsername}, Password: ${DbMasterPassword}" MySQLInstancePrivateIP: Description: Private IP Address of MySQL instance (use this for JDBC connections from Glue) - Value: !GetAtt DbInstance.PrivateIp + Value: !GetAtt DbInstance.PrivateIp \ No newline at end of file