@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
180 lines • 6.27 kB
JavaScript
"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAwsCloudwatchScrapeJobOutput = exports.getAwsCloudwatchScrapeJob = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* This data source allows you to look up an existing Grafana Cloud AWS CloudWatch Scrape Job resource in your stack.
*
* See the Grafana Provider configuration docs
* for information on authentication and required access policy scopes.
*
* * [Official Grafana Cloud documentation](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/monitor-cloud-provider/aws/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as grafana from "@pulumiverse/grafana";
*
* const test = grafana.cloud.getStack({
* slug: "gcloudstacktest",
* });
* const testIamRole = aws.index.IamRole({
* name: "my-role",
* });
* const testAwsAccount = new grafana.cloudprovider.AwsAccount("test", {
* stackId: test.then(test => test.id),
* roleArn: testIamRole.arn,
* regions: [
* "us-east-1",
* "us-east-2",
* "us-west-1",
* ],
* });
* const testAwsCloudwatchScrapeJob = new grafana.cloudprovider.AwsCloudwatchScrapeJob("test", {
* stackId: test.then(test => test.id),
* name: "my-cloudwatch-scrape-job",
* awsAccountResourceId: testAwsAccount.resourceId,
* exportTags: true,
* services: [{
* name: "AWS/EC2",
* metrics: [
* {
* name: "CPUUtilization",
* statistics: ["Average"],
* },
* {
* name: "StatusCheckFailed",
* statistics: ["Maximum"],
* },
* ],
* scrapeIntervalSeconds: 300,
* resourceDiscoveryTagFilters: [{
* key: "k8s.io/cluster-autoscaler/enabled",
* value: "true",
* }],
* tagsToAddToMetrics: ["eks:cluster-name"],
* }],
* customNamespaces: [{
* name: "CoolApp",
* metrics: [{
* name: "CoolMetric",
* statistics: [
* "Maximum",
* "Sum",
* ],
* }],
* scrapeIntervalSeconds: 300,
* }],
* staticLabels: {
* label1: "value1",
* label2: "value2",
* },
* });
* const testGetAwsCloudwatchScrapeJob = pulumi.all([test, testAwsCloudwatchScrapeJob.name]).apply(([test, name]) => grafana.cloudProvider.getAwsCloudwatchScrapeJobOutput({
* stackId: test.id,
* name: name,
* }));
* ```
*/
function getAwsCloudwatchScrapeJob(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("grafana:cloudProvider/getAwsCloudwatchScrapeJob:getAwsCloudwatchScrapeJob", {
"customNamespaces": args.customNamespaces,
"name": args.name,
"services": args.services,
"stackId": args.stackId,
}, opts);
}
exports.getAwsCloudwatchScrapeJob = getAwsCloudwatchScrapeJob;
/**
* This data source allows you to look up an existing Grafana Cloud AWS CloudWatch Scrape Job resource in your stack.
*
* See the Grafana Provider configuration docs
* for information on authentication and required access policy scopes.
*
* * [Official Grafana Cloud documentation](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/monitor-cloud-provider/aws/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as grafana from "@pulumiverse/grafana";
*
* const test = grafana.cloud.getStack({
* slug: "gcloudstacktest",
* });
* const testIamRole = aws.index.IamRole({
* name: "my-role",
* });
* const testAwsAccount = new grafana.cloudprovider.AwsAccount("test", {
* stackId: test.then(test => test.id),
* roleArn: testIamRole.arn,
* regions: [
* "us-east-1",
* "us-east-2",
* "us-west-1",
* ],
* });
* const testAwsCloudwatchScrapeJob = new grafana.cloudprovider.AwsCloudwatchScrapeJob("test", {
* stackId: test.then(test => test.id),
* name: "my-cloudwatch-scrape-job",
* awsAccountResourceId: testAwsAccount.resourceId,
* exportTags: true,
* services: [{
* name: "AWS/EC2",
* metrics: [
* {
* name: "CPUUtilization",
* statistics: ["Average"],
* },
* {
* name: "StatusCheckFailed",
* statistics: ["Maximum"],
* },
* ],
* scrapeIntervalSeconds: 300,
* resourceDiscoveryTagFilters: [{
* key: "k8s.io/cluster-autoscaler/enabled",
* value: "true",
* }],
* tagsToAddToMetrics: ["eks:cluster-name"],
* }],
* customNamespaces: [{
* name: "CoolApp",
* metrics: [{
* name: "CoolMetric",
* statistics: [
* "Maximum",
* "Sum",
* ],
* }],
* scrapeIntervalSeconds: 300,
* }],
* staticLabels: {
* label1: "value1",
* label2: "value2",
* },
* });
* const testGetAwsCloudwatchScrapeJob = pulumi.all([test, testAwsCloudwatchScrapeJob.name]).apply(([test, name]) => grafana.cloudProvider.getAwsCloudwatchScrapeJobOutput({
* stackId: test.id,
* name: name,
* }));
* ```
*/
function getAwsCloudwatchScrapeJobOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("grafana:cloudProvider/getAwsCloudwatchScrapeJob:getAwsCloudwatchScrapeJob", {
"customNamespaces": args.customNamespaces,
"name": args.name,
"services": args.services,
"stackId": args.stackId,
}, opts);
}
exports.getAwsCloudwatchScrapeJobOutput = getAwsCloudwatchScrapeJobOutput;
//# sourceMappingURL=getAwsCloudwatchScrapeJob.js.map