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
new FloatingIpAssociate(name: string, args: FloatingIpAssociateArgs, opts?: CustomResourceOptions);def FloatingIpAssociate(resource_name, opts=None, fixed_ip=None, floating_ip=None, instance_id=None, region=None, wait_until_associated=None, __props__=None);func NewFloatingIpAssociate(ctx *Context, name string, args FloatingIpAssociateArgs, opts ...ResourceOption) (*FloatingIpAssociate, error)public FloatingIpAssociate(string name, FloatingIpAssociateArgs args, CustomResourceOptions? opts = null)- 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:
- Floating
Ip string The floating IP to associate.
- Instance
Id string The instance to associte the floating IP with.
- Fixed
Ip 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
regionargument of the provider is used. Changing this creates a new floatingip_associate.- Wait
Until boolAssociated
- Floating
Ip string The floating IP to associate.
- Instance
Id string The instance to associte the floating IP with.
- Fixed
Ip 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
regionargument of the provider is used. Changing this creates a new floatingip_associate.- Wait
Until boolAssociated
- floating
Ip string The floating IP to associate.
- instance
Id string The instance to associte the floating IP with.
- fixed
Ip 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
regionargument of the provider is used. Changing this creates a new floatingip_associate.- wait
Until booleanAssociated
- 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
regionargument of the provider is used. Changing this creates a new floatingip_associate.- wait_
until_ boolassociated
Outputs
All input properties are implicitly available as output properties. Additionally, the FloatingIpAssociate resource produces the following output properties:
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.
public static get(name: string, id: Input<ID>, state?: FloatingIpAssociateState, opts?: CustomResourceOptions): FloatingIpAssociatestatic 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)public static FloatingIpAssociate Get(string name, Input<string> id, FloatingIpAssociateState? state, CustomResourceOptions? opts = null)- 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:
- Fixed
Ip string The specific IP address to direct traffic to.
- Floating
Ip string The floating IP to associate.
- Instance
Id 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
regionargument of the provider is used. Changing this creates a new floatingip_associate.- Wait
Until boolAssociated
- Fixed
Ip string The specific IP address to direct traffic to.
- Floating
Ip string The floating IP to associate.
- Instance
Id 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
regionargument of the provider is used. Changing this creates a new floatingip_associate.- Wait
Until boolAssociated
- fixed
Ip string The specific IP address to direct traffic to.
- floating
Ip string The floating IP to associate.
- instance
Id 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
regionargument of the provider is used. Changing this creates a new floatingip_associate.- wait
Until booleanAssociated
- 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
regionargument of the provider is used. Changing this creates a new floatingip_associate.- wait_
until_ boolassociated
Package Details
- Repository
- https://github.com/pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstackTerraform Provider.