@pulumi/scm
Version:
A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1
192 lines • 6.42 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.Variable = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Variable resource
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scm from "@pulumi/scm";
*
* //
* // Creates a variable in as-number format
* //
* const scmVariableAsn = new scm.Variable("scm_variable_asn", {
* folder: "All",
* name: "$scm_variable_asn",
* description: "Managed by Pulumi",
* type: "as-number",
* value: "65535",
* });
* //
* // Creates a variable in count format
* //
* const scmVariableCount = new scm.Variable("scm_variable_count", {
* folder: "All",
* name: "$scm_variable_count",
* description: "Managed by Pulumi",
* type: "count",
* value: "15",
* });
* //
* // Creates a variable in fqdn format
* //
* const scmVariableFqdn = new scm.Variable("scm_variable_fqdn", {
* folder: "All",
* name: "$scm_variable_fqdn",
* description: "Managed by Pulumi",
* type: "fqdn",
* value: "scm.example.com",
* });
* //
* // Creates a variable in group-id format
* //
* const scmVariableGroupId = new scm.Variable("scm_variable_group_id", {
* folder: "All",
* name: "$scm_variable_group_id",
* description: "Managed by Pulumi",
* type: "group-id",
* value: "10",
* });
* //
* // Creates a variable in ip-range format
* //
* const scmVariableIprange = new scm.Variable("scm_variable_iprange", {
* folder: "All",
* name: "$scm_variable_iprange",
* description: "Managed by Pulumi",
* type: "ip-range",
* value: "198.18.1.1-198.18.1.100",
* });
* //
* // Creates a variable in ip-netmask format
* //
* const scmVariableIpaddr = new scm.Variable("scm_variable_ipaddr", {
* folder: "All",
* name: "$scm_variable_ipaddr",
* description: "Managed by Pulumi",
* type: "ip-netmask",
* value: "198.18.2.0/24",
* });
* //
* // Creates a variable in ip-wildcard format
* //
* const scmVariableIpwildcard = new scm.Variable("scm_variable_ipwildcard", {
* folder: "All",
* name: "$scm_variable_ipwildcard",
* description: "Managed by Pulumi",
* type: "ip-wildcard",
* value: "198.18.1.0/0.255.255.255",
* });
* //
* // Creates a variable in percent format
* //
* const scmVariablePercent = new scm.Variable("scm_variable_percent", {
* folder: "All",
* name: "$scm_variable_percent",
* description: "Managed by Pulumi",
* type: "percent",
* value: "10",
* });
* //
* // Creates a variable in router-id format
* //
* const scmVariableRouterId = new scm.Variable("scm_variable_router_id", {
* folder: "All",
* name: "$scm_variable_router_id",
* description: "Managed by Pulumi",
* type: "router-id",
* value: "198.18.1.1",
* });
* //
* // Creates a variable in timer format
* //
* const scmVariableTimer = new scm.Variable("scm_variable_timer", {
* folder: "All",
* name: "$scm_variable_timer",
* description: "Managed by Pulumi",
* type: "timer",
* value: "1440",
* });
* //
* // Creates a variable in zone format
* //
* const scmVariableZone = new scm.Variable("scm_variable_zone", {
* folder: "All",
* name: "$scm_variable_zone",
* description: "Managed by Pulumi",
* type: "zone",
* value: "internet",
* });
* ```
*/
class Variable extends pulumi.CustomResource {
/**
* Get an existing Variable 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 Variable(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Variable. 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'] === Variable.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state?.description;
resourceInputs["device"] = state?.device;
resourceInputs["folder"] = state?.folder;
resourceInputs["name"] = state?.name;
resourceInputs["overridden"] = state?.overridden;
resourceInputs["snippet"] = state?.snippet;
resourceInputs["tfid"] = state?.tfid;
resourceInputs["type"] = state?.type;
resourceInputs["value"] = state?.value;
}
else {
const args = argsOrState;
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
if (args?.value === undefined && !opts.urn) {
throw new Error("Missing required property 'value'");
}
resourceInputs["description"] = args?.description;
resourceInputs["device"] = args?.device;
resourceInputs["folder"] = args?.folder;
resourceInputs["name"] = args?.name;
resourceInputs["snippet"] = args?.snippet;
resourceInputs["type"] = args?.type;
resourceInputs["value"] = args?.value;
resourceInputs["overridden"] = undefined /*out*/;
resourceInputs["tfid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Variable.__pulumiType, name, resourceInputs, opts);
}
}
exports.Variable = Variable;
/** @internal */
Variable.__pulumiType = 'scm:index/variable:Variable';
//# sourceMappingURL=variable.js.map