@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
193 lines (192 loc) • 6.93 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Attaches a Network Interface (a Port) to an Instance using the OpenStack
* Compute (Nova) v2 API.
*
* ## Example Usage
*
* ### Basic Attachment
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const network1 = new openstack.networking.Network("network_1", {
* name: "network_1",
* adminStateUp: true,
* });
* const instance1 = new openstack.compute.Instance("instance_1", {
* name: "instance_1",
* securityGroups: ["default"],
* });
* const ai1 = new openstack.compute.InterfaceAttach("ai_1", {
* instanceId: instance1.id,
* networkId: network1.id,
* });
* ```
*
* ### Attachment Specifying a Fixed IP
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const network1 = new openstack.networking.Network("network_1", {
* name: "network_1",
* adminStateUp: true,
* });
* const instance1 = new openstack.compute.Instance("instance_1", {
* name: "instance_1",
* securityGroups: ["default"],
* });
* const ai1 = new openstack.compute.InterfaceAttach("ai_1", {
* instanceId: instance1.id,
* networkId: network1OpenstackNetworkingPortV2.id,
* fixedIp: "10.0.10.10",
* });
* ```
*
* ### Attachment Using an Existing Port
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const network1 = new openstack.networking.Network("network_1", {
* name: "network_1",
* adminStateUp: true,
* });
* const port1 = new openstack.networking.Port("port_1", {
* name: "port_1",
* networkId: network1.id,
* adminStateUp: true,
* });
* const instance1 = new openstack.compute.Instance("instance_1", {
* name: "instance_1",
* securityGroups: ["default"],
* });
* const ai1 = new openstack.compute.InterfaceAttach("ai_1", {
* instanceId: instance1.id,
* portId: port1.id,
* });
* ```
*
* ## Import
*
* Interface Attachments can be imported using the Instance ID and Port ID
* separated by a slash, e.g.
*
* ```sh
* $ pulumi import openstack:compute/interfaceAttach:InterfaceAttach ai_1 89c60255-9bd6-460c-822a-e2b959ede9d2/45670584-225f-46c3-b33e-6707b589b666
* ```
*/
export declare class InterfaceAttach extends pulumi.CustomResource {
/**
* Get an existing InterfaceAttach 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: string, id: pulumi.Input<pulumi.ID>, state?: InterfaceAttachState, opts?: pulumi.CustomResourceOptions): InterfaceAttach;
/**
* Returns true if the given object is an instance of InterfaceAttach. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is InterfaceAttach;
/**
* An IP address to assosciate with the port.
* _NOTE_: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
*/
readonly fixedIp: pulumi.Output<string>;
/**
* The ID of the Instance to attach the Port or Network to.
*/
readonly instanceId: pulumi.Output<string>;
/**
* The ID of the Network to attach to an Instance. A port will be created automatically.
* _NOTE_: This option and `portId` are mutually exclusive.
*/
readonly networkId: pulumi.Output<string>;
/**
* The ID of the Port to attach to an Instance.
* _NOTE_: This option and `networkId` are mutually exclusive.
*/
readonly portId: pulumi.Output<string>;
/**
* The region in which to create the interface attachment.
* If omitted, the `region` argument of the provider is used. Changing this
* creates a new attachment.
*/
readonly region: pulumi.Output<string>;
/**
* Create a InterfaceAttach resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: InterfaceAttachArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering InterfaceAttach resources.
*/
export interface InterfaceAttachState {
/**
* An IP address to assosciate with the port.
* _NOTE_: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
*/
fixedIp?: pulumi.Input<string>;
/**
* The ID of the Instance to attach the Port or Network to.
*/
instanceId?: pulumi.Input<string>;
/**
* The ID of the Network to attach to an Instance. A port will be created automatically.
* _NOTE_: This option and `portId` are mutually exclusive.
*/
networkId?: pulumi.Input<string>;
/**
* The ID of the Port to attach to an Instance.
* _NOTE_: This option and `networkId` are mutually exclusive.
*/
portId?: pulumi.Input<string>;
/**
* The region in which to create the interface attachment.
* If omitted, the `region` argument of the provider is used. Changing this
* creates a new attachment.
*/
region?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a InterfaceAttach resource.
*/
export interface InterfaceAttachArgs {
/**
* An IP address to assosciate with the port.
* _NOTE_: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
*/
fixedIp?: pulumi.Input<string>;
/**
* The ID of the Instance to attach the Port or Network to.
*/
instanceId: pulumi.Input<string>;
/**
* The ID of the Network to attach to an Instance. A port will be created automatically.
* _NOTE_: This option and `portId` are mutually exclusive.
*/
networkId?: pulumi.Input<string>;
/**
* The ID of the Port to attach to an Instance.
* _NOTE_: This option and `networkId` are mutually exclusive.
*/
portId?: pulumi.Input<string>;
/**
* The region in which to create the interface attachment.
* If omitted, the `region` argument of the provider is used. Changing this
* creates a new attachment.
*/
region?: pulumi.Input<string>;
}