Frontend. Passive mode
Cost was the main requirement for the solution. Static web site is used to provide placeholder during off Net hours since it doesn’t have any purpose other than handling the Net. Amazon S3 static web site allows to handle any amount of traffic and provide millisecond replies for static data. It also makes convenient to handle switchover between active and passive solutions using AWS native toolset.
One of the downsides is that S3 hosted website can only handle http traffic. Modern web browsers do both: http
and https
types of requests whenever you are typing domain name. Solution needs to include AWS CloudFront to cover https
use case and http
-> https
redirect. Cloudfront origin’s provisioning is taking considerable amount of time and generates additional cost.
Web page doesn’t have any group/club names or logos - minimizing number of customization changes required.
Static web page files: index.zip
Should be placed to S3 bucket with proper naming. Public access should be enabled and static web site feature activated.
Frontend. Active mode
Python Flask application.
Wrapped with Docker and Docker compose to simplify troubleshooting and possibly deployment.
Python requirements are described in requirements.txt
Requires credentials.json
file to interact with Google Sheets (for local development). Also file content should be saved to GH Secrets and will be included into deployment archive by GH Actions automation.
Repo contains yaml file for CloudFormation deployment: aws_single_instance_hosting.yaml
. Bucket name which contains application zip file is hardcoded (registrator-app-files
).
deploy.sh
and terminate.sh
files created to speed up deployment troubleshooting. Intentionally has profile name with non-default value.
Requires DNS zone which is hosted in Route53. CloudFormation stack creates r
alias for Public IP address that is associated with EC2 Instance.
For successful CloudFormation deployment 4 parameters need to be setup in Systems Manager - Parameter Store
.
/registrator/DNS_Zone_Name
- will use DNS zone for lookup and modification of records/aliases/registrator/admin_password
- admin password will be replaced on environment deployment stage (in UserData)/registrator/qrz_username
and/registrator/qrz_password
- needed for callsign lookup
Has two identities: admin
and user
. Admin
allows to change Net topic, Net Control station name. User
is a generic credentials to avoid data ingestion bots. Still allows to open check in form within a single URL by adding username and password as an URL parameters.
Outcomes
Single instance allows to serve minimal requirements: 5-10 requests per second. Automated build and scheduled deployment allow to perform environment switch in minutes. Scheduler allows to switch frontend between active and passive modes with DNS record manipulation (will be described in the next post).