@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
194 lines • 7.24 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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Webhook = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Creates and manages Scaleway Transactional Email Webhooks.
* For more information, refer to the [API documentation](https://www.scaleway.com/en/developers/api/transactional-email).
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.tem.Webhook("main", {
* domainId: "your-domain-id",
* eventTypes: [
* "email_delivered",
* "email_bounced",
* ],
* snsArn: "arn:scw:sns:fr-par:project-xxxx:your-sns-topic",
* name: "example-webhook",
* });
* ```
*
* ### Complete Example with Dependencies
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const config = new pulumi.Config();
* const domainName = config.require("domainName");
* const sns = new scaleway.mnq.Sns("sns", {});
* const snsCredentials = new scaleway.mnq.SnsCredentials("sns_credentials", {permissions: {
* canManage: true,
* }});
* const snsTopic = new scaleway.mnq.SnsTopic("sns_topic", {
* name: "test-mnq-sns-topic-basic",
* accessKey: snsCredentials.accessKey,
* secretKey: snsCredentials.secretKey,
* });
* const cr01 = new scaleway.tem.Domain("cr01", {
* name: domainName,
* acceptTos: true,
* });
* const spf = new scaleway.domain.Record("spf", {
* dnsZone: domainName,
* type: "TXT",
* data: pulumi.interpolate`v=spf1 ${cr01.spfConfig} -all`,
* });
* const dkim = new scaleway.domain.Record("dkim", {
* dnsZone: domainName,
* name: pulumi.interpolate`${cr01.projectId}._domainkey`,
* type: "TXT",
* data: cr01.dkimConfig,
* });
* const mx = new scaleway.domain.Record("mx", {
* dnsZone: domainName,
* type: "MX",
* data: ".",
* });
* const dmarc = new scaleway.domain.Record("dmarc", {
* dnsZone: domainName,
* name: cr01.dmarcName,
* type: "TXT",
* data: cr01.dmarcConfig,
* });
* const valid = new scaleway.tem.DomainValidation("valid", {
* domainId: cr01.id,
* region: cr01.region,
* timeout: 3600,
* });
* const webhook = new scaleway.tem.Webhook("webhook", {
* name: "example-webhook",
* domainId: cr01.id,
* eventTypes: [
* "email_delivered",
* "email_bounced",
* ],
* snsArn: snsTopic.arn,
* }, {
* dependsOn: [
* valid,
* snsTopic,
* ],
* });
* ```
*
* ## Import
*
* Webhooks can be imported using the {region}/{id}, e.g.
*
* ```sh
* $ pulumi import scaleway:tem/webhook:Webhook main fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
class Webhook extends pulumi.CustomResource {
/**
* Get an existing Webhook 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 Webhook(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:tem/webhook:Webhook';
/**
* Returns true if the given object is an instance of Webhook. 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'] === Webhook.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["domainId"] = state?.domainId;
resourceInputs["eventTypes"] = state?.eventTypes;
resourceInputs["name"] = state?.name;
resourceInputs["organizationId"] = state?.organizationId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["region"] = state?.region;
resourceInputs["snsArn"] = state?.snsArn;
resourceInputs["updatedAt"] = state?.updatedAt;
}
else {
const args = argsOrState;
if (args?.domainId === undefined && !opts.urn) {
throw new Error("Missing required property 'domainId'");
}
if (args?.eventTypes === undefined && !opts.urn) {
throw new Error("Missing required property 'eventTypes'");
}
if (args?.snsArn === undefined && !opts.urn) {
throw new Error("Missing required property 'snsArn'");
}
resourceInputs["domainId"] = args?.domainId;
resourceInputs["eventTypes"] = args?.eventTypes;
resourceInputs["name"] = args?.name;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["region"] = args?.region;
resourceInputs["snsArn"] = args?.snsArn;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["organizationId"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "scaleway:index/temWebhook:TemWebhook" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(Webhook.__pulumiType, name, resourceInputs, opts);
}
}
exports.Webhook = Webhook;
//# sourceMappingURL=webhook.js.map