This Cloud Formation Custom Resource provides a CRUDL interface to the New Relic NerdGraph GraphQL Dashboards API 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 | Update | Delete | Read | List | Notes |
---|---|---|---|---|---|---|---|---|
Dashboard | String | none | R | R | Specific to this extension | |||
Guid | string | none | R | R | R | See Stack Common Configuration | ||
ListQueryFilter | string | none | R | See Stack Common Configuration | ||||
Variables | Object | none | O | O | O | O | See Stack Common Configuration | |
Tags | Object | none | O | O | See Stack Common Configuration |
Key:
- R- Required
- O- Optional
- Blank- unused
The entire dashboard
fragment from a dashboardCreate
or dashboardUpdate
mutation.
This string is a valid GraphQL fragment representing a Dashboard, including the dashboard:
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 {
dashboardCreate(accountId: {{{ACCOUNTID}}}, {{{DASHBOARD}}} ) {
entityResult {
guid
}
errors {
description
type
}
}
}
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.
An example stack configuration, this is valid and works:
AWSTemplateFormatVersion: 2010-09-09
Description: Sample New Relic Dashboards Template
Resources:
Resource1:
Type: 'NewRelic::Observability::Dashboards'
Properties:
Dashboard: >-
dashboard: {description: "CloudFormation test dashboard", name: "CloudFormation Test Dashboard", pages:
{description: "TD PAGE", name: "TD Page", widgets:
{title: "Widget Title", configuration:
{markdown: {text: "Some markdown"}}}}, permissions: PRIVATE}
Tags:
CreateTag1Key1: "CreateTag1Value1"
Outputs:
CustomResourceGuid:
Value: !GetAtt Resource1.Guid
- 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 opensource@newrelic.com.
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.