@equinix-labs/pulumi-equinix
Version:
A Pulumi package for creating and managing equinix cloud resources.
108 lines • 4.78 kB
JavaScript
;
// *** 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.AclTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource `equinix.networkedge.AclTemplate` allows creation and management of Equinix Network Edge device Access Control List templates.
*
* Device ACL templates give possibility to define set of rules will allowed inbound traffic. Templates can be assigned to the network devices.
*
* ## Example Usage
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@equinix-labs/pulumi-equinix";
*
* const myacl = new equinix.networkedge.AclTemplate("myacl", {
* name: "test",
* description: "Test ACL template",
* projectId: "a86d7112-d740-4758-9c9c-31e66373746b",
* inboundRules: [
* {
* subnet: "1.1.1.1/32",
* protocol: equinix.networkedge.AclRuleProtocolType.IP,
* srcPort: "any",
* dstPort: "any",
* description: "inbound rule description",
* },
* {
* subnet: "172.16.25.0/24",
* protocol: equinix.networkedge.AclRuleProtocolType.UDP,
* srcPort: "any",
* dstPort: "53,1045,2041",
* },
* ],
* });
* ```
*
* ## Import
*
* This resource can be imported using an existing ID:
*
* ```sh
* $ pulumi import equinix:networkedge/aclTemplate:AclTemplate example {existing_id}
* ```
*/
class AclTemplate extends pulumi.CustomResource {
/**
* Get an existing AclTemplate 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 AclTemplate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AclTemplate. 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'] === AclTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["deviceAclStatus"] = state ? state.deviceAclStatus : undefined;
resourceInputs["deviceDetails"] = state ? state.deviceDetails : undefined;
resourceInputs["deviceId"] = state ? state.deviceId : undefined;
resourceInputs["inboundRules"] = state ? state.inboundRules : undefined;
resourceInputs["metroCode"] = state ? state.metroCode : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["uuid"] = state ? state.uuid : undefined;
}
else {
const args = argsOrState;
if ((!args || args.inboundRules === undefined) && !opts.urn) {
throw new Error("Missing required property 'inboundRules'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["inboundRules"] = args ? args.inboundRules : undefined;
resourceInputs["metroCode"] = args ? args.metroCode : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["deviceAclStatus"] = undefined /*out*/;
resourceInputs["deviceDetails"] = undefined /*out*/;
resourceInputs["deviceId"] = undefined /*out*/;
resourceInputs["uuid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AclTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.AclTemplate = AclTemplate;
/** @internal */
AclTemplate.__pulumiType = 'equinix:networkedge/aclTemplate:AclTemplate';
//# sourceMappingURL=aclTemplate.js.map