FloatingIpAssociate

Associate a floating IP to an instance. This can be used instead of the floating_ip options in openstack.compute.Instance.

Example Usage

Automatically detect the correct network

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var instance1 = new OpenStack.Compute.Instance("instance1", new OpenStack.Compute.InstanceArgs
        {
            FlavorId = "3",
            ImageId = "ad091b52-742f-469e-8f3c-fd81cadf0743",
            KeyPair = "my_key_pair_name",
            SecurityGroups = 
            {
                "default",
            },
        });
        var fip1FloatingIp = new OpenStack.Networking.FloatingIp("fip1FloatingIp", new OpenStack.Networking.FloatingIpArgs
        {
            Pool = "my_pool",
        });
        var fip1FloatingIpAssociate = new OpenStack.Compute.FloatingIpAssociate("fip1FloatingIpAssociate", new OpenStack.Compute.FloatingIpAssociateArgs
        {
            FloatingIp = fip1FloatingIp.Address,
            InstanceId = instance1.Id,
        });
    }

}

Coming soon!

import pulumi
import pulumi_openstack as openstack

instance1 = openstack.compute.Instance("instance1",
    flavor_id=3,
    image_id="ad091b52-742f-469e-8f3c-fd81cadf0743",
    key_pair="my_key_pair_name",
    security_groups=["default"])
fip1_floating_ip = openstack.networking.FloatingIp("fip1FloatingIp", pool="my_pool")
fip1_floating_ip_associate = openstack.compute.FloatingIpAssociate("fip1FloatingIpAssociate",
    floating_ip=fip1_floating_ip.address,
    instance_id=instance1.id)
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const instance1 = new openstack.compute.Instance("instance_1", {
    flavorId: "3",
    imageId: "ad091b52-742f-469e-8f3c-fd81cadf0743",
    keyPair: "my_key_pair_name",
    securityGroups: ["default"],
});
const fip1FloatingIp = new openstack.networking.FloatingIp("fip_1", {
    pool: "my_pool",
});
const fip1FloatingIpAssociate = new openstack.compute.FloatingIpAssociate("fip_1", {
    floatingIp: fip1FloatingIp.address,
    instanceId: instance1.id,
});

Explicitly set the network to attach to

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var instance1 = new OpenStack.Compute.Instance("instance1", new OpenStack.Compute.InstanceArgs
        {
            FlavorId = "3",
            ImageId = "ad091b52-742f-469e-8f3c-fd81cadf0743",
            KeyPair = "my_key_pair_name",
            Networks = 
            {
                new OpenStack.Compute.Inputs.InstanceNetworkArgs
                {
                    Name = "my_network",
                },
                new OpenStack.Compute.Inputs.InstanceNetworkArgs
                {
                    Name = "default",
                },
            },
            SecurityGroups = 
            {
                "default",
            },
        });
        var fip1FloatingIp = new OpenStack.Networking.FloatingIp("fip1FloatingIp", new OpenStack.Networking.FloatingIpArgs
        {
            Pool = "my_pool",
        });
        var fip1FloatingIpAssociate = new OpenStack.Compute.FloatingIpAssociate("fip1FloatingIpAssociate", new OpenStack.Compute.FloatingIpAssociateArgs
        {
            FixedIp = instance1.Networks.Apply(networks => networks[1].FixedIpV4),
            FloatingIp = fip1FloatingIp.Address,
            InstanceId = instance1.Id,
        });
    }

}

Coming soon!

import pulumi
import pulumi_openstack as openstack

instance1 = openstack.compute.Instance("instance1",
    flavor_id=3,
    image_id="ad091b52-742f-469e-8f3c-fd81cadf0743",
    key_pair="my_key_pair_name",
    networks=[
        {
            "name": "my_network",
        },
        {
            "name": "default",
        },
    ],
    security_groups=["default"])
