@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
110 lines • 5.34 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.SubNetworkInterface = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a supplementary 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 subnetId = config.requireObject("subnetId");
* const parentId = config.requireObject("parentId");
* const vlanId = config.requireObject("vlanId");
* const test = new huaweicloud.vpc.SubNetworkInterface("test", {
* subnetId: subnetId,
* parentId: parentId,
* vlanId: vlanId,
* description: "create a supplementary network interface",
* });
* ```
*
* ## Import
*
* The supplementary network interface can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vpc/subNetworkInterface:SubNetworkInterface test <id>
* ```
*/
class SubNetworkInterface extends pulumi.CustomResource {
/**
* Get an existing SubNetworkInterface 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 SubNetworkInterface(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SubNetworkInterface. 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'] === SubNetworkInterface.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["ipAddress"] = state ? state.ipAddress : undefined;
resourceInputs["ipv6Enable"] = state ? state.ipv6Enable : undefined;
resourceInputs["ipv6IpAddress"] = state ? state.ipv6IpAddress : undefined;
resourceInputs["macAddress"] = state ? state.macAddress : undefined;
resourceInputs["parentDeviceId"] = state ? state.parentDeviceId : undefined;
resourceInputs["parentId"] = state ? state.parentId : 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["vlanId"] = state ? state.vlanId : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.parentId === undefined) && !opts.urn) {
throw new Error("Missing required property 'parentId'");
}
if ((!args || args.subnetId === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetId'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["ipAddress"] = args ? args.ipAddress : undefined;
resourceInputs["ipv6Enable"] = args ? args.ipv6Enable : undefined;
resourceInputs["ipv6IpAddress"] = args ? args.ipv6IpAddress : undefined;
resourceInputs["parentId"] = args ? args.parentId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["vlanId"] = args ? args.vlanId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["macAddress"] = undefined /*out*/;
resourceInputs["parentDeviceId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["vpcId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SubNetworkInterface.__pulumiType, name, resourceInputs, opts);
}
}
exports.SubNetworkInterface = SubNetworkInterface;
/** @internal */
SubNetworkInterface.__pulumiType = 'huaweicloud:Vpc/subNetworkInterface:SubNetworkInterface';
//# sourceMappingURL=subNetworkInterface.js.map