UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

129 lines 5.11 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.SharedConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage cdn shared config * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const foo = new volcengine.cdn.SharedConfig("foo", { * allowIpAccessRule: { * rules: [ * "1.1.1.1", * "2.2.2.0/24", * "3.3.3.3", * ], * }, * allowRefererAccessRule: { * commonType: { * rules: [ * "1.1.1.1", * "2.2.2.0/24", * "3.3.4.4", * ], * }, * }, * commonMatchList: { * commonType: { * rules: [ * "1.1.1.1", * "2.2.2.0/24", * ], * }, * }, * configName: "tftest", * configType: "allow_referer_access_rule", * denyIpAccessRule: { * rules: [ * "1.1.1.1", * "2.2.2.0/24", * ], * }, * denyRefererAccessRule: { * commonType: { * rules: [ * "1.1.1.1", * "2.2.2.0/24", * ], * }, * }, * }); * ``` * * ## Import * * CdnSharedConfig can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:cdn/sharedConfig:SharedConfig default resource_id * ``` */ class SharedConfig extends pulumi.CustomResource { /** * Get an existing SharedConfig 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 SharedConfig(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SharedConfig. 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'] === SharedConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowIpAccessRule"] = state ? state.allowIpAccessRule : undefined; resourceInputs["allowRefererAccessRule"] = state ? state.allowRefererAccessRule : undefined; resourceInputs["commonMatchList"] = state ? state.commonMatchList : undefined; resourceInputs["configName"] = state ? state.configName : undefined; resourceInputs["configType"] = state ? state.configType : undefined; resourceInputs["denyIpAccessRule"] = state ? state.denyIpAccessRule : undefined; resourceInputs["denyRefererAccessRule"] = state ? state.denyRefererAccessRule : undefined; resourceInputs["projectName"] = state ? state.projectName : undefined; } else { const args = argsOrState; if ((!args || args.configName === undefined) && !opts.urn) { throw new Error("Missing required property 'configName'"); } if ((!args || args.configType === undefined) && !opts.urn) { throw new Error("Missing required property 'configType'"); } resourceInputs["allowIpAccessRule"] = args ? args.allowIpAccessRule : undefined; resourceInputs["allowRefererAccessRule"] = args ? args.allowRefererAccessRule : undefined; resourceInputs["commonMatchList"] = args ? args.commonMatchList : undefined; resourceInputs["configName"] = args ? args.configName : undefined; resourceInputs["configType"] = args ? args.configType : undefined; resourceInputs["denyIpAccessRule"] = args ? args.denyIpAccessRule : undefined; resourceInputs["denyRefererAccessRule"] = args ? args.denyRefererAccessRule : undefined; resourceInputs["projectName"] = args ? args.projectName : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SharedConfig.__pulumiType, name, resourceInputs, opts); } } exports.SharedConfig = SharedConfig; /** @internal */ SharedConfig.__pulumiType = 'volcengine:cdn/sharedConfig:SharedConfig'; //# sourceMappingURL=sharedConfig.js.map