Skip to content
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

Completely skip creds validation when validate is false #641

Merged
merged 1 commit into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions datadog/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
return nil, errors.New("api_key and app_key must be set unless validate = false")
}

if !validate && (apiKey != "" || appKey != "") {
return nil, errors.New("api_key and app_key must not be set when validate = false")
}

// Initialize the community client
communityClient := datadogCommunity.NewClient(apiKey, appKey)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ The following arguments are supported:
* `api_key` - (Required unless `validate` is false) Datadog API key. This can also be set via the `DD_API_KEY` environment variable.
* `app_key` - (Required unless `validate` is false) Datadog APP key. This can also be set via the `DD_APP_KEY` environment variable.
* `api_url` - (Optional) The API Url. This can be 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/`.
* `validate` - (Optional) Enables validation of the provided API and APP keys during provider initialization. Default is true. When false, `api_key` and `app_key` may only be set to empty strings.
* `validate` - (Optional) Enables validation of the provided API and APP keys during provider initialization. Default is true. When false, `api_key` and `app_key`won't be checked.