This example builds on the Barebones demo, leveraging a JSON file and an existing AWS data source to visualize key metrics from your AWS Lambda functions.
- Install Terraform if you have not already done so.
- Update the placeholders with your specific values:
- API key and Region in the Provider Settings: Replace
myApiKeyGoesHere
with your actual API key.- Refer to SquaredUp Documentation to obtain your API key.
- AWS datasource ID in the locals block: Replace
config-someIdFromYourAwsDatasource
with your AWS datasource ID. - For
important_lambdas.json
, ensure it lists the Lambda functions you want to monitor.
- API key and Region in the Provider Settings: Replace
- Initialize and apply Terraform:
- Execute
terraform init
to prepare your Terraform environment. - Run
terraform apply
to deploy the configurations. Confirm the actions to proceed.
- Execute
SquaredUp data sources have an ID that starts with config-
followed by a string of characters. To grab this ID, navigate to a workspace where it is configured, select the data source on the left-hand side, and then select the ID from the URL.
The Terraform configuration utilizes the important_lambdas.json
file to dynamically generate dashboards for each specified Lambda function. This approach allows for scalability and easy updates to the monitored Lambda list without altering the core Terraform code:
[
{
"lambdaName": "global-common-api"
},
{
"lambdaName": "global-common-auth"
},
{
"lambdaName": "plugin-amazon-web-services"
}
]
Once Terraform applies your configuration, it creates a dashboard for each Lambda function specified in the JSON file. Each dashboard provides insights into the performance and status of the Lambda functions over the last seven days.
Keep your API keys and datasource IDs secure and avoid exposing them in public repositories.
If issues arise during the initialization or application phases, check your configuration values for accuracy, ensure network connectivity, and refer to the Terraform logs for detailed error information. Including screenshots of common errors here can help in quickly resolving issues.