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

Add dashboard resource #93

Merged
merged 3 commits into from
Oct 28, 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
11 changes: 11 additions & 0 deletions datadog-dashboards-dashboard-handler/.rpdk-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"typeName": "Datadog::Dashboards::Dashboard",
"language": "python37",
"runtime": "python3.7",
"entrypoint": "datadog_dashboards_dashboard.handlers.resource",
"testEntrypoint": "datadog_dashboards_dashboard.handlers.test_entrypoint",
"settings": {
"use_docker": true,
"protocolVersion": "2.0.0"
}
}
23 changes: 23 additions & 0 deletions datadog-dashboards-dashboard-handler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Datadog::Dashboards::Dashboard

This resource represents a Datadog Dashboard, and is used to create and manage Datadog Dashboards.
More information about the Datadog Dashboards can be found in the [Dashboards documentation](https://docs.datadoghq.com/dashboards/).

## Example Usage

```
Resources:
DatadogTestDashboard:
Type: 'Datadog::Dashboards::Dashboard'
Properties:
DashboardDefinition: |
<Put here the JSON string of the dashboard definition. Can be exported directly from the web application>
DatadogCredentials:
ApiURL: https://api.datadoghq.com
ApiKey: <DD_API_KEY>
ApplicationKey: <DD_APP_KEY>
```

## Property Reference:

For a list of available properties and their descriptions and examples, see the [JSON Schema for this resource](https://github.com/DataDog/datadog-cloudformation-resources/blob/master/datadog-dashboards-dashboard-handler/datadog-dashboards-dashboard.json).
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"typeName": "Datadog::Dashboards::Dashboard",
"description": "Datadog Dashboard 1.0.0.dev",
"definitions": {
},
"properties": {
"DatadogCredentials": {
"description": "Credentials for the Datadog API",
"properties": {
"ApiKey": {
"description": "Datadog API key",
"type": "string"
},
"ApplicationKey": {
"description": "Datadog application key",
"type": "string"
},
"ApiURL": {
"description": "Datadog API URL (defaults to https://api.datadoghq.com) Use https://api.datadoghq.eu for EU accounts.",
"type": "string"
}
},
"required": [
"ApiKey",
"ApplicationKey"
],
"type": "object"
},
"Id": {
"description": "ID of the dashboard",
"type": "string"
},
"DashboardDefinition": {
"description": "JSON string of the dashboard definition",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"DatadogCredentials",
"DashboardDefinition"
],
"writeOnlyProperties": [
"/properties/DatadogCredentials"
],
"readOnlyProperties": [
"/properties/Id"
],
"primaryIdentifier": [
"/properties/Id"
],
"handlers": {
"create": {
"permissions": [
""
]
},
"read": {
"permissions": [
""
]
},
"update": {
"permissions": [
""
]
},
"delete": {
"permissions": [
""
]
},
"list": {
"permissions": [
""
]
}
}
}
67 changes: 67 additions & 0 deletions datadog-dashboards-dashboard-handler/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Datadog::Dashboards::Dashboard

Datadog Dashboard

## Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

### JSON

<pre>
{
"Type" : "Datadog::Dashboards::Dashboard",
"Properties" : {
"<a href="#datadogcredentials" title="DatadogCredentials">DatadogCredentials</a>" : <i><a href="datadogcredentials.md">DatadogCredentials</a></i>,
"<a href="#dashboarddefinition" title="DashboardDefinition">DashboardDefinition</a>" : <i>String</i>
}
}
</pre>

### YAML

<pre>
Type: Datadog::Dashboards::Dashboard
Properties:
<a href="#datadogcredentials" title="DatadogCredentials">DatadogCredentials</a>: <i><a href="datadogcredentials.md">DatadogCredentials</a></i>
<a href="#dashboarddefinition" title="DashboardDefinition">DashboardDefinition</a>: <i>String</i>
</pre>

## Properties

#### DatadogCredentials

Credentials for the Datadog API

_Required_: Yes

_Type_: <a href="datadogcredentials.md">DatadogCredentials</a>

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### DashboardDefinition

JSON string of the dashboard definition

_Required_: Yes

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return Values

### Ref

When you pass the logical ID of this resource to the intrinsic `Ref` function, Ref returns the Id.

### Fn::GetAtt

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).

#### Id

ID of the dashboard

58 changes: 58 additions & 0 deletions datadog-dashboards-dashboard-handler/docs/datadogcredentials.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Datadog::Dashboards::Dashboard DatadogCredentials

Credentials for the Datadog API

## Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

### JSON

<pre>
{
"<a href="#apikey" title="ApiKey">ApiKey</a>" : <i>String</i>,
"<a href="#applicationkey" title="ApplicationKey">ApplicationKey</a>" : <i>String</i>,
"<a href="#apiurl" title="ApiURL">ApiURL</a>" : <i>String</i>
}
</pre>

### YAML

<pre>
<a href="#apikey" title="ApiKey">ApiKey</a>: <i>String</i>
<a href="#applicationkey" title="ApplicationKey">ApplicationKey</a>: <i>String</i>
<a href="#apiurl" title="ApiURL">ApiURL</a>: <i>String</i>
</pre>

## Properties

#### ApiKey

Datadog API key

_Required_: Yes

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### ApplicationKey

Datadog application key

_Required_: Yes

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### ApiURL

Datadog API URL (defaults to https://api.datadoghq.com) Use https://api.datadoghq.eu for EU accounts.

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

1 change: 1 addition & 0 deletions datadog-dashboards-dashboard-handler/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git+https://github.com/datadog/datadog-cloudformation-resources.git@datadog-cloudformation-common-python-0.0.1#egg=datadog_cloudformation_common&subdirectory=datadog-cloudformation-common-python
Loading