vkcs.ComputeFloatingipAssociate
Explore with Pulumi AI
Associate a floating IP to an instance.
Example Usage
Automatically detect the correct network
import * as pulumi from "@pulumi/pulumi";
import * as vkcs from "@pulumi/vkcs";
const fipBasicNetworkingFloatingip = new vkcs.NetworkingFloatingip("fipBasicNetworkingFloatingip", {pool: "internet"});
const fipBasicComputeFloatingipAssociate = new vkcs.ComputeFloatingipAssociate("fipBasicComputeFloatingipAssociate", {
floatingIp: fipBasicNetworkingFloatingip.address,
instanceId: vkcs_compute_instance.basic.id,
});
import pulumi
import pulumi_vkcs as vkcs
fip_basic_networking_floatingip = vkcs.NetworkingFloatingip("fipBasicNetworkingFloatingip", pool="internet")
fip_basic_compute_floatingip_associate = vkcs.ComputeFloatingipAssociate("fipBasicComputeFloatingipAssociate",
floating_ip=fip_basic_networking_floatingip.address,
instance_id=vkcs_compute_instance["basic"]["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fipBasicNetworkingFloatingip, err := vkcs.NewNetworkingFloatingip(ctx, "fipBasicNetworkingFloatingip", &vkcs.NetworkingFloatingipArgs{
Pool: pulumi.String("internet"),
})
if err != nil {
return err
}
_, err = vkcs.NewComputeFloatingipAssociate(ctx, "fipBasicComputeFloatingipAssociate", &vkcs.ComputeFloatingipAssociateArgs{
FloatingIp: fipBasicNetworkingFloatingip.Address,
InstanceId: pulumi.Any(vkcs_compute_instance.Basic.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vkcs = Pulumi.Vkcs;
return await Deployment.RunAsync(() =>
{
var fipBasicNetworkingFloatingip = new Vkcs.NetworkingFloatingip("fipBasicNetworkingFloatingip", new()
{
Pool = "internet",
});
var fipBasicComputeFloatingipAssociate = new Vkcs.ComputeFloatingipAssociate("fipBasicComputeFloatingipAssociate", new()
{
FloatingIp = fipBasicNetworkingFloatingip.Address,
InstanceId = vkcs_compute_instance.Basic.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vkcs.NetworkingFloatingip;
import com.pulumi.vkcs.NetworkingFloatingipArgs;
import com.pulumi.vkcs.ComputeFloatingipAssociate;
import com.pulumi.vkcs.ComputeFloatingipAssociateArgs;
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 fipBasicNetworkingFloatingip = new NetworkingFloatingip("fipBasicNetworkingFloatingip", NetworkingFloatingipArgs.builder()
.pool("internet")
.build());
var fipBasicComputeFloatingipAssociate = new ComputeFloatingipAssociate("fipBasicComputeFloatingipAssociate", ComputeFloatingipAssociateArgs.builder()
.floatingIp(fipBasicNetworkingFloatingip.address())
.instanceId(vkcs_compute_instance.basic().id())
.build());
}
}
resources:
fipBasicNetworkingFloatingip:
type: vkcs:NetworkingFloatingip
properties:
pool: internet
fipBasicComputeFloatingipAssociate:
type: vkcs:ComputeFloatingipAssociate
properties:
floatingIp: ${fipBasicNetworkingFloatingip.address}
instanceId: ${vkcs_compute_instance.basic.id}
Explicitly set the network to attach to
import * as pulumi from "@pulumi/pulumi";
import * as vkcs from "@pulumi/vkcs";
const fipExplicitNetworkingFloatingip = new vkcs.NetworkingFloatingip("fipExplicitNetworkingFloatingip", {pool: "internet"});
const fipExplicitComputeFloatingipAssociate = new vkcs.ComputeFloatingipAssociate("fipExplicitComputeFloatingipAssociate", {
floatingIp: fipExplicitNetworkingFloatingip.address,
instanceId: vkcs_compute_instance.multiple_networks.id,
fixedIp: vkcs_compute_instance.multiple_networks.network[1].fixed_ip_v4,
});
import pulumi
import pulumi_vkcs as vkcs
fip_explicit_networking_floatingip = vkcs.NetworkingFloatingip("fipExplicitNetworkingFloatingip", pool="internet")
fip_explicit_compute_floatingip_associate = vkcs.ComputeFloatingipAssociate("fipExplicitComputeFloatingipAssociate",
floating_ip=fip_explicit_networking_floatingip.address,
instance_id=vkcs_compute_instance["multiple_networks"]["id"],
fixed_ip=vkcs_compute_instance["multiple_networks"]["network"][1]["fixed_ip_v4"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fipExplicitNetworkingFloatingip, err := vkcs.NewNetworkingFloatingip(ctx, "fipExplicitNetworkingFloatingip", &vkcs.NetworkingFloatingipArgs{
Pool: pulumi.String("internet"),
})
if err != nil {
return err
}
_, err = vkcs.NewComputeFloatingipAssociate(ctx, "fipExplicitComputeFloatingipAssociate", &vkcs.ComputeFloatingipAssociateArgs{
FloatingIp: fipExplicitNetworkingFloatingip.Address,
InstanceId: pulumi.Any(vkcs_compute_instance.Multiple_networks.Id),
FixedIp: pulumi.Any(vkcs_compute_instance.Multiple_networks.Network[1].Fixed_ip_v4),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vkcs = Pulumi.Vkcs;
return await Deployment.RunAsync(() =>
{
var fipExplicitNetworkingFloatingip = new Vkcs.NetworkingFloatingip("fipExplicitNetworkingFloatingip", new()
{
Pool = "internet",
});
var fipExplicitComputeFloatingipAssociate = new Vkcs.ComputeFloatingipAssociate("fipExplicitComputeFloatingipAssociate", new()
{
FloatingIp = fipExplicitNetworkingFloatingip.Address,
InstanceId = vkcs_compute_instance.Multiple_networks.Id,
FixedIp = vkcs_compute_instance.Multiple_networks.Network[1].Fixed_ip_v4,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vkcs.NetworkingFloatingip;
import com.pulumi.vkcs.NetworkingFloatingipArgs;
import com.pulumi.vkcs.ComputeFloatingipAssociate;
import com.pulumi.vkcs.ComputeFloatingipAssociateArgs;
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 fipExplicitNetworkingFloatingip = new NetworkingFloatingip("fipExplicitNetworkingFloatingip", NetworkingFloatingipArgs.builder()
.pool("internet")
.build());
var fipExplicitComputeFloatingipAssociate = new ComputeFloatingipAssociate("fipExplicitComputeFloatingipAssociate", ComputeFloatingipAssociateArgs.builder()
.floatingIp(fipExplicitNetworkingFloatingip.address())
.instanceId(vkcs_compute_instance.multiple_networks().id())
.fixedIp(vkcs_compute_instance.multiple_networks().network()[1].fixed_ip_v4())
.build());
}
}
resources:
fipExplicitNetworkingFloatingip:
type: vkcs:NetworkingFloatingip
properties:
pool: internet
fipExplicitComputeFloatingipAssociate:
type: vkcs:ComputeFloatingipAssociate
properties:
floatingIp: ${fipExplicitNetworkingFloatingip.address}
instanceId: ${vkcs_compute_instance.multiple_networks.id}
fixedIp: ${vkcs_compute_instance.multiple_networks.network[1].fixed_ip_v4}
Create ComputeFloatingipAssociate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ComputeFloatingipAssociate(name: string, args: ComputeFloatingipAssociateArgs, opts?: CustomResourceOptions);
@overload
def ComputeFloatingipAssociate(resource_name: str,
args: ComputeFloatingipAssociateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ComputeFloatingipAssociate(resource_name: str,
opts: Optional[ResourceOptions] = None,
floating_ip: Optional[str] = None,
instance_id: Optional[str] = None,
compute_floatingip_associate_id: Optional[str] = None,
fixed_ip: Optional[str] = None,
region: Optional[str] = None,
timeouts: Optional[ComputeFloatingipAssociateTimeoutsArgs] = None,
wait_until_associated: Optional[bool] = None)
func NewComputeFloatingipAssociate(ctx *Context, name string, args ComputeFloatingipAssociateArgs, opts ...ResourceOption) (*ComputeFloatingipAssociate, error)
public ComputeFloatingipAssociate(string name, ComputeFloatingipAssociateArgs args, CustomResourceOptions? opts = null)
public ComputeFloatingipAssociate(String name, ComputeFloatingipAssociateArgs args)
public ComputeFloatingipAssociate(String name, ComputeFloatingipAssociateArgs args, CustomResourceOptions options)
type: vkcs:ComputeFloatingipAssociate
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 ComputeFloatingipAssociateArgs
- 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 ComputeFloatingipAssociateArgs
- 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 ComputeFloatingipAssociateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ComputeFloatingipAssociateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ComputeFloatingipAssociateArgs
- 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 computeFloatingipAssociateResource = new Vkcs.ComputeFloatingipAssociate("computeFloatingipAssociateResource", new()
{
FloatingIp = "string",
InstanceId = "string",
ComputeFloatingipAssociateId = "string",
FixedIp = "string",
Region = "string",
Timeouts = new Vkcs.Inputs.ComputeFloatingipAssociateTimeoutsArgs
{
Create = "string",
},
WaitUntilAssociated = false,
});
example, err := vkcs.NewComputeFloatingipAssociate(ctx, "computeFloatingipAssociateResource", &vkcs.ComputeFloatingipAssociateArgs{
FloatingIp: pulumi.String("string"),
InstanceId: pulumi.String("string"),
ComputeFloatingipAssociateId: pulumi.String("string"),
FixedIp: pulumi.String("string"),
Region: pulumi.String("string"),
Timeouts: &vkcs.ComputeFloatingipAssociateTimeoutsArgs{
Create: pulumi.String("string"),
},
WaitUntilAssociated: pulumi.Bool(false),
})
var computeFloatingipAssociateResource = new ComputeFloatingipAssociate("computeFloatingipAssociateResource", ComputeFloatingipAssociateArgs.builder()
.floatingIp("string")
.instanceId("string")
.computeFloatingipAssociateId("string")
.fixedIp("string")
.region("string")
.timeouts(ComputeFloatingipAssociateTimeoutsArgs.builder()
.create("string")
.build())
.waitUntilAssociated(false)
.build());
compute_floatingip_associate_resource = vkcs.ComputeFloatingipAssociate("computeFloatingipAssociateResource",
floating_ip="string",
instance_id="string",
compute_floatingip_associate_id="string",
fixed_ip="string",
region="string",
timeouts={
"create": "string",
},
wait_until_associated=False)
const computeFloatingipAssociateResource = new vkcs.ComputeFloatingipAssociate("computeFloatingipAssociateResource", {
floatingIp: "string",
instanceId: "string",
computeFloatingipAssociateId: "string",
fixedIp: "string",
region: "string",
timeouts: {
create: "string",
},
waitUntilAssociated: false,
});
type: vkcs:ComputeFloatingipAssociate
properties:
computeFloatingipAssociateId: string
fixedIp: string
floatingIp: string
instanceId: string
region: string
timeouts:
create: string
waitUntilAssociated: false
ComputeFloatingipAssociate 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 ComputeFloatingipAssociate resource accepts the following input properties:
- Floating
Ip string - required string → The floating IP to associate.
- Instance
Id string - required string → The instance to associate the floating IP with.
- Compute
Floatingip stringAssociate Id - string → ID of the resource.
- Fixed
Ip string - optional string → The specific IP address to direct traffic to.
- Region string
- optional 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. - Timeouts
Compute
Floatingip Associate Timeouts - Wait
Until boolAssociated
- Floating
Ip string - required string → The floating IP to associate.
- Instance
Id string - required string → The instance to associate the floating IP with.
- Compute
Floatingip stringAssociate Id - string → ID of the resource.
- Fixed
Ip string - optional string → The specific IP address to direct traffic to.
- Region string
- optional 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. - Timeouts
Compute
Floatingip Associate Timeouts Args - Wait
Until boolAssociated
- floating
Ip String - required string → The floating IP to associate.
- instance
Id String - required string → The instance to associate the floating IP with.
- compute
Floatingip StringAssociate Id - string → ID of the resource.
- fixed
Ip String - optional string → The specific IP address to direct traffic to.
- region String
- optional 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. - timeouts
Compute
Floatingip Associate Timeouts - wait
Until BooleanAssociated
- floating
Ip string - required string → The floating IP to associate.
- instance
Id string - required string → The instance to associate the floating IP with.
- compute
Floatingip stringAssociate Id - string → ID of the resource.
- fixed
Ip string - optional string → The specific IP address to direct traffic to.
- region string
- optional 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. - timeouts
Compute
Floatingip Associate Timeouts - wait
Until booleanAssociated
- floating_
ip str - required string → The floating IP to associate.
- instance_
id str - required string → The instance to associate the floating IP with.
- compute_
floatingip_ strassociate_ id - string → ID of the resource.
- fixed_
ip str - optional string → The specific IP address to direct traffic to.
- region str
- optional 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. - timeouts
Compute
Floatingip Associate Timeouts Args - wait_
until_ boolassociated
- floating
Ip String - required string → The floating IP to associate.
- instance
Id String - required string → The instance to associate the floating IP with.
- compute
Floatingip StringAssociate Id - string → ID of the resource.
- fixed
Ip String - optional string → The specific IP address to direct traffic to.
- region String
- optional 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. - timeouts Property Map
- wait
Until BooleanAssociated
Outputs
All input properties are implicitly available as output properties. Additionally, the ComputeFloatingipAssociate 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 ComputeFloatingipAssociate Resource
Get an existing ComputeFloatingipAssociate 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?: ComputeFloatingipAssociateState, opts?: CustomResourceOptions): ComputeFloatingipAssociate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compute_floatingip_associate_id: Optional[str] = None,
fixed_ip: Optional[str] = None,
floating_ip: Optional[str] = None,
instance_id: Optional[str] = None,
region: Optional[str] = None,
timeouts: Optional[ComputeFloatingipAssociateTimeoutsArgs] = None,
wait_until_associated: Optional[bool] = None) -> ComputeFloatingipAssociate
func GetComputeFloatingipAssociate(ctx *Context, name string, id IDInput, state *ComputeFloatingipAssociateState, opts ...ResourceOption) (*ComputeFloatingipAssociate, error)
public static ComputeFloatingipAssociate Get(string name, Input<string> id, ComputeFloatingipAssociateState? state, CustomResourceOptions? opts = null)
public static ComputeFloatingipAssociate get(String name, Output<String> id, ComputeFloatingipAssociateState state, CustomResourceOptions options)
resources: _: type: vkcs:ComputeFloatingipAssociate get: id: ${id}
- 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.
- Compute
Floatingip stringAssociate Id - string → ID of the resource.
- Fixed
Ip string - optional string → The specific IP address to direct traffic to.
- Floating
Ip string - required string → The floating IP to associate.
- Instance
Id string - required string → The instance to associate the floating IP with.
- Region string
- optional 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. - Timeouts
Compute
Floatingip Associate Timeouts - Wait
Until boolAssociated
- Compute
Floatingip stringAssociate Id - string → ID of the resource.
- Fixed
Ip string - optional string → The specific IP address to direct traffic to.
- Floating
Ip string - required string → The floating IP to associate.
- Instance
Id string - required string → The instance to associate the floating IP with.
- Region string
- optional 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. - Timeouts
Compute
Floatingip Associate Timeouts Args - Wait
Until boolAssociated
- compute
Floatingip StringAssociate Id - string → ID of the resource.
- fixed
Ip String - optional string → The specific IP address to direct traffic to.
- floating
Ip String - required string → The floating IP to associate.
- instance
Id String - required string → The instance to associate the floating IP with.
- region String
- optional 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. - timeouts
Compute
Floatingip Associate Timeouts - wait
Until BooleanAssociated
- compute
Floatingip stringAssociate Id - string → ID of the resource.
- fixed
Ip string - optional string → The specific IP address to direct traffic to.
- floating
Ip string - required string → The floating IP to associate.
- instance
Id string - required string → The instance to associate the floating IP with.
- region string
- optional 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. - timeouts
Compute
Floatingip Associate Timeouts - wait
Until booleanAssociated
- compute_
floatingip_ strassociate_ id - string → ID of the resource.
- fixed_
ip str - optional string → The specific IP address to direct traffic to.
- floating_
ip str - required string → The floating IP to associate.
- instance_
id str - required string → The instance to associate the floating IP with.
- region str
- optional 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. - timeouts
Compute
Floatingip Associate Timeouts Args - wait_
until_ boolassociated
- compute
Floatingip StringAssociate Id - string → ID of the resource.
- fixed
Ip String - optional string → The specific IP address to direct traffic to.
- floating
Ip String - required string → The floating IP to associate.
- instance
Id String - required string → The instance to associate the floating IP with.
- region String
- optional 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. - timeouts Property Map
- wait
Until BooleanAssociated
Supporting Types
ComputeFloatingipAssociateTimeouts, ComputeFloatingipAssociateTimeoutsArgs
- Create string
- Create string
- create String
- create string
- create str
- create String
Import
This resource can be imported by specifying all three arguments, separated by a forward slash:
$ pulumi import vkcs:index/computeFloatingipAssociate:ComputeFloatingipAssociate fip_1 <floating_ip>/<instance_id>/<fixed_ip>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vkcs vk-cs/terraform-provider-vkcs
- License
- Notes
- This Pulumi package is based on the
vkcs
Terraform Provider.