UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

176 lines 6.99 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.TemWebhook = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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. * * bash * * ```sh * $ pulumi import scaleway:index/temWebhook:TemWebhook main fr-par/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/temwebhook.TemWebhook has been deprecated in favor of scaleway.tem/webhook.Webhook */ class TemWebhook extends pulumi.CustomResource { /** * Get an existing TemWebhook 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) { pulumi.log.warn("TemWebhook is deprecated: scaleway.index/temwebhook.TemWebhook has been deprecated in favor of scaleway.tem/webhook.Webhook"); return new TemWebhook(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of TemWebhook. 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'] === TemWebhook.__pulumiType; } /** @deprecated scaleway.index/temwebhook.TemWebhook has been deprecated in favor of scaleway.tem/webhook.Webhook */ constructor(name, argsOrState, opts) { pulumi.log.warn("TemWebhook is deprecated: scaleway.index/temwebhook.TemWebhook has been deprecated in favor of scaleway.tem/webhook.Webhook"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["domainId"] = state ? state.domainId : undefined; resourceInputs["eventTypes"] = state ? state.eventTypes : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["organizationId"] = state ? state.organizationId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["snsArn"] = state ? state.snsArn : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; } else { const args = argsOrState; if ((!args || args.domainId === undefined) && !opts.urn) { throw new Error("Missing required property 'domainId'"); } if ((!args || args.eventTypes === undefined) && !opts.urn) { throw new Error("Missing required property 'eventTypes'"); } if ((!args || args.snsArn === undefined) && !opts.urn) { throw new Error("Missing required property 'snsArn'"); } resourceInputs["domainId"] = args ? args.domainId : undefined; resourceInputs["eventTypes"] = args ? args.eventTypes : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["snsArn"] = args ? args.snsArn : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["organizationId"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(TemWebhook.__pulumiType, name, resourceInputs, opts); } } exports.TemWebhook = TemWebhook; /** @internal */ TemWebhook.__pulumiType = 'scaleway:index/temWebhook:TemWebhook'; //# sourceMappingURL=temWebhook.js.map