fip1_floating_ip = openstack.networking.FloatingIp("fip1FloatingIp", pool="my_pool")
fip1_floating_ip_associate = openstack.compute.FloatingIpAssociate("fip1FloatingIpAssociate",
    fixed_ip=instance1.networks[1]["fixedIpV4"],
    floating_ip=fip1_floating_ip.address,
    instance_id=instance1.id)
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const instance1 = new openstack.compute.Instance("instance_1", {
    flavorId: "3",
    imageId: "ad091b52-742f-469e-8f3c-fd81cadf0743",
    keyPair: "my_key_pair_name",
    networks: [
        {
            name: "my_network",
        },
        {
            name: "default",
        },
    ],
    securityGroups: ["default"],
});
const fip1FloatingIp = new openstack.networking.FloatingIp("fip_1", {
    pool: "my_pool",
});
const fip1FloatingIpAssociate = new openstack.compute.FloatingIpAssociate("fip_1", {
    fixedIp: instance1.networks.apply(networks => networks[1].fixedIpV4!),
    floatingIp: fip1FloatingIp.address,
    instanceId: instance1.id,
});

Create a FloatingIpAssociate Resource

def FloatingIpAssociate(resource_name, opts=None, fixed_ip=None, floating_ip=None, instance_id=None, region=None, wait_until_associated=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this 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.

FloatingIpAssociate Resource Properties

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

Inputs

The FloatingIpAssociate resource accepts the following input properties:

FloatingIp string

The floating IP to associate.

InstanceId string

The instance to associte the floating IP with.

FixedIp string

The specific IP address to direct traffic to.

Region string

The region in which to obtain the V2 Compute client. Keypairs are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new floatingip_associate.

WaitUntilAssociated bool
FloatingIp string

The floating IP to associate.

InstanceId string

The instance to associte the floating IP with.

FixedIp string

The specific IP address to direct traffic to.

Region string

The region in which to obtain the V2 Compute client. Keypairs are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new floatingip_associate.

WaitUntilAssociated bool
floatingIp string

The floating IP to associate.

instanceId string

The instance to associte the floating IP with.

fixedIp string

The specific IP address to direct traffic to.

region string

The region in which to obtain the V2 Compute client. Keypairs are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new floatingip_associate.

waitUntilAssociated boolean
floating_ip str

The floating IP to associate.

instance_id str

The instance to associte the floating IP with.

fixed_ip str

The specific IP address to direct traffic to.

region str

The region in which to obtain the V2 Compute client. Keypairs are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new floatingip_associate.

wait_until_associated bool

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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing FloatingIpAssociate Resource

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

static get(resource_name, id, opts=None, fixed_ip=None, floating_ip=None, instance_id=None, region=None, wait_until_associated=None, __props__=None);
func GetFloatingIpAssociate(ctx *Context, name string, id IDInput, state *FloatingIpAssociateState, opts ...ResourceOption) (*FloatingIpAssociate, error)
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.

The following state arguments are supported:

FixedIp string

The specific IP address to direct traffic to.

FloatingIp string

The floating IP to associate.

InstanceId string

The instance to associte the floating IP with.

Region string

The region in which to obtain the V2 Compute client. Keypairs are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new floatingip_associate.

WaitUntilAssociated bool
FixedIp string

The specific IP address to direct traffic to.

FloatingIp string

The floating IP to associate.

InstanceId string

The instance to associte the floating IP with.

Region string

The region in which to obtain the V2 Compute client. Keypairs are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new floatingip_associate.

WaitUntilAssociated bool
fixedIp string

The specific IP address to direct traffic to.

floatingIp string

The floating IP to associate.

instanceId string

The instance to associte the floating IP with.

region string

The region in which to obtain the V2 Compute client. Keypairs are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new floatingip_associate.

waitUntilAssociated boolean
fixed_ip str

The specific IP address to direct traffic to.

floating_ip str

The floating IP to associate.

instance_id str

The instance to associte the floating IP with.

region str

The region in which to obtain the V2 Compute client. Keypairs are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new floatingip_associate.

wait_until_associated bool

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes
This Pulumi package is based on the openstack Terraform Provider.