-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.yaml
92 lines (70 loc) · 2.5 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: terraform-container-datadog
license: custom
github_repo: AdRoll/terraform-container-datadog
related:
- name: terraform-aws-ecs-container-definition
description: Terraform module to generate well-formed JSON documents (container
definitions) that are passed to the aws_ecs_task_definition Terraform resource
url: https://github.com/cloudposse/terraform-aws-ecs-container-definition
description: Terraform module to generate well-formed JSON documents that are passed
to the `aws_ecs_task_definition` Terraform resource as [container definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definitions).
usage: |-
This module is meant to be used as output only, meaning it will be used to create outputs which are consumed as a parameter by Terraform resources or other modules.
For complete examples, see
- [complete](examples/complete)
For a complete example with automated tests, see [examples/complete](examples/complete) with `bats` and `Terratest` for the example [test](test).
```hcl
locals {
# can also be set to terraform.workspace
env = "staging"
container_port = 8080
}
module "datadog_container" {
# this can and should be pinned to a release tag using ?ref=tags/x.y.z
source = "git::https://github.com/AdRoll/terraform-container-datadog.git?ref=main"
dd_tags = "env:${local.env}"
# example dockerlabels
# https://docs.datadoghq.com/integrations/faq/integration-setup-ecs-fargate/?tab=rediswebui
docker_labels = {
# container port has to be manually set
"com.datadoghq.ad.instances" = jsonencode([
{
host = "%%host%%"
port = local.container_port
}
])
# check_names is for integrations
"com.datadoghq.ad.check_names" = jsonencode(
[
"supervisord"
]
)
# usually empty
"com.datadoghq.ad.init_configs" = jsonencode(
[{}]
)
}
}
module "task" {
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.31.0"
name = local.container_name
container_definition_json = jsonencode([
module.datadog_container.json_map,
])
# ...
}
```
To build the `README.md`, use either
`direnv` to load the environment variable and run
```bash
make init
make readme
```
or
```bash
make init
README_TEMPLATE_FILE=docs/README.md.gotmpl make readme
```
include:
- docs/targets.md
- docs/terraform.md