@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
94 lines • 4.14 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.NetworkInterfaceAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Attach an Elastic network interface (ENI) resource with EC2 instance.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.ec2.NetworkInterfaceAttachment("test", {
* instanceId: testAwsInstance.id,
* networkInterfaceId: testAwsNetworkInterface.id,
* deviceIndex: 0,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Elastic network interface (ENI) Attachments using its Attachment ID. For example:
*
* ```sh
* $ pulumi import aws:ec2/networkInterfaceAttachment:NetworkInterfaceAttachment secondary_nic eni-attach-0a33842b4ec347c4c
* ```
*/
class NetworkInterfaceAttachment extends pulumi.CustomResource {
/**
* Get an existing NetworkInterfaceAttachment 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 NetworkInterfaceAttachment(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of NetworkInterfaceAttachment. 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'] === NetworkInterfaceAttachment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["attachmentId"] = state?.attachmentId;
resourceInputs["deviceIndex"] = state?.deviceIndex;
resourceInputs["instanceId"] = state?.instanceId;
resourceInputs["networkCardIndex"] = state?.networkCardIndex;
resourceInputs["networkInterfaceId"] = state?.networkInterfaceId;
resourceInputs["region"] = state?.region;
resourceInputs["status"] = state?.status;
}
else {
const args = argsOrState;
if (args?.deviceIndex === undefined && !opts.urn) {
throw new Error("Missing required property 'deviceIndex'");
}
if (args?.instanceId === undefined && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
if (args?.networkInterfaceId === undefined && !opts.urn) {
throw new Error("Missing required property 'networkInterfaceId'");
}
resourceInputs["deviceIndex"] = args?.deviceIndex;
resourceInputs["instanceId"] = args?.instanceId;
resourceInputs["networkCardIndex"] = args?.networkCardIndex;
resourceInputs["networkInterfaceId"] = args?.networkInterfaceId;
resourceInputs["region"] = args?.region;
resourceInputs["attachmentId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkInterfaceAttachment.__pulumiType, name, resourceInputs, opts);
}
}
exports.NetworkInterfaceAttachment = NetworkInterfaceAttachment;
/** @internal */
NetworkInterfaceAttachment.__pulumiType = 'aws:ec2/networkInterfaceAttachment:NetworkInterfaceAttachment';
//# sourceMappingURL=networkInterfaceAttachment.js.map