Skip to content

Commit 63182fd

Browse files
author
Carlos J. Ramirez
committed
Add: "run_mongo_docker.sh" runs "generate_dynamodb_cf.sh create_tables dev" to create the DynamoDB tables in the local Docker container [GS-102].
1 parent 4f005c0 commit 63182fd

File tree

3 files changed

+44
-22
lines changed

3 files changed

+44
-22
lines changed

CHANGELOG.md

+19-18
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
2222
---
2323

2424
### New
25-
Add: ".nvmrc" file to set the repo default node version.
26-
Add: GS_LOCAL_ENVIR envvar to detect a local database running in a docker container [GS-102].
27-
Add: DynamoDB database running along with MongoDB in a docker container when running the App in the "dev" stage [GS-102].
28-
Add: DynamoDB docker container to "mongodb_stack_for_test.yml" [GS-102].
29-
Add: local DynamoDB tables generation in "generate_dynamodb_cf.py" [GS-102].
30-
Add: DynamoDB local workbench manager (taydy/dynamodb-manager) to the "mongodb_stack_for_test.yml" [GS-102].
31-
Add: DYNAMDB_PREFIX envvar to the "run_aws.sh" script with the value "${APP_NAME_LOWERCASE}_${STAGE}_" [GS-102].
25+
Add ".nvmrc" file to set the repo default node version.
26+
Add GS_LOCAL_ENVIR envvar to detect a local database running in a docker container [GS-102].
27+
Add DynamoDB database running along with MongoDB in a docker container when running the App in the "dev" stage [GS-102].
28+
Add DynamoDB docker container to "mongodb_stack_for_test.yml" [GS-102].
29+
Add local DynamoDB tables generation in "generate_dynamodb_cf.py" [GS-102].
30+
Add DynamoDB local workbench manager (taydy/dynamodb-manager) to the "mongodb_stack_for_test.yml" [GS-102].
31+
Add DYNAMDB_PREFIX envvar to the "run_aws.sh" script with the value "${APP_NAME_LOWERCASE}_${STAGE}_" [GS-102].
32+
Add "run_mongo_docker.sh" runs "generate_dynamodb_cf.sh create_tables dev" to create the DynamoDB tables in the local Docker container [GS-102].
3233

3334
### Changes
34-
Change: Make DynamoDb tables with prefix work with the GS DB Abstraction [GS-102].
35-
Change: Makefile "mongo_docker" runs the MongoDB and DynamoDB docker containers without calling "make run" by default [GS-102].
35+
Make DynamoDb tables with prefix work with the GS DB Abstraction [GS-102].
36+
Makefile "mongo_docker" runs the MongoDB and DynamoDB docker containers without calling "make run" by default [GS-102].
3637

3738

3839
## 1.0.11 (2024-07-19)
@@ -42,17 +43,17 @@ Change: Makefile "mongo_docker" runs the MongoDB and DynamoDB docker containers
4243
Add EC2+ALB App deployment using AWS CloudFormation (EBS volume encryption postponed) [GS-96].
4344
Add password and API Keys to AWS Secrets using AWS CloudFormation [GS-41].
4445
Add DynamoDB tables creation from the JSON configs using AWS CloudFormation [GS-84].
45-
Add: "scripts/aws_dynamodb/generate_dynamodb_cf/generate_dynamodb_cf.py" and its ".sh" to generate the "cf-template-dynamodb.yml" file in the project's scripts directory [GS-84].
46-
Add: "scripts/aws_dynamodb/run-dynamodb-deploy.sh" to deploy generated "cf-template-dynamodb.yml" [GS-84].
47-
Add: GET_SECRETS_CRITICAL and GET_SECRETS_CRITICAL envvars to fine-grained disabling of cloud secrets manager for critical secrets and plain envvars [GS-41].
46+
Add "scripts/aws_dynamodb/generate_dynamodb_cf/generate_dynamodb_cf.py" and its ".sh" to generate the "cf-template-dynamodb.yml" file in the project's scripts directory [GS-84].
47+
Add "scripts/aws_dynamodb/run-dynamodb-deploy.sh" to deploy generated "cf-template-dynamodb.yml" [GS-84].
48+
Add GET_SECRETS_CRITICAL and GET_SECRETS_CRITICAL envvars to fine-grained disabling of cloud secrets manager for critical secrets and plain envvars [GS-41].
4849
Add aws_secrets to Makefile to deploy envvars to the AWS Secrets manager [GS-41].
4950
Add depLoy_ec2 to Makefile [GS-96].
5051
Add deploy_ecr_creation to Makefile to build the FastAPI docker image [GS-96].
5152
Add: generate_cf_dynamodb and deploy_dynamodb to Makefile [GS-84].
5253
Add "scripts/aws_cf_processor/run-cf-deployment.sh" to standarize all Cloudformation calls [GS-96].
53-
Add: "run-cf-deployment.sh" enhanced to simulate the EC2 + ALB in AWS LocalStack [GS-97].
54-
Add: Secret and KMS access policies to the "template-sam.yml" file [GS-41].
55-
Add: "scripts/aws_cf_processor/test_localstack.sh" to test localstack EC2 functionality with the LOCALSTACK_AUTH_TOKEN envvar [GS-97].
54+
Add "run-cf-deployment.sh" enhanced to simulate the EC2 + ALB in AWS LocalStack [GS-97].
55+
Add Secret and KMS access policies to the "template-sam.yml" file [GS-41].
56+
Add "scripts/aws_cf_processor/test_localstack.sh" to test localstack EC2 functionality with the LOCALSTACK_AUTH_TOKEN envvar [GS-97].
5657
Add LOCAL_DNS_DISABLED and BRIDGE_PROXY_DISABLED envvars to disable local services working on the road.
5758
Add NGROK_ENABLED envvar to enable/disable Ngrok service in the URL_MASK_EXTERNAL_HOSTNAME and DEV_MASK_EXT_HOSTNAME assignments on "scripts/get_domain_name_dev.sh".
5859

