Class 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,
});
}
}
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,
});
}
}
Inherited Members
Namespace: Pulumi.OpenStack.Compute
Assembly: Pulumi.OpenStack.dll
Syntax
public class FloatingIpAssociate : CustomResource
Constructors
View SourceFloatingIpAssociate(String, FloatingIpAssociateArgs, CustomResourceOptions)
Create a FloatingIpAssociate resource with the given unique name, arguments, and options.
Declaration
public FloatingIpAssociate(string name, FloatingIpAssociateArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| FloatingIpAssociateArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceFixedIp
The specific IP address to direct traffic to.
Declaration
public Output<string> FixedIp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
FloatingIp
The floating IP to associate.
Declaration
public Output<string> FloatingIp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceId
The instance to associte the floating IP with.
Declaration
public Output<string> InstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
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.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
WaitUntilAssociated
Declaration
public Output<bool?> WaitUntilAssociated { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Methods
View SourceGet(String, Input<String>, FloatingIpAssociateState, CustomResourceOptions)
Get an existing FloatingIpAssociate resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static FloatingIpAssociate Get(string name, Input<string> id, FloatingIpAssociateState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| FloatingIpAssociateState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| FloatingIpAssociate |