Hosting Kiwi TCMS in our ECS cluster with RDS

FROM kiwitcms/kiwi:latest
COPY --chown=1001 tcms/settings/ /venv/lib64/python3.8/site-packages/tcms/settings/
RUN pip install django_ses
RUN pip install boto3
import os
import boto3
boto_session = boto3.Session()
ssm_client = boto_session.client('ssm')
db_parameter = ssm_client.get_parameter(Name="/kiwi/KIWI_DB_NAME", WithDecryption=True)
username_parameter = ssm_client.get_parameter(Name="/kiwi/KIWI_DB_USER", WithDecryption=True)
password_parameter = ssm_client.get_parameter(Name="/kiwi/KIWI_DB_PASSWORD", WithDecryption=True)
host_parameter = ssm_client.get_parameter(Name="/kiwi/KIWI_DB_HOST", WithDecryption=True)
# Database settings
"default": {
"ENGINE": os.environ.get("KIWI_DB_ENGINE", "django.db.backends.mysql"),
"NAME": db_parameter['Parameter']['Value'],
"USER": username_parameter['Parameter']['Value'],
"PASSWORD": password_parameter['Parameter']['Value'],
"HOST": host_parameter['Parameter']['Value'],
"PORT": 3306,
"OPTIONS": {},
# Email settings
# DEFAULT_FROM_EMAIL must be defined if you want Kiwi TCMS to send emails.
# You also need to configure the email backend. For more information see:
# SERVER_EMAIL is used by the logging backend to send exceptions to ADMINS
EMAIL_BACKEND = 'django_ses.SESBackend'
AWS_SES_REGION_NAME = 'us-west-2'
  1. Change the health-check path to ‘“/static/images/favicon.ico” to fix the health check issue ( this is a small static file from Kiwi/Django, which returns a 200 response).
  2. Add KIWI_DONT_ENFORCE_HTTPS environment variable in ECS task definition, as SSL is handled at the load-balancer itself:
environment: [
{ name : "KIWI_DONT_ENFORCE_HTTPS", value : "true" }

Continuous Delivery and technology enthusiast

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Package Java Projects in Python Tar files

DeveloPassion’s Newsletter — Midweek Links #1

Azure ML Model in Power BI Using R

Functional Safety at the Software and Hardware Levels for the Self Driving Cars

FlutterForce — #Week 63

The Trouble with `has_one`

How to capture Regex group values in Swift

The Local Journey (Collection of Stories and Learnings)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sharath AV

Sharath AV

Continuous Delivery and technology enthusiast

More from Medium

Deploy your app on AWS free

Deploy a flask mongo python app on aws with packer and terraform

How to create a Flask app with nginx in Docker-compose

How to use Elasticsearch for a rapid Auto-Complete on a Flutter Widget (Also featuring Kibana and…