Skip to content

Commit

Permalink
[#361] Initialized deployment log in EC2 user data script
Browse files Browse the repository at this point in the history
This commit enhances the infrastructure setup process by incorporating
an initialization step for a deployment log within the EC2 instance's
user data script. This change is aimed at bolstering deployment
traceability and logging mechanisms for the GovTool project. Key aspects
of the update include:

- Deployment Log File Creation: Added commands to create a new log file,
  /var/log/deployment.log, during the initial setup of the EC2 instance.
  This log file is intended to capture and store deployment-related
  events, making it easier to track and diagnose issues that may arise
  during or after the deployment process.
- Log File Ownership Adjustment: The ownership of the newly created
  deployment log file is set to ubuntu:ubuntu, ensuring that the
  application, running under the ubuntu user, has the necessary
  permissions to write deployment events to the file.

This modification directly supports the project's objective to enhance
deployment traceability and operational monitoring by providing a
dedicated mechanism for logging deployment activities, thereby
facilitating better insight into deployment processes and outcomes.
  • Loading branch information
placek committed Mar 6, 2024
1 parent aff4f5a commit c01546d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions infra/terraform/modules/govtool-ec2/user_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ echo \
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin prometheus-node-exporter
sudo usermod -aG docker ubuntu

# initialize deployment log
sudo touch /var/log/deployment.log
sudo chown ubuntu:ubuntu /var/log/deployment.log

0 comments on commit c01546d

Please sign in to comment.