-
Notifications
You must be signed in to change notification settings - Fork 0
Infrastructure
Name generator is a containerized Python web-server application running on an EC2 instance managed by ECS. It reads input data from an S3 bucket during startup.
All AWS resources are defined in namehash/infra GitHub repository. The most important part of it is the {RootStack}
variable, which is used throughout AWS to differentiate this service deployments. For the rest of this doc, we will assume {RootStack} === prod-name-generator
.
Any changes to the infrastructure should be done by generating a change-set, inspecting it, and only then executing it. Be aware that infrastructure changes might destroy and recreate some resources - this might result in some relationships being broken, e.g. due to hard-coded IP addresses etc.
Docker image resides in ECR at 571094861812.dkr.ecr.us-east-1.amazonaws.com/name-generator
.
A tag should be equal to the name of the {RootStack}
it should be running on.
There is an ECS service defined as ${RootStack}-server
, that is running tasks (at least 1 healthy) based on the NameGenerator
task definition, which includes a docker container with the aforementioned ECR image.
TODO
All logs are gathered in the {RootStack}
log group.
To deploy changes made to the generator, follow these steps.
- Login to AWS ECR in Docker using
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 571094861812.dkr.ecr.us-east-1.amazonaws.com/name-generator
- Build the image and tag it with appropriate tag, e.g.
docker build -t 571094861812.dkr.ecr.us-east-1.amazonaws.com/name-generator:prod-name-generator
- Push it to the ECR
docker push 571094861812.dkr.ecr.us-east-1.amazonaws.com/name-generator:prod-name-generator
- Force ECS service do redeploy image by running
aws ecs update-service --cluster prod-name-generator --service prod-name-generator-server --force-new-deployment