@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
95 lines • 3.69 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.AntiVirus = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a CFW anti virus resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const objectId = config.requireObject("objectId");
* const test = new huaweicloud.cfw.AntiVirus("test", {
* objectId: objectId,
* scanProtocolConfigs: [
* {
* protocolType: 3,
* action: 1,
* },
* {
* protocolType: 2,
* action: 1,
* },
* ],
* });
* ```
*
* ## Import
*
* The anti virus can be imported using `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cfw/antiVirus:AntiVirus test <id>
* ```
*/
class AntiVirus extends pulumi.CustomResource {
/**
* Get an existing AntiVirus 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 AntiVirus(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AntiVirus. 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'] === AntiVirus.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["enableForceNew"] = state ? state.enableForceNew : undefined;
resourceInputs["objectId"] = state ? state.objectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["scanProtocolConfigs"] = state ? state.scanProtocolConfigs : undefined;
}
else {
const args = argsOrState;
if ((!args || args.objectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'objectId'");
}
if ((!args || args.scanProtocolConfigs === undefined) && !opts.urn) {
throw new Error("Missing required property 'scanProtocolConfigs'");
}
resourceInputs["enableForceNew"] = args ? args.enableForceNew : undefined;
resourceInputs["objectId"] = args ? args.objectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["scanProtocolConfigs"] = args ? args.scanProtocolConfigs : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AntiVirus.__pulumiType, name, resourceInputs, opts);
}
}
exports.AntiVirus = AntiVirus;
/** @internal */
AntiVirus.__pulumiType = 'huaweicloud:Cfw/antiVirus:AntiVirus';
//# sourceMappingURL=antiVirus.js.map