@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
104 lines • 4 kB
JavaScript
;
// *** 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.AwsAccount = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* This resource allows you to link your AWS Account to Grafana Cloud for use in creating Cloud Provider resources.
*
* 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",
* ],
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_cloud_provider_aws_account.name "{{ stack_id }}:{{ resource_id }}"
* ```
*/
class AwsAccount extends pulumi.CustomResource {
/**
* Get an existing AwsAccount resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new AwsAccount(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AwsAccount. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AwsAccount.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["name"] = state?.name;
resourceInputs["regions"] = state?.regions;
resourceInputs["resourceId"] = state?.resourceId;
resourceInputs["roleArn"] = state?.roleArn;
resourceInputs["stackId"] = state?.stackId;
}
else {
const args = argsOrState;
if (args?.regions === undefined && !opts.urn) {
throw new Error("Missing required property 'regions'");
}
if (args?.roleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'roleArn'");
}
if (args?.stackId === undefined && !opts.urn) {
throw new Error("Missing required property 'stackId'");
}
resourceInputs["name"] = args?.name;
resourceInputs["regions"] = args?.regions;
resourceInputs["roleArn"] = args?.roleArn;
resourceInputs["stackId"] = args?.stackId;
resourceInputs["resourceId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AwsAccount.__pulumiType, name, resourceInputs, opts);
}
}
exports.AwsAccount = AwsAccount;
/** @internal */
AwsAccount.__pulumiType = 'grafana:cloudProvider/awsAccount:AwsAccount';
//# sourceMappingURL=awsAccount.js.map