|
1 |
| -# terraform-module-template |
| 1 | +# terraform-datadog-users |
2 | 2 |
|
3 |
| -[](https://github.com/masterpointio/terraform-module-template/releases/latest) |
| 3 | +[](https://github.com/masterpointio/terraform-datadog-users/releases/latest) |
4 | 4 |
|
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 |
6 | 12 |
|
7 | 13 | ## Usage
|
8 | 14 |
|
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 | +``` |
10 | 52 |
|
11 | 53 | <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|
12 | 54 |
|
13 | 55 | ## Requirements
|
14 | 56 |
|
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 | |
16 | 61 |
|
17 | 62 | ## Providers
|
18 | 63 |
|
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 | |
20 | 80 |
|
21 | 81 | ## Inputs
|
22 | 82 |
|
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 | |
24 | 86 |
|
25 | 87 | ## Outputs
|
26 | 88 |
|
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. | |
28 | 92 |
|
29 | 93 | <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|
30 | 94 |
|
|
0 commit comments