1. Packages
  2. OpenStack
  3. API Docs
  4. networking
  5. FloatingIpAssociate
OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi

openstack.networking.FloatingIpAssociate

Explore with Pulumi AI

openstack logo
OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi

    Associates a floating IP to a port. This is useful for situations where you have a pre-allocated floating IP or are unable to use the openstack.networking.FloatingIp resource to create a floating IP.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const port1 = new openstack.networking.Port("port_1", {networkId: "a5bbd213-e1d3-49b6-aed1-9df60ea94b9a"});
    const fip1 = new openstack.networking.FloatingIpAssociate("fip_1", {
        floatingIp: "1.2.3.4",
        portId: port1.id,
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    port1 = openstack.networking.Port("port_1", network_id="a5bbd213-e1d3-49b6-aed1-9df60ea94b9a")
    fip1 = openstack.networking.FloatingIpAssociate("fip_1",
        floating_ip="1.2.3.4",
        port_id=port1.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v4/go/openstack/networking"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		port1, err := networking.NewPort(ctx, "port_1", &networking.PortArgs{
    			NetworkId: pulumi.String("a5bbd213-e1d3-49b6-aed1-9df60ea94b9a"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = networking.NewFloatingIpAssociate(ctx, "fip_1", &networking.FloatingIpAssociateArgs{
    			FloatingIp: pulumi.String("1.2.3.4"),
    			PortId:     port1.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var port1 = new OpenStack.Networking.Port("port_1", new()
        {
            NetworkId = "a5bbd213-e1d3-49b6-aed1-9df60ea94b9a",
        });
    
        var fip1 = new OpenStack.Networking.FloatingIpAssociate("fip_1", new()
        {
            FloatingIp = "1.2.3.4",
            PortId = port1.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.networking.Port;
    import com.pulumi.openstack.networking.PortArgs;
    import com.pulumi.openstack.networking.FloatingIpAssociate;
    import com.pulumi.openstack.networking.FloatingIpAssociateArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var port1 = new Port("port1", PortArgs.builder()        
                .networkId("a5bbd213-e1d3-49b6-aed1-9df60ea94b9a")
                .build());
    
            var fip1 = new FloatingIpAssociate("fip1", FloatingIpAssociateArgs.builder()        
                .floatingIp("1.2.3.4")
                .portId(port1.id())
                .build());
    
        }
    }
    
    resources:
      port1:
        type: openstack:networking:Port
        name: port_1
        properties:
          networkId: a5bbd213-e1d3-49b6-aed1-9df60ea94b9a
      fip1:
        type: openstack:networking:FloatingIpAssociate
        name: fip_1
        properties:
          floatingIp: 1.2.3.4
          portId: ${port1.id}
    

    Create FloatingIpAssociate Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new FloatingIpAssociate(name: string, args: FloatingIpAssociateArgs, opts?: CustomResourceOptions);
    @overload
    def FloatingIpAssociate(resource_name: str,
                            args: FloatingIpAssociateArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def FloatingIpAssociate(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            floating_ip: Optional[str] = None,
                            port_id: Optional[str] = None,
                            fixed_ip: Optional[str] = None,
                            region: Optional[str] = None)
    func NewFloatingIpAssociate(ctx *Context, name string, args FloatingIpAssociateArgs, opts ...ResourceOption) (*FloatingIpAssociate, error)
    public FloatingIpAssociate(string name, FloatingIpAssociateArgs args, CustomResourceOptions? opts = null)
    public FloatingIpAssociate(String name, FloatingIpAssociateArgs args)
    public FloatingIpAssociate(String name, FloatingIpAssociateArgs args, CustomResourceOptions options)
    
    type: openstack:networking:FloatingIpAssociate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args FloatingIpAssociateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args FloatingIpAssociateArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args FloatingIpAssociateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FloatingIpAssociateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FloatingIpAssociateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var openstackFloatingIpAssociateResource = new OpenStack.Networking.FloatingIpAssociate("openstackFloatingIpAssociateResource", new()
    {
        FloatingIp = "string",
        PortId = "string",
        FixedIp = "string",
        Region = "string",
    });
    
    example, err := networking.NewFloatingIpAssociate(ctx, "openstackFloatingIpAssociateResource", &networking.FloatingIpAssociateArgs{
    	FloatingIp: pulumi.String("string"),
    	PortId:     pulumi.String("string"),
    	FixedIp:    pulumi.String("string"),
    	Region:     pulumi.String("string"),
    })
    
    var openstackFloatingIpAssociateResource = new FloatingIpAssociate("openstackFloatingIpAssociateResource", FloatingIpAssociateArgs.builder()
        .floatingIp("string")
        .portId("string")
        .fixedIp("string")
        .region("string")
        .build());
    
    openstack_floating_ip_associate_resource = openstack.networking.FloatingIpAssociate("openstackFloatingIpAssociateResource",
        floating_ip="string",
        port_id="string",
        fixed_ip="string",
        region="string")
    
    const openstackFloatingIpAssociateResource = new openstack.networking.FloatingIpAssociate("openstackFloatingIpAssociateResource", {
        floatingIp: "string",
        portId: "string",
        fixedIp: "string",
        region: "string",
    });
    
    type: openstack:networking:FloatingIpAssociate
    properties:
        fixedIp: string
        floatingIp: string
        portId: string
        region: string
    

    FloatingIpAssociate Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The FloatingIpAssociate resource accepts the following input properties:

    FloatingIp string
    IP Address of an existing floating IP.
    PortId string
    ID of an existing port with at least one IP address to associate with this floating IP.
    FixedIp string
    Region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    FloatingIp string
    IP Address of an existing floating IP.
    PortId string
    ID of an existing port with at least one IP address to associate with this floating IP.
    FixedIp string
    Region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    floatingIp String
    IP Address of an existing floating IP.
    portId String
    ID of an existing port with at least one IP address to associate with this floating IP.
    fixedIp String
    region String
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    floatingIp string
    IP Address of an existing floating IP.
    portId string
    ID of an existing port with at least one IP address to associate with this floating IP.
    fixedIp string
    region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    floating_ip str
    IP Address of an existing floating IP.
    port_id str
    ID of an existing port with at least one IP address to associate with this floating IP.
    fixed_ip str
    region str
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    floatingIp String
    IP Address of an existing floating IP.
    portId String
    ID of an existing port with at least one IP address to associate with this floating IP.
    fixedIp String
    region String
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).

    Outputs

    All input properties are implicitly available as output properties. Additionally, the FloatingIpAssociate resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing FloatingIpAssociate Resource

    Get an existing FloatingIpAssociate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: FloatingIpAssociateState, opts?: CustomResourceOptions): FloatingIpAssociate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            fixed_ip: Optional[str] = None,
            floating_ip: Optional[str] = None,
            port_id: Optional[str] = None,
            region: Optional[str] = None) -> FloatingIpAssociate
    func GetFloatingIpAssociate(ctx *Context, name string, id IDInput, state *FloatingIpAssociateState, opts ...ResourceOption) (*FloatingIpAssociate, error)
    public static FloatingIpAssociate Get(string name, Input<string> id, FloatingIpAssociateState? state, CustomResourceOptions? opts = null)
    public static FloatingIpAssociate get(String name, Output<String> id, FloatingIpAssociateState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    FixedIp string
    FloatingIp string
    IP Address of an existing floating IP.
    PortId string
    ID of an existing port with at least one IP address to associate with this floating IP.
    Region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    FixedIp string
    FloatingIp string
    IP Address of an existing floating IP.
    PortId string
    ID of an existing port with at least one IP address to associate with this floating IP.
    Region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    fixedIp String
    floatingIp String
    IP Address of an existing floating IP.
    portId String
    ID of an existing port with at least one IP address to associate with this floating IP.
    region String
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    fixedIp string
    floatingIp string
    IP Address of an existing floating IP.
    portId string
    ID of an existing port with at least one IP address to associate with this floating IP.
    region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    fixed_ip str
    floating_ip str
    IP Address of an existing floating IP.
    port_id str
    ID of an existing port with at least one IP address to associate with this floating IP.
    region str
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).
    fixedIp String
    floatingIp String
    IP Address of an existing floating IP.
    portId String
    ID of an existing port with at least one IP address to associate with this floating IP.
    region String
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a floating IP that can be used with another networking resource, such as a load balancer. If omitted, the region argument of the provider is used. Changing this creates a new floating IP (which may or may not have a different address).

    Import

    Floating IP associations can be imported using the id of the floating IP, e.g.

    $ pulumi import openstack:networking/floatingIpAssociate:FloatingIpAssociate fip 2c7f39f3-702b-48d1-940c-b50384177ee1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi