Skip to content

Commit

Permalink
Merge pull request #1291 from Ninir/b-cloudwatch-dashboards-docs
Browse files Browse the repository at this point in the history
Added CloudWatch Dashboard documentation
  • Loading branch information
Ninir authored Aug 1, 2017
2 parents 82414ae + 5c4e35f commit d06c25f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
4 changes: 4 additions & 0 deletions website/aws.erb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@
<li<%= sidebar_current("docs-aws-resource-cloudwatch") %>>
<a href="#">CloudWatch Resources</a>
<ul class="nav nav-visible">
<li<%= sidebar_current("docs-aws-resource-cloudwatch-dashboard") %>>
<a href="/docs/providers/aws/r/cloudwatch_dashboard.html">aws_cloudwatch_dashboard</a>
</li>

<li<%= sidebar_current("docs-aws-resource-cloudwatch-event-rule") %>>
<a href="/docs/providers/aws/r/cloudwatch_event_rule.html">aws_cloudwatch_event_rule</a>
</li>
Expand Down
77 changes: 77 additions & 0 deletions website/docs/r/cloudwatch_dashboard.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
layout: "aws"
page_title: "AWS: aws_cloudwatch_dashboard"
sidebar_current: "docs-aws-resource-cloudwatch-dashboard"
description: |-
Provides a CloudWatch Dashboard resource.
---

# aws_cloudwatch_dashboard

Provides a CloudWatch Dashboard resource.

## Example Usage

```hcl
resource "aws_cloudwatch_dashboard" "main" {
dashboard_name = "my-dashboard"
dashboard_body = <<EOF
{
"widgets": [
{
"type":"metric",
"x":0,
"y":0,
"width":12,
"height":6,
"properties":{
"metrics":[
[
"AWS/EC2",
"CPUUtilization",
"InstanceId",
"i-012345"
]
],
"period":300,
"stat":"Average",
"region":"us-east-1",
"title":"EC2 Instance CPU"
}
},
{
"type":"text",
"x":0,
"y":7,
"width":3,
"height":3,
"properties":{
"markdown":"Hello world"
}
}
]
}
EOF
}
```

## Argument Reference

The following arguments are supported:

* `dashboard_name` - (Required) The name of the dashboard.
* `dashboard_body` - (Required) The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html).

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `dashboard_arn` - The Amazon Resource Name (ARN) of the dashboard.

## Import

CloudWatch dashboards can be imported using the `dashboard_name`, e.g.

```
$ terraform import aws_cloudwatch_dashboard.sample <dashboard_name>
```

0 comments on commit d06c25f

Please sign in to comment.