@pulumi/fastly
Version:
A Pulumi package for creating and managing fastly cloud resources.. Based on terraform-provider-fastly: version v4
121 lines • 4.93 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.Integration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fastly from "@pulumi/fastly";
*
* const mailinglistExample = new fastly.Integration("mailinglist_example", {
* name: "my mailing list integration",
* description: "example mailing list integration",
* type: "mailinglist",
* config: {
* address: "incoming-hook@my.domain.com",
* },
* });
* const microsoftteamsExample = new fastly.Integration("microsoftteams_example", {
* name: "my Microsoft Teams integration",
* description: "example Microsoft Teams integration",
* type: "microsoftteams",
* config: {
* webhook: "https://m365x012345.webhook.office.com",
* },
* });
* const newrelicExample = new fastly.Integration("newrelic_example", {
* name: "my New Relic integration",
* description: "example New Relic integration",
* type: "newrelic",
* config: {
* account: "XXXXXXX",
* key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
* },
* });
* const pagerdutyExample = new fastly.Integration("pagerduty_example", {
* name: "my PagerDuty integration",
* description: "example PagerDuty integration",
* type: "pagerduty",
* config: {
* key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
* },
* });
* const slackExample = new fastly.Integration("slack_example", {
* name: "my Slack integration",
* description: "example Slack integration",
* type: "slack",
* config: {
* webhook: "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
* },
* });
* const webhookExample = new fastly.Integration("webhook_example", {
* name: "my webhook integration",
* description: "example webhook integration",
* type: "webhook",
* config: {
* webhook: "https://my.domain.com/webhook",
* },
* });
* ```
*/
class Integration extends pulumi.CustomResource {
/**
* Get an existing Integration 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 Integration(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Integration. 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'] === Integration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.config === undefined) && !opts.urn) {
throw new Error("Missing required property 'config'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["config"] = (args === null || args === void 0 ? void 0 : args.config) ? pulumi.secret(args.config) : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["type"] = args ? args.type : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["config"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Integration.__pulumiType, name, resourceInputs, opts);
}
}
exports.Integration = Integration;
/** @internal */
Integration.__pulumiType = 'fastly:index/integration:Integration';
//# sourceMappingURL=integration.js.map