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

https://github.com/masterpointio/terraform-datadog-users

Terraform module to configure and provision Datadog users
https://github.com/masterpointio/terraform-datadog-users

datadog opentofu opentofu-module terraform terraform-module

Last synced: 2 months ago
JSON representation

Terraform module to configure and provision Datadog users

Awesome Lists containing this project

README

        

# terraform-datadog-users

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

This Terraform module is designed to create and manage Datadog user accounts.

The users are associated with one of the three [out-of-the-box roles](https://docs.datadoghq.com/account_management/rbac/permissions/):

- Datadog Admin
- Datadog Standard
- Datadog Read Only

## Usage

```hcl
module "datadog_users" {
source = "masterpointio/datadog/users"
version = "X.X.X"

users = [
{
roles = ["standard"],
email = "[email protected]",
name = "Jane Smith",
role = "Editor",
username = "janesmith"
}
]
}
```

Check out [examples/complete](examples/complete) for the full example.

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.

❗ 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!

Here are some basic SOPS operations that help you to work with the example:

- Pass `age` key to SOPS provider configuration:

```sh
cd ./example/complete
export SOPS_AGE_KEY_FILE=key.txt
```

- Encryption/decryption via SOPS editior

```sh
sops example.yaml
```

## Requirements

| Name | Version |
| ------------------------------------------------------------------------ | ------- |
| [terraform](#requirement_terraform) | >= 1.3 |
| [datadog](#requirement_datadog) | >= 3.14 |

## Providers

| Name | Version |
| ------------------------------------------------------------ | ------- |
| [datadog](#provider_datadog) | >= 3.14 |

## Modules

No modules.

## Resources

| Name | Type |
| --------------------------------------------------------------------------------------------------------------- | ----------- |
| [datadog_user.users](https://registry.terraform.io/providers/datadog/datadog/latest/docs/resources/user) | resource |
| [datadog_role.admin](https://registry.terraform.io/providers/datadog/datadog/latest/docs/data-sources/role) | data source |
| [datadog_role.read_only](https://registry.terraform.io/providers/datadog/datadog/latest/docs/data-sources/role) | data source |
| [datadog_role.standard](https://registry.terraform.io/providers/datadog/datadog/latest/docs/data-sources/role) | data source |

## Inputs

| Name | Description | Type | Default | Required |
| ------------------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | :------: |
| [users](#input_users) | n/a |

list(object({
disabled = optional(bool, false)
email = string
name = string
roles = set(string)
send_user_invitation = optional(bool, true)
username = string
}))
| n/a | yes |

## Outputs

| Name | Description |
| -------------------------------------------------------------------------- | ------------------------------------------------------ |
| [datadog_users](#output_datadog_users) | A map of all Datadog user resources keyed by username. |

## Contributing

Contributions are welcome and appreciated!

Found an issue or want to request a feature? [Open an issue](TODO)

Want to fix a bug you found or add some functionality? Fork, clone, commit, push, and PR and we'll check it out.

If you have any issues or are waiting a long time for a PR to get merged then feel free to ping us at [[email protected]](mailto:[email protected]).

## Built By

[![Masterpoint Logo](https://i.imgur.com/RDLnuQO.png)](https://masterpoint.io)