@@ -67,9 +68,9 @@ Check the CLOUD_PROVIDER variable in big_lambdas_manager.sh and avoid execution
6768

6869
### Fixes
6970
Fix 'USER_AGENT environment variable not set...' LangSmith warning message removed in run_aws.sh, big_lambdas_manager.sh, aws_big_lambda/template-sam.yml, and secure_local_server/docker_entrypoint.sh.
70-
Fix: issue reporting the "_placeholder" missing parameter in the SAM template in verify_base_names() of big_lambdas_manager.sh.
71-
Fix: API_GATEWAY_PORT report in pre-process summary in big_lambdas_manager.sh.
72-
Fix: replace the fixed "us-east-1" region by $AWS_REGION on the AWS_DOCKER_IMAGE_URI_BASE assignment in big_lambdas_manager.sh.
71+
Fix issue reporting the "_placeholder" missing parameter in the SAM template in verify_base_names() of big_lambdas_manager.sh.
72+
Fix API_GATEWAY_PORT report in pre-process summary in big_lambdas_manager.sh.
73+
Fix replace the fixed "us-east-1" region by $AWS_REGION on the AWS_DOCKER_IMAGE_URI_BASE assignment in big_lambdas_manager.sh.
7374

7475

7576
## 1.0.10 (2024-06-07)

Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ aws_secrets:
231231

232232
## Application Specific Commands
233233

234-
# run: config_qa clean_logs
235-
run: config_local clean_logs mongo_docker
234+
run: config_local clean_logs
235+
sh node_modules/genericsuite-be-scripts/scripts/mongo/run_mongo_docker.sh run "0" dev
236236
sh node_modules/genericsuite-be-scripts/scripts/aws/run_aws.sh run_local
237237

238238
run_qa: config_qa clean_logs
@@ -246,8 +246,6 @@ restart_qa: config_qa clean_logs
246246
sh node_modules/genericsuite-be-scripts/scripts/aws/run_aws.sh run_local qa
247247

248248
run_local_docker: run
249-
# run_local_docker: config_local clean_logs
250-
# sh node_modules/genericsuite-be-scripts/scripts/aws/run_aws.sh run_local dev
251249

252250
run_prod: config clean_logs
253251
sh node_modules/genericsuite-be-scripts/scripts/aws/run_aws.sh run

scripts/mongo/run_mongo_docker.sh

+23
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ if [ "${RUN_LOCAL_APP}" = "" ]; then
2424
RUN_LOCAL_APP="0"
2525
fi
2626
#
27+
if [ "${STAGE}" = "" ]; then
28+
STAGE="$3"
29+
fi
30+
#
31+
echo ""
32+
echo "ACTION: ${ACTION}"
33+
echo "RUN_LOCAL_APP: ${RUN_LOCAL_APP}"
34+
echo "STAGE: ${STAGE}"
35+
#
2736
if cd "${REPO_BASEDIR}"
2837
then
2938
# REPO_BASEDIR="`pwd`" ;
@@ -77,6 +86,20 @@ if [ "${ACTION}" == "" ] || [ "${ACTION}" == "up" ] || [ "${ACTION}" == "run" ];
7786
fi
7887
fi
7988
#
89+
if [ "${ERROR}" == "" ]; then
90+
if [ "${STAGE}" == "dev" ]; then
91+
if [ "${APP_DB_ENGINE_DEV}" == "DYNAMO_DB" ]; then
92+
echo ""
93+
echo "Creating DynamoDB tables on the Dev environment..."
94+
echo ""
95+
if ! sh ${SCRIPTS_DIR}/../aws_dynamodb/generate_dynamodb_cf/generate_dynamodb_cf.sh create_tables dev
96+
then
97+
ERROR="ERROR: running 'sh ${SCRIPTS_DIR}/../aws_dynamodb/generate_dynamodb_cf/generate_dynamodb_cf.sh create_tables dev'"
98+
fi
99+
fi
100+
fi
101+
fi
102+
#
80103
if [ "${ERROR}" == "" ]; then
81104
echo ""
82105
echo "Please remember to perform the 'supad-create'"

0 commit comments

Comments
 (0)