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,
});
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/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
})
}
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.
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",
});
example, err := networking.NewFloatingIpAssociate(ctx, "floatingIpAssociateResource", &networking.FloatingIpAssociateArgs{
FloatingIp: pulumi.String("string"),
PortId: pulumi.String("string"),
FixedIp: pulumi.String("string"),
Region: pulumi.String("string"),
})
var floatingIpAssociateResource = new FloatingIpAssociate("floatingIpAssociateResource", FloatingIpAssociateArgs.builder()
.floatingIp("string")
.portId("string")
.fixedIp("string")
.region("string")
.build());
floating_ip_associate_resource = openstack.networking.FloatingIpAssociate("floatingIpAssociateResource",
floating_ip="string",
port_id="string",
fixed_ip="string",
region="string")
const floatingIpAssociateResource = new openstack.networking.FloatingIpAssociate("floatingIpAssociateResource", {
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
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:
- Floating
Ip string - IP Address of an existing floating IP.
- Port
Id string - ID of an existing port with at least one IP address to associate with this floating IP.
- Fixed
Ip 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 string - IP Address of an existing floating IP.
- Port
Id string - ID of an existing port with at least one IP address to associate with this floating IP.
- Fixed
Ip 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 String - IP Address of an existing floating IP.
- port
Id String - ID of an existing port with at least one IP address to associate with this floating IP.
- fixed
Ip 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 string - IP Address of an existing floating IP.
- port
Id string - ID of an existing port with at least one IP address to associate with this floating IP.
- fixed
Ip 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).
- floating
Ip String - IP Address of an existing floating IP.
- port
Id String - ID of an existing port with at least one IP address to associate with this floating IP.
- fixed
Ip 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.
- Fixed
Ip string - Floating
Ip string - IP Address of an existing floating IP.
- Port
Id 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 string - Floating
Ip string - IP Address of an existing floating IP.
- Port
Id 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 String - floating
Ip String - IP Address of an existing floating IP.
- port
Id 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 string - floating
Ip string - IP Address of an existing floating IP.
- port
Id 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).
- fixed
Ip String - floating
Ip String - IP Address of an existing floating IP.
- port
Id 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.