1. Packages
  2. Openstack Provider
  3. API Docs
  4. networking
  5. FloatingIpAssociate
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

openstack.networking.FloatingIpAssociate

Explore with Pulumi AI

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,
});
Copy
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)
Copy
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
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}
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. FloatingIpAssociateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. FloatingIpAssociateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. FloatingIpAssociateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. FloatingIpAssociateArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

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

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

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The FloatingIpAssociate resource accepts the following input properties:

FloatingIp
This property is required.
Changes to this property will trigger replacement.
string
IP Address of an existing floating IP.
PortId This property is required. string
ID of an existing port with at least one IP address to associate with this floating IP.
FixedIp string
Region Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
IP Address of an existing floating IP.
PortId This property is required. string
ID of an existing port with at least one IP address to associate with this floating IP.
FixedIp string
Region Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
String
IP Address of an existing floating IP.
portId This property is required. String
ID of an existing port with at least one IP address to associate with this floating IP.
fixedIp String
region Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
IP Address of an existing floating IP.
portId This property is required. string
ID of an existing port with at least one IP address to associate with this floating IP.
fixedIp string
region Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
str
IP Address of an existing floating IP.
port_id This property is required. str
ID of an existing port with at least one IP address to associate with this floating IP.
fixed_ip str
region Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
String
IP Address of an existing floating IP.
portId This property is required. String
ID of an existing port with at least one IP address to associate with this floating IP.
fixedIp String
region Changes to this property will trigger replacement. 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)
resources:  _:    type: openstack:networking:FloatingIpAssociate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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
Copy

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.