UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

190 lines (189 loc) 6.66 kB
import * as pulumi from "@pulumi/pulumi"; /** * Associates an EIP to a specified IP address or port. * * ## Example Usage * ### Associate with a fixed IP * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const publicAddress = config.requireObject("publicAddress"); * const networkId = config.requireObject("networkId"); * const associated = new huaweicloud.vpc.EipAssociate("associated", { * publicIp: publicAddress, * networkId: networkId, * fixedIp: "192.168.0.100", * }); * ``` * ### Associate with a port * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const networkId = config.requireObject("networkId"); * const myport = huaweicloud.Vpc.getPort({ * networkId: networkId, * fixedIp: "192.168.0.100", * }); * const myeip = new huaweicloud.vpc.Eip("myeip", { * publicip: { * type: "5_bgp", * }, * bandwidth: { * name: "test", * size: 5, * shareType: "PER", * chargeMode: "traffic", * }, * }); * const associated = new huaweicloud.vpc.EipAssociate("associated", { * publicIp: myeip.address, * portId: myport.then(myport => myport.id), * }); * ``` * * ## Import * * EIP associations can be imported using the `id` of the EIP, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/eipAssociate:EipAssociate eip 2c7f39f3-702b-48d1-940c-b50384177ee1 * ``` */ export declare class EipAssociate extends pulumi.CustomResource { /** * Get an existing EipAssociate 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?: EipAssociateState, opts?: pulumi.CustomResourceOptions): EipAssociate; /** * Returns true if the given object is an instance of EipAssociate. 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 EipAssociate; /** * Specifies a private IP address to associate with the EIP. * Changing this creates a new resource. */ readonly fixedIp: pulumi.Output<string>; /** * The MAC address of the private IP. */ readonly macAddress: pulumi.Output<string>; /** * Specifies the ID of the network to which the **fixed_ip** belongs. * It is mandatory when `fixedIp` is set. Changing this creates a new resource. */ readonly networkId: pulumi.Output<string>; /** * Specifies an existing port ID to associate with the EIP. * This parameter and `fixedIp` are alternative. Changing this creates a new resource. */ readonly portId: pulumi.Output<string>; /** * Specifies the EIP address to associate. Changing this creates a new resource. */ readonly publicIp: pulumi.Output<string>; /** * The IPv6 address of the private IP. */ readonly publicIpv6: pulumi.Output<string>; /** * Specifies the region in which to associate the EIP. If omitted, the provider-level * region will be used. Changing this creates a new resource. */ readonly region: pulumi.Output<string>; /** * The status of EIP, should be **BOUND**. */ readonly status: pulumi.Output<string>; /** * Create a EipAssociate 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: EipAssociateArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering EipAssociate resources. */ export interface EipAssociateState { /** * Specifies a private IP address to associate with the EIP. * Changing this creates a new resource. */ fixedIp?: pulumi.Input<string>; /** * The MAC address of the private IP. */ macAddress?: pulumi.Input<string>; /** * Specifies the ID of the network to which the **fixed_ip** belongs. * It is mandatory when `fixedIp` is set. Changing this creates a new resource. */ networkId?: pulumi.Input<string>; /** * Specifies an existing port ID to associate with the EIP. * This parameter and `fixedIp` are alternative. Changing this creates a new resource. */ portId?: pulumi.Input<string>; /** * Specifies the EIP address to associate. Changing this creates a new resource. */ publicIp?: pulumi.Input<string>; /** * The IPv6 address of the private IP. */ publicIpv6?: pulumi.Input<string>; /** * Specifies the region in which to associate the EIP. If omitted, the provider-level * region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * The status of EIP, should be **BOUND**. */ status?: pulumi.Input<string>; } /** * The set of arguments for constructing a EipAssociate resource. */ export interface EipAssociateArgs { /** * Specifies a private IP address to associate with the EIP. * Changing this creates a new resource. */ fixedIp?: pulumi.Input<string>; /** * Specifies the ID of the network to which the **fixed_ip** belongs. * It is mandatory when `fixedIp` is set. Changing this creates a new resource. */ networkId?: pulumi.Input<string>; /** * Specifies an existing port ID to associate with the EIP. * This parameter and `fixedIp` are alternative. Changing this creates a new resource. */ portId?: pulumi.Input<string>; /** * Specifies the EIP address to associate. Changing this creates a new resource. */ publicIp: pulumi.Input<string>; /** * Specifies the region in which to associate the EIP. If omitted, the provider-level * region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; }