Dashboard
Provides a CloudWatch Dashboard resource.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.Dashboard;
import com.pulumi.aws.cloudwatch.DashboardArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var main = new Dashboard("main", DashboardArgs.builder()
.dashboardName("my-dashboard")
.dashboardBody(serializeJson(
jsonObject(
jsonProperty("widgets", jsonArray(
jsonObject(
jsonProperty("type", "metric"),
jsonProperty("x", 0),
jsonProperty("y", 0),
jsonProperty("width", 12),
jsonProperty("height", 6),
jsonProperty("properties", jsonObject(
jsonProperty("metrics", jsonArray(jsonArray(
"AWS/EC2",
"CPUUtilization",
"InstanceId",
"i-012345"
))),
jsonProperty("period", 300),
jsonProperty("stat", "Average"),
jsonProperty("region", "us-east-1"),
jsonProperty("title", "EC2 Instance CPU")
))
),
jsonObject(
jsonProperty("type", "text"),
jsonProperty("x", 0),
jsonProperty("y", 7),
jsonProperty("width", 3),
jsonProperty("height", 3),
jsonProperty("properties", jsonObject(
jsonProperty("markdown", "Hello world")
))
)
))
)))
.build());
}
}
Content copied to clipboard
Import
Using pulumi import
, import CloudWatch dashboards using the dashboard_name
. For example:
$ pulumi import aws:cloudwatch/dashboard:Dashboard sample dashboard_name
Content copied to clipboard
Properties
Link copied to clipboard
Link copied to clipboard
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.
Link copied to clipboard