- Module - 3
- I have been facing a lot of errors when trying to create the dashboard for the RDS database
4.1 - CloudWatch Showcase
Open a new terminal and go back to the terraform folder:
cd ~/project/terraform
Open the main.tf file from the terraform folder. Uncomment the module named monitoring (lines 12 to 19). Save changes to the file.
Then, in the terraform/modules/monitoring folder, open the cloudwatch.tf file and uncomment only the resource "aws_cloudwatch_dashboard" "rds_dashboard" (lines 1 to 94). You can use hotkeys Ctrl+/ or Cmd+/. Save changes to the file.
In this resource, there is a key named dashboard_body; this is where you define the position, size and content of the dashboard elements. Inspect this key, you will find some widgets of text type, like the title of the dashboard, and other widgets of metric type. Between the metrics that you are going to monitor you can find the CPU Utilization, Free Storage Space, Read/Write IOPS and the number of Database Connections in your RDS. Those metrics are shown as an average over a window of 30 seconds. In your terminal, deploy your new resources with the following commands:
terraform init
terraform plan
terraform apply
After, I got the latest version, I tried to apply the terraform commands, but it didn’t work.
2 - Infrastructure deployment using Terraform
The first step in this lab will be setting up the infrastructure using Terraform. In your terminal, run the following command:
source scripts/setup.sh
Change the working directory to the terraform folder:
cd terraform
and then, run the initialization command:
terraform init
Execute the following command to generate the execution plan:
terraform plan
To deploy infrastructure, run the command
terraform apply
When I applied terraform apply, the terminal closed with exit code 1.
Looking forward to hearing from you.
Best,
Van.