Skip to content

Commit 83331e5

Browse files
authoredMar 5, 2024
Merge pull request #1 from masterpointio/feature/init_version
feature: init version
2 parents b3ecf53 + 44bd5f6 commit 83331e5

17 files changed

+244
-306
lines changed
 

‎.trunk/trunk.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cli:
77
plugins:
88
sources:
99
- id: trunk
10-
ref: v1.4.3
10+
ref: v1.4.4
1111
uri: https://github.com/trunk-io/plugins
1212
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
1313
runtimes:
@@ -20,14 +20,15 @@ lint:
2020
# Incompatible with some Terraform features: https://github.com/tenable/terrascan/issues/1331
2121
- terrascan
2222
enabled:
23+
- actionlint@1.6.27
2324
- terraform@1.1.0
24-
- checkov@3.2.26
25+
- checkov@3.2.31
2526
- git-diff-check
2627
- markdownlint@0.39.0
2728
- prettier@3.2.5
2829
- tflint@0.50.3
2930
- trivy@0.49.1
30-
- trufflehog@3.68.2
31+
- trufflehog@3.68.4
3132
- yamllint@1.35.1
3233
actions:
3334
enabled:

‎README.md

+72-8
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,94 @@
1-
# terraform-module-template
1+
# terraform-datadog-users
22

3-
[![Release](https://img.shields.io/github/release/masterpointio/terraform-module-template.svg)](https://github.com/masterpointio/terraform-module-template/releases/latest)
3+
[![Release](https://img.shields.io/github/release/masterpointio/terraform-datadog-users.svg)](https://github.com/masterpointio/terraform-datadog-users/releases/latest)
44

5-
This repository serves as a template for creating Terraform modules, providing a standardized structure and essential files for efficient module development. It's designed to ensure consistency and best practices across Terraform projects.
5+
This Terraform module is designed to create and manage Datadog user accounts.
6+
7+
The users are associated with one of the three [out-of-the-box roles](https://docs.datadoghq.com/account_management/rbac/permissions/):
8+
9+
- Datadog Admin
10+
- Datadog Standard
11+
- Datadog Read Only
612

713
## Usage
814

9-
TODO
15+
```hcl
16+
module "datadog_users" {
17+
source = "masterpointio/datadog/users"
18+
version = "X.X.X"
19+
20+
users = [
21+
{
22+
roles = ["standard"],
23+
email = "jane.smith@example.com",
24+
name = "Jane Smith",
25+
role = "Editor",
26+
username = "janesmith"
27+
}
28+
]
29+
}
30+
```
31+
32+
Check out [examples/complete](examples/complete) for the full example.
33+
34+
To ensure the secure handling of DataDog sensitive data for datadog/datadog provider, the module's example is designed to work with the [SOPS (Secrets OPerationS)](https://github.com/mozilla/sops) provider. SOPS is a tool for encrypting and decrypting files containing sensitive data, often used in conjunction with Terraform to manage secrets. The example also utilizes [terraform-secrets-helper](https://github.com/masterpointio/terraform-secrets-helper/tree/main) module - a helper that provides a standard way of managing secrets from different sources, incuding SOPS files.
35+
36+
❗ We recommend to use AWS KMS, GCP KMS, Azure Key Vault for SOPS files encryption. Don't use the secrets from the example in your real configuration!
37+
38+
Here are some basic SOPS operations that help you to work with the example:
39+
40+
- Pass `age` key to SOPS provider configuration:
41+
42+
```sh
43+
cd ./example/complete
44+
export SOPS_AGE_KEY_FILE=key.txt
45+
```
46+
47+
- Encryption/decryption via SOPS editior
48+
49+
```sh
50+
sops example.yaml
51+
```
1052

1153
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
1254

1355
## Requirements
1456

15-
No requirements.
57+
| Name | Version |
58+
| ------------------------------------------------------------------------ | ------- |
59+
| <a name="requirement_terraform"></a> [terraform](#requirement_terraform) | >= 1.3 |
60+
| <a name="requirement_datadog"></a> [datadog](#requirement_datadog) | >= 3.14 |
1661

1762
## Providers
1863

19-
No provider.
64+
| Name | Version |
65+
| ------------------------------------------------------------ | ------- |
66+
| <a name="provider_datadog"></a> [datadog](#provider_datadog) | >= 3.14 |
67+
68+
## Modules
69+
70+
No modules.
71+
72+
## Resources
73+
74+
| Name | Type |
75+
| --------------------------------------------------------------------------------------------------------------- | ----------- |
76+
| [datadog_user.users](https://registry.terraform.io/providers/datadog/datadog/latest/docs/resources/user) | resource |
77+
| [datadog_role.admin](https://registry.terraform.io/providers/datadog/datadog/latest/docs/data-sources/role) | data source |
78+
| [datadog_role.read_only](https://registry.terraform.io/providers/datadog/datadog/latest/docs/data-sources/role) | data source |
79+
| [datadog_role.standard](https://registry.terraform.io/providers/datadog/datadog/latest/docs/data-sources/role) | data source |
2080

2181
## Inputs
2282

23-
No input.
83+
| Name | Description | Type | Default | Required |
84+
| ------------------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | :------: |
85+
| <a name="input_users"></a> [users](#input_users) | n/a | <pre>list(object({<br> disabled = optional(bool, false)<br> email = string<br> name = string<br> roles = set(string)<br> send_user_invitation = optional(bool, true)<br> username = string<br> }))</pre> | n/a | yes |
2486

2587
## Outputs
2688

27-
No output.
89+
| Name | Description |
90+
| -------------------------------------------------------------------------- | ------------------------------------------------------ |
91+
| <a name="output_datadog_users"></a> [datadog_users](#output_datadog_users) | A map of all Datadog user resources keyed by username. |
2892

2993
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
3094

0 commit comments

Comments
 (0)
Please sign in to comment.