Skip to content

Commit

Permalink
docs(workloads): add website documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrombley committed Mar 22, 2020
1 parent 5a532eb commit 252ede8
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
67 changes: 67 additions & 0 deletions website/docs/r/workload.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
layout: "newrelic"
page_title: "New Relic: newrelic_workload"
sidebar_current: "docs-newrelic-resource-workload"
description: |-
Create and manage a New Relic One workload.
---

# Resource: newrelic\_workload

Use this resource to create, update, and delete a New Relic One workload.

A New Relic Personal API key is required to provision this resource. Set the `provider_api_key`
attribute in the `provider` block or the `NEWRELIC_PERSONAL_API_KEY` environment
variable with your Personal API key,

## Example Usage

```hcl
resource "newrelic_workload" "foo" {
name = "Example workload"
account_id = 12345678
entity_guids = ["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"]
entity_search_query {
name = "Example query"
query = "name like 'Example application'"
}
scope_account_ids = [12345678]
}
```
## Argument Reference

The following arguments are supported:

* `name` - (Required) The workload's name.
* `account_id` - (Required) The New Relic account ID where you want to create the workload.
* `entity_guids` - (Optional) A list of entity GUIDs manually assigned to this workload.
* `entity_search_query` - (Optional) A list of search queries that define a dynamic workload. See [Nested entity_search_query blocks](#nested-entity_search_query-blocks) below for details.
* `scope_account_ids` - (Optional) A list of account IDs that will be used to get entities from.

### Nested `entity_search_query` blocks

All nested `entity_search_query` blocks support the following common arguments:

* `title` - (Required) The name of the query.
* `query` - (Required) The query.

## Attributes Reference

The following attributes are exported:

* `guid` - The unique entity identifier of the workload in New Relic.
* `workload_id` - The unique entity identifier of the workload.
* `permalink` - The URL of the workload.
* `composite_entity_search_query` - The composite query used to compose a dynamic workload.

## Import

New Relic One workloads can be imported using a concatenated string of the format
`<account_id>:<workload_id>:<guid>`, e.g.

```bash
$ terraform import newrelic_workload.foo 12345678:1456:MjUyMDUyOHxBUE18QVBRTElDQVRJT058MjE1MDM3Nzk1
```
3 changes: 3 additions & 0 deletions website/newrelic.erb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
<li<%= sidebar_current("docs-newrelic-resource-synthetics-secure-credential") %>>
<a href="/docs/providers/newrelic/r/synthetics_secure_credential.html">newrelic_synthetics_secure_credential</a>
</li>
<li<%= sidebar_current("docs-newrelic-resource-workload") %>>
<a href="/docs/providers/newrelic/r/workload.html">newrelic_workload</a>
</li>
</ul>
</li>
</ul>
Expand Down

0 comments on commit 252ede8

Please sign in to comment.