@pulumi/tailscale
Version:
A Pulumi package for creating and managing Tailscale cloud resources.
96 lines • 3.67 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.Acl = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* The acl resource allows you to configure a Tailscale ACL. See https://tailscale.com/kb/1018/acls for more information. Note that this resource will completely overwrite existing ACL contents for a given tailnet.
*
* If tests are defined in the ACL (the top-level "tests" section), ACL validation will occur before creation and update operations are applied.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as tailscale from "@pulumi/tailscale";
*
* const asJson = new tailscale.Acl("as_json", {acl: JSON.stringify({
* acls: [{
* action: "accept",
* users: ["*"],
* ports: ["*:*"],
* }],
* })});
* const asHujson = new tailscale.Acl("as_hujson", {acl: ` {
* // Comments in HuJSON policy are preserved when the policy is applied.
* "acls": [
* {
* // Allow all users access to all ports.
* action = "accept",
* users = ["*"],
* ports = ["*:*"],
* },
* ],
* }
* `});
* ```
*
* ## Import
*
* ID doesn't matter.
*
* ```sh
* $ pulumi import tailscale:index/acl:Acl sample_acl acl
* ```
*/
class Acl extends pulumi.CustomResource {
/**
* Get an existing Acl 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 Acl(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Acl. 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'] === Acl.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["acl"] = state ? state.acl : undefined;
resourceInputs["overwriteExistingContent"] = state ? state.overwriteExistingContent : undefined;
resourceInputs["resetAclOnDestroy"] = state ? state.resetAclOnDestroy : undefined;
}
else {
const args = argsOrState;
if ((!args || args.acl === undefined) && !opts.urn) {
throw new Error("Missing required property 'acl'");
}
resourceInputs["acl"] = args ? args.acl : undefined;
resourceInputs["overwriteExistingContent"] = args ? args.overwriteExistingContent : undefined;
resourceInputs["resetAclOnDestroy"] = args ? args.resetAclOnDestroy : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Acl.__pulumiType, name, resourceInputs, opts);
}
}
exports.Acl = Acl;
/** @internal */
Acl.__pulumiType = 'tailscale:index/acl:Acl';
//# sourceMappingURL=acl.js.map