A wrapper for the official grafana docker image that pulls the secrets / parameters from SSM
1M+
Terraform module which creates a Grafana deployment in a Fargate ECS cluster on AWS.
Currently maintained by these contributors.
MIT License. See LICENSE for full details.
This module assumes that the AWS account this is deployed to has both a Route53 zone set up and a wildcard certificate for that zone so that this can be launched behind SSL
modules/init submodule and run it once (and only once) to create a key for encrypting parameters and generating random credentialsparameters_key_arn output from the last step/*<name_prefix>*/github-auth-enabled (set to true to enable github oauth)/*<name_prefix>*/github-client-id (obtained from github when you register oauth app)/*<name_prefix>*/github-client-secret (obtained from github when you register oauth app)/*<name_prefix>*/github-allowed-organisations (members from this list of github organisations can login)/*<name_prefix>*/admin-user-password (a name for the initial admin user)/*<name_prefix>*/admin-user-name (a password for the initial admin user)To allow Grafana to report on metrics in a different AWS account you will need to create a role in that additional account with the CloudWatchReadyOnlyAccess policy attached and allow the task in the account with Grafana installed to assume that role.
The terraform script below (replace <grafana_aws_account> and <name-prefix>) when run in the additional account will grant the necessary access.
resource "aws_iam_role" "grafana-machine-user" {
name = "machine-user-grafana"
assume_role_policy = "${data.aws_iam_policy_document.grafana-machine-user.json}"
}
data "aws_iam_policy_document" "grafana-machine-user" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
identifiers = [
"arn:aws:iam::<grafana_aws_account>:role/<name-prefix>-task-role",
]
type = "AWS"
}
}
}
resource "aws_iam_role_policy_attachment" "grafana-machine-user" {
role = "${aws_iam_role.grafana-machine-user.name}"
policy_arn = "arn:aws:iam::aws:policy/CloudWatchReadOnlyAccess"
}
Content type
Image
Digest
Size
89.8 MB
Last updated
over 7 years ago
docker pull teliaoss/grafana-aws-env