UNPKG

@twingate/pulumi-twingate

Version:

A Pulumi package for creating and managing Twingate cloud resources.

120 lines 5.32 kB
"use strict"; // *** 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.TwingateDNSFilteringProfile = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * DNS filtering gives you the ability to control what websites your users can access. DNS filtering is only available on certain plans. For more information, see Twingate's [documentation](https://www.twingate.com/docs/dns-filtering). DNS filtering must be enabled for this resources to work. If DNS filtering isn't enabled, the provider will throw an error. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * import * as twingate from "@twingate/pulumi-twingate"; * * const example1 = new twingate.TwingateGroup("example1", {name: "example_1"}); * const example2 = new twingate.TwingateGroup("example2", {name: "example_2"}); * const example = twingate.getTwingateGroups({ * namePrefix: "example", * }); * const exampleTwingateDNSFilteringProfile = new twingate.TwingateDNSFilteringProfile("example", { * name: "Example DNS Filtering Profile", * priority: 2, * fallbackMethod: "AUTO", * groups: example.then(example => std.toset({ * input: example.groups.map(__item => __item.id), * })).then(invoke => invoke.result), * allowedDomains: { * isAuthoritative: false, * domains: [ * "twingate.com", * "zoom.us", * ], * }, * deniedDomains: { * isAuthoritative: true, * domains: ["evil.example"], * }, * contentCategories: { * blockAdultContent: true, * }, * securityCategories: { * blockDnsRebinding: false, * blockNewlyRegisteredDomains: false, * }, * privacyCategories: { * blockDisguisedTrackers: true, * }, * }); * ``` * * ## Import * * ```sh * $ pulumi import twingate:index/twingateDNSFilteringProfile:TwingateDNSFilteringProfile example RG5zRmlsdGVyaW5nUHJvZmlsZToxY2I4YzM0YTc0 * ``` */ class TwingateDNSFilteringProfile extends pulumi.CustomResource { /** * Get an existing TwingateDNSFilteringProfile 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 TwingateDNSFilteringProfile(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of TwingateDNSFilteringProfile. 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'] === TwingateDNSFilteringProfile.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowedDomains"] = state?.allowedDomains; resourceInputs["contentCategories"] = state?.contentCategories; resourceInputs["deniedDomains"] = state?.deniedDomains; resourceInputs["fallbackMethod"] = state?.fallbackMethod; resourceInputs["groups"] = state?.groups; resourceInputs["name"] = state?.name; resourceInputs["priority"] = state?.priority; resourceInputs["privacyCategories"] = state?.privacyCategories; resourceInputs["securityCategories"] = state?.securityCategories; } else { const args = argsOrState; if (args?.priority === undefined && !opts.urn) { throw new Error("Missing required property 'priority'"); } resourceInputs["allowedDomains"] = args?.allowedDomains; resourceInputs["contentCategories"] = args?.contentCategories; resourceInputs["deniedDomains"] = args?.deniedDomains; resourceInputs["fallbackMethod"] = args?.fallbackMethod; resourceInputs["groups"] = args?.groups; resourceInputs["name"] = args?.name; resourceInputs["priority"] = args?.priority; resourceInputs["privacyCategories"] = args?.privacyCategories; resourceInputs["securityCategories"] = args?.securityCategories; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(TwingateDNSFilteringProfile.__pulumiType, name, resourceInputs, opts); } } exports.TwingateDNSFilteringProfile = TwingateDNSFilteringProfile; /** @internal */ TwingateDNSFilteringProfile.__pulumiType = 'twingate:index/twingateDNSFilteringProfile:TwingateDNSFilteringProfile'; //# sourceMappingURL=twingateDNSFilteringProfile.js.map