Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/miquido/terraform-ecs-grafana


https://github.com/miquido/terraform-ecs-grafana

Last synced: 20 days ago
JSON representation

Awesome Lists containing this project

README

        

[![Miquido][logo]](https://www.miquido.com/)

# miquido-terraform-ecs-grafana
Grafana app deployed into ECS cluster
---
**Terraform Module**

GitLab Repository: https://gitlab.com/miquido/terraform/terraform-ecs-grafana

## Usage

```hcl
module "grafana" {
source = "../../"
aws_region = "eu-west-1" // var.aws_region
ecs_cluster = { // aws_ecs_cluster.main
arn = "arn::test::test"
name = "main"
}
project = "example" // var.project
vpc = { // module.vpc
vpc_main_security_group_id = "test_id"
vpc_id = "test_id"
private_subnet_ids = ["test_id"]
vpc_main_security_group_id = "test_id"
}
environment = "stage" // var.environment
efs_id = "test" // aws_efs_file_system.efs.id

/*********** Optional app mesh ************/
aws_service_discovery_private_dns_namespace = { // aws_service_discovery_private_dns_namespace.map
name = "test"
id = "test"
hosted_zone = "test"
}
aws_appmesh_mesh_id = "test" // aws_appmesh_mesh.service.id
mesh_route53_zone_id = "test" // aws_route53_zone.mesh_private_zone.zone_id

/*********** Optional alb ************/
route53_zone_id = "test" //aws_route53_zone.default.zone_id
alb = { // module.alb
http_listener_arn = "test"
https_listener_arn = "test"
alb_arn_suffix = "test"
alb_dns_name = "test"
alb_zone_id = "test"
}
domain = local.grafana_service_domain

/*********** Optional cognito auth ************/
app_auth_domain = "auth.example.com"
aws_cognito_user_pool_client = { // aws_cognito_user_pool_client.client
id = "test"
client_secret = "test"
}
aws_cognito_allow_signup = true
}
```

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.13 |
| [aws](#requirement\_aws) | ~> 4.7 |

## Providers

| Name | Version |
|------|---------|
| [aws](#provider\_aws) | ~> 4.7 |
| [random](#provider\_random) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| [alb-ingress-grafana](#module\_alb-ingress-grafana) | git::ssh://[email protected]/miquido/terraform/terraform-alb-ingress.git | 3.1.21 |
| [ecs-alb-task-grafana](#module\_ecs-alb-task-grafana) | git::ssh://[email protected]/miquido/terraform/terraform-ecs-alb-task.git | 5.6.31 |

## Resources

| Name | Type |
|------|------|
| [aws_efs_access_point.grafana](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/efs_access_point) | resource |
| [aws_route53_record.grafana](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_record.grafana-ipv6](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_ssm_parameter.grafana_admin_password](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |
| [random_password.grafana_admin](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [alb](#input\_alb) | Alb module from ssh://[email protected]/miquido/terraform/terraform-alb.git |

object({
http_listener_arn = string
https_listener_arn = string
alb_arn_suffix = string
alb_dns_name = string
alb_zone_id = string
})
| `null` | no |
| [app\_auth\_domain](#input\_app\_auth\_domain) | auth domain for aws cognito | `string` | `null` | no |
| [app\_mesh\_aws\_service\_discovery\_private\_dns\_namespace](#input\_app\_mesh\_aws\_service\_discovery\_private\_dns\_namespace) | app mesh private DNS namespace |
object({
name = string
id = string
hosted_zone = string
})
| `null` | no |
| [app\_mesh\_id](#input\_app\_mesh\_id) | app mesh id to create service entry | `string` | `null` | no |
| [app\_mesh\_route53\_zone](#input\_app\_mesh\_route53\_zone) | app\_mesh route zone to create service entry |
object({
id = string
name = string
})
| `null` | no |
| [aws\_cognito\_allow\_signup](#input\_aws\_cognito\_allow\_signup) | Should cognito users be able to signup into grafana | `bool` | `true` | no |
| [aws\_cognito\_user\_pool\_client](#input\_aws\_cognito\_user\_pool\_client) | aws cognito user pool client |
object({
id = string
client_secret = string
})
| `null` | no |
| [aws\_region](#input\_aws\_region) | Default AWS Region | `string` | n/a | yes |
| [aws\_service\_discovery\_private\_dns\_namespace](#input\_aws\_service\_discovery\_private\_dns\_namespace) | n/a |
object({
name = string
id = string
hosted_zone = string
})
| `null` | no |
| [domain](#input\_domain) | domain under which grafana will be available. Required when alb is used | `string` | `null` | no |
| [ecs\_cluster](#input\_ecs\_cluster) | resource aws\_ecs\_cluster where to deploy service |
object({
arn = string
name = string
})
| n/a | yes |
| [efs\_id](#input\_efs\_id) | n/a | `string` | n/a | yes |
| [enable\_app\_mesh](#input\_enable\_app\_mesh) | Should appmesh resources be created. Required vars: aws\_service\_discovery\_private\_dns\_namespace, aws\_appmesh\_mesh\_id, mesh\_route53\_zone\_id | `bool` | `true` | no |
| [environment](#input\_environment) | Environment name | `any` | n/a | yes |
| [ingress\_priority](#input\_ingress\_priority) | The priority for the rules without authentication, between 1 and 50000 (1 being highest priority). Must be different from `authenticated_priority` since a listener can't have multiple rules with the same priority | `number` | `88` | no |
| [project](#input\_project) | Account/Project Name | `string` | n/a | yes |
| [route53\_zone\_id](#input\_route53\_zone\_id) | route id to create grafana entry | `string` | `null` | no |
| [service\_name](#input\_service\_name) | Name under which service will be deployed | `string` | `"grafana"` | no |
| [tags](#input\_tags) | Default tags to apply on all created resources | `map(string)` | `{}` | no |
| [task\_cpu](#input\_task\_cpu) | ECS task cpu for grafana | `number` | `256` | no |
| [task\_memory](#input\_task\_memory) | ECS task memory for grafana | `number` | `512` | no |
| [vpc](#input\_vpc) | VPC module ssh://[email protected]/miquido/terraform/terraform-vpc.git |
object({
vpc_main_security_group_id = string
vpc_id = string
private_subnet_ids = list(string)
vpc_main_security_group_id = string
})
| n/a | yes |

## Outputs

No outputs.

## Makefile Targets
```text
Available targets:

help Help screen
help/all Display help for all targets
help/short This help short screen
lint Lint Terraform code

```

## Developing

1. Make changes in terraform files

2. Regenerate documentation

```bash
bash <(git archive [email protected]:miquido/terraform/terraform-readme-update.git master update.sh | tar -xO)
```

3. Run lint

```
make lint
```

## Copyright

Copyright © 2017-2022 [Miquido](https://miquido.com)

[logo]: https://www.miquido.com/img/logos/logo__miquido.svg
[website]: https://www.miquido.com/
[gitlab]: https://gitlab.com/miquido
[github]: https://github.com/miquido
[bitbucket]: https://bitbucket.org/miquido