Create an S3 bucket for Terraform state storage.
Workflows:
hrhouz-workflow.yml: This workflow performs the following actions in two stages:
-
Stage 1: Utilizes terraform to create an ECR repository and EC2 instance and all needed network resources.
-
Stage 2: Builds and pushes a Docker image to the newly created ECR repository.
Secrets:
AWS_SECRET_ACCESS_KEY
AWS_ACCESS_KEY_ID
Variables:
AWS_REGION
ECR_REPOSITORY_NAME
Note: To use this workflow, you need to configure the required secrets and variables in your GitHub environment.
SSH into the EC2 instance, create the install.sh and login-run.sh file and make it executable - (You can find them in the repository)
sudo vi install.sh
sudo chmod +x install.sh
and
sudo vi login-run.sh
sudo chmod +x login-run.sh
Run the install.sh file
./install.sh
Exit the instance and login again.
Then run the login-run.sh file
./login-run.sh <ECR_URL> <INSTANCE_IP> <ECR_IMAGE>
Access the parse sever using the IP address on port 4040
INSTANCE_IP:4040
You can destroy the infrastructure created by hrhouz-workflow.yml using the terrafom-destroy.yml.