This Cloud Formation Custom Resource provides a CRUDL interface to the New Relic [NerdGraph (GraphQL) Workloads API] (https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-workloads-api-tutorials/) for Cloud Formation stacks.
This document assumes familiarity with using CloudFormation Public extensions in CloudFormation templates. If you are not familiar with this start here
Field | Type | Default | Create | Duplicate | Update | Delete | Read | Notes |
---|---|---|---|---|---|---|---|---|
Guid | string | none | R | R | R | |||
ListQueryFilter | string | none | ||||||
Variables | Object | none | ||||||
SourceGuid | string | none | R | |||||
DuplicateName | string | -DUPLICATE | O | |||||
Workload | String | none | R | R |
Key:
- R- Requird
- O- Optional
- Blank- unused
Guid
New Relic entity identifier. Typically the guid
vaule from Nerd Graph.
actor
entitySearch
query string. The query string can search for an exact or fuzzy match on name, as well as searching several other attributes.
- Operators available: =, AND, IN, LIKE
- Special characters (.,;:*-_) are treated as whitespace. For example, name LIKE ':aws:' will match -aws. or foo aws.
- Tags can be referenced in multiple ways with or without backticks.
Examples:
- "name = 'MyApp (Staging)'
- "name LIKE 'MyApp' AND type IN ('APPLICATION')"
- "reporting = 'false' AND type IN ('HOST')"
- "domain IN ('INFRA', 'APM')"
- tags.Environment = 'staging' AND type IN ('APPLICATION')
Variables
is a JSON object of key/value pairs (string/string) that are substituted in the Workload
string with Moustache allowing for parameterized input at the CloudFormation level.
DUPLICATE ONLY
The guid of the Workload to be duplicated. The presence of this field in the stack is the indication that this is a Duplicate
rather than Create
operation.
The name
to apply to the duplicated Workload.
The entire workload
fragment from a workloadCreate
or workloadDuplicate
This string is a valid GraphQL fragment representing a Workload, including the workload:
keyword. Your best bet is to use the
GraphQL API Explorer
to create this and then copy and paste. Your fragment will be substituted in a create or update mutation like this:
mutation {
workloadCreate(accountId: {{{ACCOUNTID}}}, {{{WORKLOAD}}}) {
guid
}
}
NOTE: the {{{
and }}}
are for Moustache processing.
If you use a JSON CloudFormation template you will have to stringify the GraphQL fragment. YAML CloudFormation templates should follow YAML multi-line input rules and avoid stringification.
All text substitution is done using a Go implementation of the Moustache specification`. The manual is here, in general all you need to know is use triple curly braces.
An example of a YAML configuration, this is valid and works:
- Error log
Debug
log level for mustache substitution- Validate mutation using the Explorer
New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.
We encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.
We encourage your contributions to improve New Relic NerdGraph CloudFormation Custom Resource! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].
A note about vulnerabilities
As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.
If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.
New Relic NerdGraph CloudFormation Custom Resource is licensed under the Apache 2.0 License.