Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nivleshc/5b811d78ff596abaa1a87e713d78b9a6 to your computer and use it in GitHub Desktop.
Save nivleshc/5b811d78ff596abaa1a87e713d78b9a6 to your computer and use it in GitHub Desktop.
Contents of grafana/main.tf from the visualise-network-traffic repository.
# create the Grafana server
resource "aws_instance" "grafana_server" {
ami = var.grafana_server_details["ami_id"]
instance_type = var.grafana_server_details["instance_type"]
key_name = var.grafana_server_details["key_name"]
subnet_id = var.grafana_server_details["subnet_id"]
vpc_security_group_ids = [aws_security_group.grafana_sg.id]
user_data = templatefile("${path.module}/scripts/user-data.tpl.sh", {
admin_username = var.grafana_server_details["admin_username"],
admin_password = var.grafana_server_details["admin_password"]
})
iam_instance_profile = aws_iam_instance_profile.grafana_profile.name
tags = var.grafana_server_details["tags"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment