UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

101 lines 4.37 kB
"use strict"; // *** 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.NetworkInterfacePermission = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Grant cross-account access to an Elastic network interface (ENI). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.NetworkInterface("example", { * subnetId: exampleAwsSubnet.id, * privateIps: ["10.0.0.50"], * securityGroups: [exampleAwsSecurityGroup.id], * attachments: [{ * instance: exampleAwsInstance.id, * deviceIndex: 1, * }], * }); * const exampleNetworkInterfacePermission = new aws.ec2.NetworkInterfacePermission("example", { * networkInterfaceId: example.id, * awsAccountId: "123456789012", * permission: "INSTANCE-ATTACH", * }); * ``` * * ## Import * * Using `pulumi import`, import Network Interface Permissions using the `network_interface_permission_id`. For example: * * ```sh * $ pulumi import aws:ec2/networkInterfacePermission:NetworkInterfacePermission example eni-perm-056ad97ce2ac377ed * ``` */ class NetworkInterfacePermission extends pulumi.CustomResource { /** * Get an existing NetworkInterfacePermission 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 NetworkInterfacePermission(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of NetworkInterfacePermission. 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'] === NetworkInterfacePermission.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["awsAccountId"] = state?.awsAccountId; resourceInputs["networkInterfaceId"] = state?.networkInterfaceId; resourceInputs["networkInterfacePermissionId"] = state?.networkInterfacePermissionId; resourceInputs["permission"] = state?.permission; resourceInputs["region"] = state?.region; resourceInputs["timeouts"] = state?.timeouts; } else { const args = argsOrState; if (args?.awsAccountId === undefined && !opts.urn) { throw new Error("Missing required property 'awsAccountId'"); } if (args?.networkInterfaceId === undefined && !opts.urn) { throw new Error("Missing required property 'networkInterfaceId'"); } if (args?.permission === undefined && !opts.urn) { throw new Error("Missing required property 'permission'"); } resourceInputs["awsAccountId"] = args?.awsAccountId; resourceInputs["networkInterfaceId"] = args?.networkInterfaceId; resourceInputs["permission"] = args?.permission; resourceInputs["region"] = args?.region; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["networkInterfacePermissionId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NetworkInterfacePermission.__pulumiType, name, resourceInputs, opts); } } exports.NetworkInterfacePermission = NetworkInterfacePermission; /** @internal */ NetworkInterfacePermission.__pulumiType = 'aws:ec2/networkInterfacePermission:NetworkInterfacePermission'; //# sourceMappingURL=networkInterfacePermission.js.map