gcorelabs.Floatingip
Explore with Pulumi AI
A floating IP is a static IP address that points to one of your Instances. It allows you to redirect network traffic to any of your Instances in the same datacenter.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const floatingIp = new gcore.index.Gcore_floatingip("floatingIp", {
projectId: 1,
regionId: 1,
});
// fixed_ip_address = "192.168.10.39" // instance`s interface ip
// port_id = "5c992875-f653-4b7b-af5b-1dc3019e5ffa" //instance`s interface port_id
import pulumi
import pulumi_gcore as gcore
floating_ip = gcore.index.Gcore_floatingip("floatingIp",
project_id=1,
region_id=1)
# fixed_ip_address = "192.168.10.39" // instance`s interface ip
# port_id = "5c992875-f653-4b7b-af5b-1dc3019e5ffa" //instance`s interface port_id
package main
import (
"github.com/pulumi/pulumi-gcore/sdk/go/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gcore.NewGcore_floatingip(ctx, "floatingIp", &gcore.Gcore_floatingipArgs{
ProjectId: 1,
RegionId: 1,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
var floatingIp = new Gcore.Index.Gcore_floatingip("floatingIp", new()
{
ProjectId = 1,
RegionId = 1,
});
// fixed_ip_address = "192.168.10.39" // instance`s interface ip
// port_id = "5c992875-f653-4b7b-af5b-1dc3019e5ffa" //instance`s interface port_id
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.gcore_floatingip;
import com.pulumi.gcore.Gcore_floatingipArgs;
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 floatingIp = new Gcore_floatingip("floatingIp", Gcore_floatingipArgs.builder()
.projectId(1)
.regionId(1)
.build());
// fixed_ip_address = "192.168.10.39" // instance`s interface ip
// port_id = "5c992875-f653-4b7b-af5b-1dc3019e5ffa" //instance`s interface port_id
}
}
resources:
floatingIp:
type: gcore:gcore_floatingip
properties:
projectId: 1
regionId: 1
Create Floatingip Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Floatingip(name: string, args?: FloatingipArgs, opts?: CustomResourceOptions);
@overload
def Floatingip(resource_name: str,
args: Optional[FloatingipArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Floatingip(resource_name: str,
opts: Optional[ResourceOptions] = None,
fixed_ip_address: Optional[str] = None,
floatingip_id: Optional[str] = None,
last_updated: Optional[str] = None,
metadata_map: Optional[Mapping[str, str]] = None,
port_id: Optional[str] = None,
project_id: Optional[float] = None,
project_name: Optional[str] = None,
region_id: Optional[float] = None,
region_name: Optional[str] = None)
func NewFloatingip(ctx *Context, name string, args *FloatingipArgs, opts ...ResourceOption) (*Floatingip, error)
public Floatingip(string name, FloatingipArgs? args = null, CustomResourceOptions? opts = null)
public Floatingip(String name, FloatingipArgs args)
public Floatingip(String name, FloatingipArgs args, CustomResourceOptions options)
type: gcorelabs:Floatingip
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 FloatingipArgs
- 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 FloatingipArgs
- 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 FloatingipArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FloatingipArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FloatingipArgs
- 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 floatingipResource = new Gcorelabs.Floatingip("floatingipResource", new()
{
FixedIpAddress = "string",
FloatingipId = "string",
LastUpdated = "string",
MetadataMap =
{
{ "string", "string" },
},
PortId = "string",
ProjectId = 0,
ProjectName = "string",
RegionId = 0,
RegionName = "string",
});
example, err := gcorelabs.NewFloatingip(ctx, "floatingipResource", &gcorelabs.FloatingipArgs{
FixedIpAddress: pulumi.String("string"),
FloatingipId: pulumi.String("string"),
LastUpdated: pulumi.String("string"),
MetadataMap: pulumi.StringMap{
"string": pulumi.String("string"),
},
PortId: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
ProjectName: pulumi.String("string"),
RegionId: pulumi.Float64(0),
RegionName: pulumi.String("string"),
})
var floatingipResource = new Floatingip("floatingipResource", FloatingipArgs.builder()
.fixedIpAddress("string")
.floatingipId("string")
.lastUpdated("string")
.metadataMap(Map.of("string", "string"))
.portId("string")
.projectId(0)
.projectName("string")
.regionId(0)
.regionName("string")
.build());
floatingip_resource = gcorelabs.Floatingip("floatingipResource",
fixed_ip_address="string",
floatingip_id="string",
last_updated="string",
metadata_map={
"string": "string",
},
port_id="string",
project_id=0,
project_name="string",
region_id=0,
region_name="string")
const floatingipResource = new gcorelabs.Floatingip("floatingipResource", {
fixedIpAddress: "string",
floatingipId: "string",
lastUpdated: "string",
metadataMap: {
string: "string",
},
portId: "string",
projectId: 0,
projectName: "string",
regionId: 0,
regionName: "string",
});
type: gcorelabs:Floatingip
properties:
fixedIpAddress: string
floatingipId: string
lastUpdated: string
metadataMap:
string: string
portId: string
projectId: 0
projectName: string
regionId: 0
regionName: string
Floatingip 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 Floatingip resource accepts the following input properties:
- Fixed
Ip stringAddress - Floatingip
Id string - The ID of this resource.
- Last
Updated string - Metadata
Map Dictionary<string, string> - Port
Id string - Project
Id double - Project
Name string - Region
Id double - Region
Name string
- Fixed
Ip stringAddress - Floatingip
Id string - The ID of this resource.
- Last
Updated string - Metadata
Map map[string]string - Port
Id string - Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string
- fixed
Ip StringAddress - floatingip
Id String - The ID of this resource.
- last
Updated String - metadata
Map Map<String,String> - port
Id String - project
Id Double - project
Name String - region
Id Double - region
Name String
- fixed
Ip stringAddress - floatingip
Id string - The ID of this resource.
- last
Updated string - metadata
Map {[key: string]: string} - port
Id string - project
Id number - project
Name string - region
Id number - region
Name string
- fixed_
ip_ straddress - floatingip_
id str - The ID of this resource.
- last_
updated str - metadata_
map Mapping[str, str] - port_
id str - project_
id float - project_
name str - region_
id float - region_
name str
- fixed
Ip StringAddress - floatingip
Id String - The ID of this resource.
- last
Updated String - metadata
Map Map<String> - port
Id String - project
Id Number - project
Name String - region
Id Number - region
Name String
Outputs
All input properties are implicitly available as output properties. Additionally, the Floatingip resource produces the following output properties:
- Created
At string - Floating
Ip stringAddress - Id string
- The provider-assigned unique ID for this managed resource.
- Metadata
Read List<FloatingipOnlies Metadata Read Only> - Router
Id string - Status string
- Updated
At string
- Created
At string - Floating
Ip stringAddress - Id string
- The provider-assigned unique ID for this managed resource.
- Metadata
Read []FloatingipOnlies Metadata Read Only - Router
Id string - Status string
- Updated
At string
- created
At String - floating
Ip StringAddress - id String
- The provider-assigned unique ID for this managed resource.
- metadata
Read List<FloatingipOnlies Metadata Read Only> - router
Id String - status String
- updated
At String
- created
At string - floating
Ip stringAddress - id string
- The provider-assigned unique ID for this managed resource.
- metadata
Read FloatingipOnlies Metadata Read Only[] - router
Id string - status string
- updated
At string
- created_
at str - floating_
ip_ straddress - id str
- The provider-assigned unique ID for this managed resource.
- metadata_
read_ Sequence[Floatingiponlies Metadata Read Only] - router_
id str - status str
- updated_
at str
- created
At String - floating
Ip StringAddress - id String
- The provider-assigned unique ID for this managed resource.
- metadata
Read List<Property Map>Onlies - router
Id String - status String
- updated
At String
Look up Existing Floatingip Resource
Get an existing Floatingip 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?: FloatingipState, opts?: CustomResourceOptions): Floatingip
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
fixed_ip_address: Optional[str] = None,
floating_ip_address: Optional[str] = None,
floatingip_id: Optional[str] = None,
last_updated: Optional[str] = None,
metadata_map: Optional[Mapping[str, str]] = None,
metadata_read_onlies: Optional[Sequence[FloatingipMetadataReadOnlyArgs]] = None,
port_id: Optional[str] = None,
project_id: Optional[float] = None,
project_name: Optional[str] = None,
region_id: Optional[float] = None,
region_name: Optional[str] = None,
router_id: Optional[str] = None,
status: Optional[str] = None,
updated_at: Optional[str] = None) -> Floatingip
func GetFloatingip(ctx *Context, name string, id IDInput, state *FloatingipState, opts ...ResourceOption) (*Floatingip, error)
public static Floatingip Get(string name, Input<string> id, FloatingipState? state, CustomResourceOptions? opts = null)
public static Floatingip get(String name, Output<String> id, FloatingipState state, CustomResourceOptions options)
resources: _: type: gcorelabs:Floatingip 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.
- Created
At string - Fixed
Ip stringAddress - Floating
Ip stringAddress - Floatingip
Id string - The ID of this resource.
- Last
Updated string - Metadata
Map Dictionary<string, string> - Metadata
Read List<FloatingipOnlies Metadata Read Only> - Port
Id string - Project
Id double - Project
Name string - Region
Id double - Region
Name string - Router
Id string - Status string
- Updated
At string
- Created
At string - Fixed
Ip stringAddress - Floating
Ip stringAddress - Floatingip
Id string - The ID of this resource.
- Last
Updated string - Metadata
Map map[string]string - Metadata
Read []FloatingipOnlies Metadata Read Only Args - Port
Id string - Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Router
Id string - Status string
- Updated
At string
- created
At String - fixed
Ip StringAddress - floating
Ip StringAddress - floatingip
Id String - The ID of this resource.
- last
Updated String - metadata
Map Map<String,String> - metadata
Read List<FloatingipOnlies Metadata Read Only> - port
Id String - project
Id Double - project
Name String - region
Id Double - region
Name String - router
Id String - status String
- updated
At String
- created
At string - fixed
Ip stringAddress - floating
Ip stringAddress - floatingip
Id string - The ID of this resource.
- last
Updated string - metadata
Map {[key: string]: string} - metadata
Read FloatingipOnlies Metadata Read Only[] - port
Id string - project
Id number - project
Name string - region
Id number - region
Name string - router
Id string - status string
- updated
At string
- created_
at str - fixed_
ip_ straddress - floating_
ip_ straddress - floatingip_
id str - The ID of this resource.
- last_
updated str - metadata_
map Mapping[str, str] - metadata_
read_ Sequence[Floatingiponlies Metadata Read Only Args] - port_
id str - project_
id float - project_
name str - region_
id float - region_
name str - router_
id str - status str
- updated_
at str
- created
At String - fixed
Ip StringAddress - floating
Ip StringAddress - floatingip
Id String - The ID of this resource.
- last
Updated String - metadata
Map Map<String> - metadata
Read List<Property Map>Onlies - port
Id String - project
Id Number - project
Name String - region
Id Number - region
Name String - router
Id String - status String
- updated
At String
Supporting Types
FloatingipMetadataReadOnly, FloatingipMetadataReadOnlyArgs
Import
import using <project_id>:<region_id>:<floatingip_id> format
$ pulumi import gcorelabs:index/floatingip:Floatingip fip1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- gcorelabs g-core/terraform-provider-gcorelabs
- License
- Notes
- This Pulumi package is based on the
gcorelabs
Terraform Provider.