UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

108 lines 5.16 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Source = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The `scaleway.observability.Source` resource allows you to create and manage [data sources](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#data-sources) in Scaleway's Cockpit. * * Refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api) for more information. * * ## Example Usage * * ### Create a data source * * The following command allows you to create a [metrics](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#metric) data source named `my-data-source` in a given Project. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const project = new scaleway.account.Project("project", {name: "test project data source"}); * const main = new scaleway.observability.Source("main", { * projectId: project.id, * name: "my-data-source", * type: "metrics", * retentionDays: 6, * }); * ``` * * ## Import * * This section explains how to import a data source using the ID of the region it is located in, in the `{region}/{id}` format. * * bash * * ```sh * $ pulumi import scaleway:observability/source:Source main fr-par/11111111-1111-1111-1111-111111111111 * ``` */ class Source extends pulumi.CustomResource { /** * Get an existing Source 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 Source(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Source. 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'] === Source.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["origin"] = state ? state.origin : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["pushUrl"] = state ? state.pushUrl : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["retentionDays"] = state ? state.retentionDays : undefined; resourceInputs["synchronizedWithGrafana"] = state ? state.synchronizedWithGrafana : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["url"] = state ? state.url : undefined; } else { const args = argsOrState; if ((!args || args.retentionDays === undefined) && !opts.urn) { throw new Error("Missing required property 'retentionDays'"); } resourceInputs["name"] = args ? args.name : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["retentionDays"] = args ? args.retentionDays : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["origin"] = undefined /*out*/; resourceInputs["pushUrl"] = undefined /*out*/; resourceInputs["synchronizedWithGrafana"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; resourceInputs["url"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "scaleway:index/cockpitSource:CockpitSource" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(Source.__pulumiType, name, resourceInputs, opts); } } exports.Source = Source; /** @internal */ Source.__pulumiType = 'scaleway:observability/source:Source'; //# sourceMappingURL=source.js.map