UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

111 lines 5.67 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.NetworkInterface = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a VPC network interface resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const name = config.requireObject("name"); * const subnetId = config.requireObject("subnetId"); * const test = new huaweicloud.vpc.NetworkInterface("test", {subnetId: subnetId}); * ``` * * ## Import * * The network interface can be imported using `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/networkInterface:NetworkInterface test <id> * ``` */ class NetworkInterface extends pulumi.CustomResource { /** * Get an existing NetworkInterface 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 NetworkInterface(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of NetworkInterface. 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'] === NetworkInterface.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowedAddresses"] = state ? state.allowedAddresses : undefined; resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined; resourceInputs["deviceId"] = state ? state.deviceId : undefined; resourceInputs["deviceOwner"] = state ? state.deviceOwner : undefined; resourceInputs["dhcpLeaseTime"] = state ? state.dhcpLeaseTime : undefined; resourceInputs["dnsName"] = state ? state.dnsName : undefined; resourceInputs["enableEfi"] = state ? state.enableEfi : undefined; resourceInputs["fixedIpV4"] = state ? state.fixedIpV4 : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["instanceType"] = state ? state.instanceType : undefined; resourceInputs["ipv6BandwidthId"] = state ? state.ipv6BandwidthId : undefined; resourceInputs["macAddress"] = state ? state.macAddress : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["portSecurityEnabled"] = state ? state.portSecurityEnabled : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["securityGroupIds"] = state ? state.securityGroupIds : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; resourceInputs["tags"] = state ? state.tags : undefined; } else { const args = argsOrState; if ((!args || args.subnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } resourceInputs["allowedAddresses"] = args ? args.allowedAddresses : undefined; resourceInputs["dhcpLeaseTime"] = args ? args.dhcpLeaseTime : undefined; resourceInputs["fixedIpV4"] = args ? args.fixedIpV4 : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["availabilityZone"] = undefined /*out*/; resourceInputs["deviceId"] = undefined /*out*/; resourceInputs["deviceOwner"] = undefined /*out*/; resourceInputs["dnsName"] = undefined /*out*/; resourceInputs["enableEfi"] = undefined /*out*/; resourceInputs["instanceId"] = undefined /*out*/; resourceInputs["instanceType"] = undefined /*out*/; resourceInputs["ipv6BandwidthId"] = undefined /*out*/; resourceInputs["macAddress"] = undefined /*out*/; resourceInputs["portSecurityEnabled"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NetworkInterface.__pulumiType, name, resourceInputs, opts); } } exports.NetworkInterface = NetworkInterface; /** @internal */ NetworkInterface.__pulumiType = 'huaweicloud:Vpc/networkInterface:NetworkInterface'; //# sourceMappingURL=networkInterface.js.map