1. Packages
  2. Gcorelabs Provider
  3. API Docs
  4. Floatingip
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

gcorelabs.Floatingip

Explore with Pulumi AI

gcorelabs logo
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

    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:

    FixedIpAddress string
    FloatingipId string
    The ID of this resource.
    LastUpdated string
    MetadataMap Dictionary<string, string>
    PortId string
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    FixedIpAddress string
    FloatingipId string
    The ID of this resource.
    LastUpdated string
    MetadataMap map[string]string
    PortId string
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    fixedIpAddress String
    floatingipId String
    The ID of this resource.
    lastUpdated String
    metadataMap Map<String,String>
    portId String
    projectId Double
    projectName String
    regionId Double
    regionName String
    fixedIpAddress string
    floatingipId string
    The ID of this resource.
    lastUpdated string
    metadataMap {[key: string]: string}
    portId string
    projectId number
    projectName string
    regionId number
    regionName string
    fixed_ip_address str
    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
    fixedIpAddress String
    floatingipId String
    The ID of this resource.
    lastUpdated String
    metadataMap Map<String>
    portId String
    projectId Number
    projectName String
    regionId Number
    regionName String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Floatingip resource produces the following output properties:

    CreatedAt string
    FloatingIpAddress string
    Id string
    The provider-assigned unique ID for this managed resource.
    MetadataReadOnlies List<FloatingipMetadataReadOnly>
    RouterId string
    Status string
    UpdatedAt string
    CreatedAt string
    FloatingIpAddress string
    Id string
    The provider-assigned unique ID for this managed resource.
    MetadataReadOnlies []FloatingipMetadataReadOnly
    RouterId string
    Status string
    UpdatedAt string
    createdAt String
    floatingIpAddress String
    id String
    The provider-assigned unique ID for this managed resource.
    metadataReadOnlies List<FloatingipMetadataReadOnly>
    routerId String
    status String
    updatedAt String
    createdAt string
    floatingIpAddress string
    id string
    The provider-assigned unique ID for this managed resource.
    metadataReadOnlies FloatingipMetadataReadOnly[]
    routerId string
    status string
    updatedAt string
    created_at str
    floating_ip_address str
    id str
    The provider-assigned unique ID for this managed resource.
    metadata_read_onlies Sequence[FloatingipMetadataReadOnly]
    router_id str
    status str
    updated_at str
    createdAt String
    floatingIpAddress String
    id String
    The provider-assigned unique ID for this managed resource.
    metadataReadOnlies List<Property Map>
    routerId String
    status String
    updatedAt 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.
    The following state arguments are supported:
    CreatedAt string
    FixedIpAddress string
    FloatingIpAddress string
    FloatingipId string
    The ID of this resource.
    LastUpdated string
    MetadataMap Dictionary<string, string>
    MetadataReadOnlies List<FloatingipMetadataReadOnly>
    PortId string
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    RouterId string
    Status string
    UpdatedAt string
    CreatedAt string
    FixedIpAddress string
    FloatingIpAddress string
    FloatingipId string
    The ID of this resource.
    LastUpdated string
    MetadataMap map[string]string
    MetadataReadOnlies []FloatingipMetadataReadOnlyArgs
    PortId string
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    RouterId string
    Status string
    UpdatedAt string
    createdAt String
    fixedIpAddress String
    floatingIpAddress String
    floatingipId String
    The ID of this resource.
    lastUpdated String
    metadataMap Map<String,String>
    metadataReadOnlies List<FloatingipMetadataReadOnly>
    portId String
    projectId Double
    projectName String
    regionId Double
    regionName String
    routerId String
    status String
    updatedAt String
    createdAt string
    fixedIpAddress string
    floatingIpAddress string
    floatingipId string
    The ID of this resource.
    lastUpdated string
    metadataMap {[key: string]: string}
    metadataReadOnlies FloatingipMetadataReadOnly[]
    portId string
    projectId number
    projectName string
    regionId number
    regionName string
    routerId string
    status string
    updatedAt string
    createdAt String
    fixedIpAddress String
    floatingIpAddress String
    floatingipId String
    The ID of this resource.
    lastUpdated String
    metadataMap Map<String>
    metadataReadOnlies List<Property Map>
    portId String
    projectId Number
    projectName String
    regionId Number
    regionName String
    routerId String
    status String
    updatedAt String

    Supporting Types

    FloatingipMetadataReadOnly, FloatingipMetadataReadOnlyArgs

    Key string
    ReadOnly bool
    Value string
    Key string
    ReadOnly bool
    Value string
    key String
    readOnly Boolean
    value String
    key string
    readOnly boolean
    value string
    key str
    read_only bool
    value str
    key String
    readOnly Boolean
    value String

    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.
    gcorelabs logo
    gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core