-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[provider] Add a default_tags attribute in the Datadog provider config. #2486
Conversation
8f21e64
to
a87f5e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of suggestions from Docs and approved the PR.
docs/index.md
Outdated
@@ -52,9 +52,17 @@ provider "datadog" { | |||
- `api_key` (String, Sensitive) (Required unless validate is false) Datadog API key. This can also be set via the DD_API_KEY environment variable. | |||
- `api_url` (String) The API URL. This can also be set via the DD_HOST environment variable. Note that this URL must not end with the `/api/` path. For example, `https://api.datadoghq.com/` is a correct value, while `https://api.datadoghq.com/api/` is not. And if you're working with "EU" version of Datadog, use `https://api.datadoghq.eu/`. Other Datadog region examples: `https://api.us5.datadoghq.com/`, `https://api.us3.datadoghq.com/` and `https://api.ddog-gov.com/`. See https://docs.datadoghq.com/getting_started/site/ for all available regions. | |||
- `app_key` (String, Sensitive) (Required unless validate is false) Datadog APP key. This can also be set via the DD_APP_KEY environment variable. | |||
- `default_tags` (Block List, Max: 1) [Experimental - Monitors only] Configuration block with settings to default resource tags across all resources. (see [below for nested schema](#nestedblock--default_tags)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `default_tags` (Block List, Max: 1) [Experimental - Monitors only] Configuration block with settings to default resource tags across all resources. (see [below for nested schema](#nestedblock--default_tags)) | |
- `default_tags` (Block List, Max: 1) [Experimental - Monitors only] Configuration block containing settings to apply default resource tags across all resources. (See [below for nested schema](#nestedblock--default_tags).) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this in the source and ran make docs
- the only thing that I could not change is the uppercase on see
.
docs/index.md
Outdated
|
||
Optional: | ||
|
||
- `tags` (Map of String) [Experimental - Monitors only] Resource tags to default across all resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `tags` (Map of String) [Experimental - Monitors only] Resource tags to default across all resources | |
- `tags` (Map of String) [Experimental - Monitors only] Resource tags to be applied by default across all resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this in the source and ran make docs
.
Blocks: map[string]schema.Block{ | ||
"default_tags": schema.ListNestedBlock{ | ||
Validators: []validator.List{ | ||
listvalidator.SizeAtMost(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the list can only have size 1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we only want tags
in there, nothing else - the actual list of tags can have more that one tag.
It's a bit strange (I could have gone for default_tags{}
instead of default_tags{tags{}}
) but it's the way it's done for the AWS provider, so it's how the feature was requested and probably how the users expect this to work.
For the moment this config option is experimental and only applies to Datadog monitors. When default_tags is set at the provider level, resources that do not otherwise define those tags (by key) will inherit them automatically during plan. If the same tag (e.g. "foo:bar", "foo:not_bar") is defined at provider level and at resource level, the resource tag is used.
a87f5e4
to
c6ab32a
Compare
/merge |
🚂 MergeQueue: waiting for PR to be ready This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Use |
This merge request was unqueued If you need support, contact us on Slack #devflow! |
/merge |
🚂 MergeQueue: pull request added to the queue The median merge time in Use |
This PR is a first step towards answering this feature request: #1478
For the moment this config option is experimental and only applies to Datadog monitors.
When default_tags is set at the provider level, resources that do not otherwise define those tags (by key) will inherit them automatically during plan.
If the same tag (e.g. "foo:bar", "foo:not_bar") is defined at provider level and at resource level, the resource tag is used.