Skip to content

[DO NOT MERGE] Deployment Branch#4

Open
apradoada wants to merge 11 commits into
mainfrom
deploy-lab-branch
Open

[DO NOT MERGE] Deployment Branch#4
apradoada wants to merge 11 commits into
mainfrom
deploy-lab-branch

Conversation

@apradoada

Copy link
Copy Markdown
Contributor

Created a branch for the deployment Lab with the following revisions:

  • Created a Dockerfile for containerization
  • Updated the way environment variables will be retrieved. Rather than use a single connection string, the environment will hold the pieces of the string and create the connection string on startup. This increases security by ensuring the password for the database is never hard coded. The password is retrieved via the secrets manager.
  • Added an entry point for the Docker file so that it can run flask migrations on the database when the container is built.

@mikellewade mikellewade left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing to build, plus the removed sectioned of the README that can come back.

Comment thread app/__init__.py Outdated


secrets_client = boto3.client('secretsmanager')
secret = secrets_client.get_secret_value(SecretId=os.environ.get('DB_SECRET_ARN'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This created some issues for me since the lab document states for it to be called DATABASE_SECRET_ARN

Comment thread app/__init__.py Outdated
Comment on lines +18 to +25
DB_HOST = os.environ.get('DATABASE_HOST')
DB_PORT = int(os.environ.get('DATABASE_PORT', 5432))
DB_NAME = os.environ.get('DATABASE_NAME')
DB_USER = os.environ.get('DATABASE_USER')


secrets_client = boto3.client('secretsmanager')
secret = secrets_client.get_secret_value(SecretId=os.environ.get('DATABASE_SECRET_ARN'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realizing that none of the tests are passing here. I think it has something to do with the secrets manager code running in the tests. Might want to have some type of conditional set up to where this code doesn't run if we are in a testing environment.

Comment thread README.md
Comment on lines -82 to -87
## Running the SQS Consumer

```bash
python -m app.consumers.consumer
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section can come back since code would have been implemented here.

@mikellewade mikellewade left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just needs the consumer logic section added back to the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants